bugfix call IODev Problem

This commit is contained in:
Marko Oldenburg 2016-12-11 14:38:58 +01:00
parent c28def5a05
commit 02db6dbad7
2 changed files with 7 additions and 4 deletions

View File

@ -46,7 +46,7 @@ use JSON;
use HttpUtils; use HttpUtils;
my $version = "0.3.30"; my $version = "0.3.31";

View File

@ -33,7 +33,7 @@ use warnings;
use JSON; use JSON;
#use Time::HiRes qw(gettimeofday); #use Time::HiRes qw(gettimeofday);
my $version = "0.3.30"; my $version = "0.3.31";
@ -223,7 +223,7 @@ sub NUKIDevice_GetUpdateTimer($) {
if( !IsDisabled($name) ) { if( !IsDisabled($name) ) {
NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} ); NUKIDevice_ReadFromNUKIBridge($hash, "lockState", undef, $hash->{NUKIID} );
Log3 $name, 5, "NUKIDevice ($name) - NUKIDevice_GetUpdate Call NUKIDevice_ReadFromNUKIBridge"; Log3 $name, 5, "NUKIDevice ($name) - NUKIDevice_GetUpdateTimer Call NUKIDevice_ReadFromNUKIBridge";
InternalTimer( gettimeofday()+12+int(rand(18)), "NUKIDevice_GetUpdateTimer", $hash, 1 ); InternalTimer( gettimeofday()+12+int(rand(18)), "NUKIDevice_GetUpdateTimer", $hash, 1 );
} }
@ -247,13 +247,16 @@ sub NUKIDevice_ReadFromNUKIBridge($@) {
my ($hash,@a) = @_; my ($hash,@a) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
return "IODev $hash->{IODev} is not connected" if( ReadingsVal($hash->{IODev},"state","not connected") eq "not connected" ); Log3 $name, 4, "NUKIDevice ($name) - NUKIDevice_ReadFromNUKIBridge check Bridge connected";
return "IODev $hash->{IODev} is not connected" if( ReadingsVal($hash->{IODev}->{NAME},"state","not connected") eq "not connected" );
no strict "refs"; no strict "refs";
my $ret; my $ret;
unshift(@a,$name); unshift(@a,$name);
Log3 $name, 4, "NUKIDevice ($name) - NUKIDevice_ReadFromNUKIBridge Bridge is connected call IOWrite";
$ret = IOWrite($hash,$hash,@a); $ret = IOWrite($hash,$hash,@a);
use strict "refs"; use strict "refs";
return $ret; return $ret;