Timerfunktion wieder aktiviert

This commit is contained in:
Marko Oldenburg 2016-11-13 10:44:02 +01:00
parent e07c4bb561
commit 135d1dc99a
2 changed files with 20 additions and 20 deletions

View File

@ -46,7 +46,7 @@ use JSON;
use HttpUtils; use HttpUtils;
my $version = "0.3.11"; my $version = "0.3.15";
@ -128,11 +128,11 @@ sub NUKIBridge_Define($$) {
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
#if( $init_done ) { if( $init_done ) {
# NUKIBridge_firstRun($hash) if( ($hash->{HOST}) and ($hash->{TOKEN}) ); NUKIBridge_firstRun($hash) if( ($hash->{HOST}) and ($hash->{TOKEN}) );
#} else { } else {
# InternalTimer( gettimeofday()+15, "NUKIBridge_firstRun", $hash, 0 ) if( ($hash->{HOST}) and ($hash->{TOKEN}) ); InternalTimer( gettimeofday()+15, "NUKIBridge_firstRun", $hash, 0 ) if( ($hash->{HOST}) and ($hash->{TOKEN}) );
#} }
$modules{NUKIBridge}{defptr}{$hash->{HOST}} = $hash; $modules{NUKIBridge}{defptr}{$hash->{HOST}} = $hash;
@ -324,7 +324,7 @@ sub NUKIBridge_firstRun($) {
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
NUKIBridge_Call($hash,$hash,"list",undef,undef) if( !IsDisabled($name) ); NUKIBridge_Call($hash,$hash,"list",undef,undef) if( !IsDisabled($name) );
#InternalTimer( gettimeofday()+3, "NUKIBridge_GetCheckBridgeAlive", $hash, 1 ); InternalTimer( gettimeofday()+3, "NUKIBridge_GetCheckBridgeAlive", $hash, 0 );
Log3 $name, 4, "NUKIBridge ($name) - Call NUKIBridge_Get" if( !IsDisabled($name) ); Log3 $name, 4, "NUKIBridge ($name) - Call NUKIBridge_Get" if( !IsDisabled($name) );
@ -342,8 +342,8 @@ sub NUKIBridge_GetCheckBridgeAlive($) {
NUKIBridge_Call($hash,$hash,"info",undef,undef); NUKIBridge_Call($hash,$hash,"info",undef,undef);
#InternalTimer( gettimeofday()+$hash->{INTERVAL}, "NUKIBridge_GetCheckBridgeAlive", $hash, 1 ); InternalTimer( gettimeofday()+$hash->{INTERVAL}, "NUKIBridge_GetCheckBridgeAlive", $hash, 1 );
#Log3 $name, 4, "NUKIBridge ($name) - Call InternalTimer for NUKIBridge_GetCheckBridgeAlive"; Log3 $name, 4, "NUKIBridge ($name) - Call InternalTimer for NUKIBridge_GetCheckBridgeAlive";
} }
return 1; return 1;
@ -370,7 +370,7 @@ sub NUKIBridge_Call($$$$$) {
HttpUtils_NonblockingGet( HttpUtils_NonblockingGet(
{ {
url => $uri, url => $uri,
timeout => 10, timeout => 15,
hash => $hash, hash => $hash,
chash => $chash, chash => $chash,
endpoint => $path, endpoint => $path,

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.11"; my $version = "0.3.15";
@ -120,11 +120,11 @@ sub NUKIDevice_Define($$) {
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
#if( $init_done ) { if( $init_done ) {
# NUKIDevice_GetUpdateInternalTimer($hash); NUKIDevice_GetUpdateInternalTimer($hash);
#} else { } else {
# InternalTimer(gettimeofday()+20, "NUKIDevice_GetUpdateInternalTimer", $hash, 0); InternalTimer(gettimeofday()+20, "NUKIDevice_GetUpdateInternalTimer", $hash, 0);
#} }
return undef; return undef;
} }
@ -253,12 +253,12 @@ sub NUKIDevice_GetUpdateInternalTimer($) {
my $name = $hash->{NAME}; my $name = $hash->{NAME};
#NUKIDevice_GetUpdate($hash); NUKIDevice_GetUpdate($hash);
#Log3 $name, 5, "NUKIDevice ($name) - Call NUKIDevice_GetUpdate"; Log3 $name, 5, "NUKIDevice ($name) - Call NUKIDevice_GetUpdate";
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
#InternalTimer(gettimeofday()+$hash->{INTERVAL}, "NUKIDevice_GetUpdateInternalTimer", $hash, 0) if( $hash->{INTERVAL} ); InternalTimer(gettimeofday()+$hash->{INTERVAL}, "NUKIDevice_GetUpdateInternalTimer", $hash, 1) if( $hash->{INTERVAL} );
#Log3 $name, 5, "NUKIDevice ($name) - Call InternalTimer"; Log3 $name, 5, "NUKIDevice ($name) - Call InternalTimer";
} }
sub NUKIDevice_ReadFromNUKIBridge($@) { sub NUKIDevice_ReadFromNUKIBridge($@) {