2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

InternalTimer fix

git-svn-id: https://svn.fhem.de/fhem/trunk@4756 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-01-27 21:15:50 +00:00
parent bc11b71a18
commit 43adfa8d4c
11 changed files with 19 additions and 18 deletions

View File

@ -238,7 +238,7 @@ HUEBridge_GetUpdate($)
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEBridge_GetUpdate", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEBridge_GetUpdate", $hash, 0);
}
my $result = HUEBridge_Call($hash, 'config', undef);

View File

@ -399,7 +399,7 @@ HUEDevice_Set($@)
} elsif( $defs{$name}->{helper}->{update_timeout}
&& !$hash->{helper}->{group} ) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+1, "HUEDevice_GetUpdate", $hash, 1);
InternalTimer(gettimeofday()+1, "HUEDevice_GetUpdate", $hash, 0);
} else {
RemoveInternalTimer($hash);
HUEDevice_GetUpdate( $hash );
@ -608,7 +608,7 @@ HUEDevice_GetUpdate($)
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEDevice_GetUpdate", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "HUEDevice_GetUpdate", $hash, 0);
}
my $result = HUEDevice_ReadFromServer($hash,$hash->{ID});

View File

@ -244,7 +244,7 @@ SYSSTAT_GetUpdate($)
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "SYSSTAT_GetUpdate", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "SYSSTAT_GetUpdate", $hash, 0);
return if( AttrVal($name,"disable", 0) > 0 );
}

View File

@ -154,7 +154,7 @@ mailcheck_Connect($)
$hash->{INTERVAL} = $interval;
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "mailcheck_poll", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "mailcheck_poll", $hash, 0);
#if( !$client->has_capability("IDLE") ) {
#mailcheck_Disconnect($hash);
@ -226,7 +226,7 @@ mailcheck_poll($)
my ($hash) = @_;
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "mailcheck_poll", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "mailcheck_poll", $hash, 0);
my $client = $hash->{CLIENT};
if( $client && $client->IsConnected && $client->IsAuthenticated ) {

View File

@ -93,7 +93,7 @@ speedtest_GetUpdate($)
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "speedtest_GetUpdate", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "speedtest_GetUpdate", $hash, 0);
}
my $server ="";

View File

@ -479,7 +479,7 @@ withings_poll($)
withings_pollUser($hash);
}
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "withings_poll", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "withings_poll", $hash, 0);
}
sub
@ -646,6 +646,7 @@ withings_Get($$@)
}
}
Log 3, "$name: >$hash->{SUBTYPE}< >>$cmd<<";
return "Unknown argument $cmd, choose one of $list";
}

View File

@ -376,7 +376,7 @@ panStamp_SendFromQueue($$)
$defs{$f}{QUEUE}->[0] ne "")
{
unshift(@{$hash->{QUEUE}}, "");
InternalTimer(gettimeofday()+$to, "panStamp_HandleWriteQueue", $hash, 1);
InternalTimer(gettimeofday()+$to, "panStamp_HandleWriteQueue", $hash, 0);
return;
}
}
@ -386,7 +386,7 @@ panStamp_SendFromQueue($$)
panStamp_SimpleWrite($hash, $bstring);
}
InternalTimer(gettimeofday()+$to, "panStamp_HandleWriteQueue", $hash, 1);
InternalTimer(gettimeofday()+$to, "panStamp_HandleWriteQueue", $hash, 0);
}
sub

View File

@ -182,7 +182,7 @@ SWAP_0000002200000003_Parse($$$$)
}
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+hex($hash->{'SWAP_0A-PeriodicTxInterval'})+10, "SWAP_0000002200000003_Watchdog", $hash, 1) if( defined $hash->{'SWAP_0A-PeriodicTxInterval'} );
InternalTimer(gettimeofday()+hex($hash->{'SWAP_0A-PeriodicTxInterval'})+10, "SWAP_0000002200000003_Watchdog", $hash, 0) if( defined $hash->{'SWAP_0A-PeriodicTxInterval'} );
}
sub
@ -190,7 +190,7 @@ SWAP_0000002200000003_Set($@)
{
my ($hash, $name, $cmd, $arg, $arg2, $arg3) = @_;
InternalTimer(gettimeofday()+10, "SWAP_0000002200000003_Watchdog", $hash, 1);
InternalTimer(gettimeofday()+10, "SWAP_0000002200000003_Watchdog", $hash, 0);
our $data = "00" x $hash->{CMD_SIZE};
sub ret($) {

View File

@ -148,7 +148,7 @@ JeeLink_Set($@)
} elsif( $cmd eq "LaCrossePairForSec" ) {
return "Usage: set $name LaCrossePairForSec <seconds_active> [ignore_battery]" if(!$arg || $arg !~ m/^\d+$/ || ($arg2 && $arg2 ne "ignore_battery") );
$hash->{LaCrossePair} = $arg2?2:1;
InternalTimer(gettimeofday()+$arg, "JeeLink_RemoveLaCrossePair", $hash, 1);
InternalTimer(gettimeofday()+$arg, "JeeLink_RemoveLaCrossePair", $hash, 0);
} else {
return "Unknown argument $cmd, choose one of ".$list;
@ -332,7 +332,7 @@ JeeLink_SendFromQueue($$)
$defs{$f}{QUEUE}->[0] ne "")
{
unshift(@{$hash->{QUEUE}}, "");
InternalTimer(gettimeofday()+$to, "JeeLink_HandleWriteQueue", $hash, 1);
InternalTimer(gettimeofday()+$to, "JeeLink_HandleWriteQueue", $hash, 0);
return;
}
}
@ -342,7 +342,7 @@ JeeLink_SendFromQueue($$)
JeeLink_SimpleWrite($hash, $bstring);
}
InternalTimer(gettimeofday()+$to, "JeeLink_HandleWriteQueue", $hash, 1);
InternalTimer(gettimeofday()+$to, "JeeLink_HandleWriteQueue", $hash, 0);
}
sub

View File

@ -151,7 +151,7 @@ LaCrosse_Set($@)
}
return "Usage: set $name replaceBatteryForSec <seconds_active> [ignore_battery]" if(!$arg || $arg !~ m/^\d+$/ || ($arg2 && $arg2 ne "ignore_battery"));
$hash->{replaceBattery} = $arg2?2:1;
InternalTimer(gettimeofday()+$arg, "LaCrosse_RemoveReplaceBattery", $hash, 1);
InternalTimer(gettimeofday()+$arg, "LaCrosse_RemoveReplaceBattery", $hash, 0);
} else {
return "Unknown argument $cmd, choose one of ".$list;

View File

@ -131,7 +131,7 @@ CO20_Connect($)
$hash->{INTERVAL} = $interval;
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+10, "CO20_poll", $hash, 1);
InternalTimer(gettimeofday()+10, "CO20_poll", $hash, 0);
my $buf;
$hash->{DEV}->interrupt_read(0x00000081, $buf, 0x0000010, 1000);
@ -194,7 +194,7 @@ CO20_poll($)
if(!$hash->{LOCAL}) {
RemoveInternalTimer($hash);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "CO20_poll", $hash, 1);
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "CO20_poll", $hash, 0);
}
if( $hash->{manufacturer} && $hash->{product} ) {