From ca193cd9f73bbb16ef4f3aefc2750c6289143a70 Mon Sep 17 00:00:00 2001 From: ntruchsess <> Date: Tue, 1 Apr 2014 13:13:55 +0000 Subject: [PATCH] OWX_ASYNC: add attribute 'timeout' (for synchronous gets) git-svn-id: https://svn.fhem.de/fhem/trunk@5399 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_OWX_ASYNC.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/00_OWX_ASYNC.pm b/fhem/FHEM/00_OWX_ASYNC.pm index a4cf17945..d5e677463 100644 --- a/fhem/FHEM/00_OWX_ASYNC.pm +++ b/fhem/FHEM/00_OWX_ASYNC.pm @@ -256,7 +256,7 @@ sub OWX_ASYNC_Disconnect($) { if (defined $async) { $async->exit($hash); }; - my $times = AttrVal($hash,"timeout",5000) / 50; #timeout in ms, defaults to 1 sec? + my $times = AttrVal($hash->{NAME},"timeout",5000) / 50; #timeout in ms, defaults to 1 sec? for (my $i=0;$i<$times;$i++) { OWX_ASYNC_Poll($hash); if ($hash->{STATE} ne "Active") { @@ -327,7 +327,7 @@ sub OWX_ASYNC_AwaitAlarmsResponse($) { #-- get the interface my $async = $hash->{ASYNC}; if (defined $async) { - my $times = AttrVal($hash,"timeout",5000) / 50; #timeout in ms, defaults to 1 sec #TODO add attribute timeout? + my $times = AttrVal($hash->{NAME},"timeout",5000) / 50; #timeout in ms, defaults to 1 sec #TODO add attribute timeout? for (my $i=0;$i<$times;$i++) { if(! defined $hash->{ALARMDEVS} ) { select (undef,undef,undef,0.05); @@ -490,7 +490,7 @@ sub OWX_ASYNC_AwaitSearchResponse($) { #-- Discover all devices on the 1-Wire bus, they will be found in $hash->{DEVS} if (defined $async) { - my $times = AttrVal($hash,"timeout",5000) / 50; #timeout in ms, defaults to 1 sec #TODO add attribute timeout? + my $times = AttrVal($hash->{NAME},"timeout",5000) / 50; #timeout in ms, defaults to 1 sec #TODO add attribute timeout? for (my $i=0;$i<$times;$i++) { if(! defined $hash->{DEVS} ) { select (undef,undef,undef,0.05); @@ -849,7 +849,7 @@ sub OWX_ASYNC_Set($@) { } Log3 ($name,3, "OWX_ASYNC_Set $name ".join(" ",@a)." => $res"); - DoTrigger($name, undef) if($init_done); + DoTrigger($name, undef) if($main::init_done); return "OWX_ASYNC_Set => $name ".join(" ",@a)." => $res"; } @@ -943,7 +943,7 @@ sub OWX_AwaitExecuteResponse($$$) { #-- Discover all devices on the 1-Wire bus, they will be found in $hash->{DEVS} if (defined $async and defined $owx_dev and defined $context) { - my $times = AttrVal($hash,"timeout",5000) / 50; #timeout in ms, defaults to 1 sec + my $times = AttrVal($hash->{NAME},"timeout",5000) / 50; #timeout in ms, defaults to 1 sec for (my $i=0;$i<$times;$i++) { if(! defined $hash->{replies}{$owx_dev}{$context}) { select (undef,undef,undef,0.05);