mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-08 13:24:56 +00:00
PRESENCE: fixing not working timer, when using set [...] statusRequest
git-svn-id: https://svn.fhem.de/fhem/trunk@7184 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
03abbe1da1
commit
ae0abde28f
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: PRESENCE: fixing not working timer, when using set [...] statusRequest
|
||||
- bugfix: FB_CALLMONITOR: fixing reverse search for klicktel.de
|
||||
- feature: new module 52_I2C_MCP342x.pm added (klausw)
|
||||
- feature: SYSMON: read cpu temp on FritzBox
|
||||
|
@ -42,8 +42,6 @@ PRESENCE_Initialize($)
|
||||
{
|
||||
my ($hash) = @_;
|
||||
|
||||
require "$attr{global}{modpath}/FHEM/DevIo.pm";
|
||||
|
||||
# Provider
|
||||
$hash->{ReadFn} = "PRESENCE_Read";
|
||||
$hash->{ReadyFn} = "PRESENCE_Ready";
|
||||
@ -229,8 +227,6 @@ PRESENCE_Define($$)
|
||||
{
|
||||
return DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -269,8 +265,8 @@ PRESENCE_Set($@)
|
||||
if($hash->{MODE} ne "lan-bluetooth")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting local scan";
|
||||
PRESENCE_StartLocalScan($hash, 1);
|
||||
return undef;
|
||||
|
||||
return PRESENCE_StartLocalScan($hash, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -468,13 +464,11 @@ PRESENCE_Read($)
|
||||
}
|
||||
|
||||
readingsEndUpdate($hash, 1);
|
||||
|
||||
}
|
||||
|
||||
sub
|
||||
PRESENCE_DoInit($)
|
||||
{
|
||||
|
||||
my ($hash) = @_;
|
||||
|
||||
if( not exists($hash->{helper}{DISABLED}) or (exists($hash->{helper}{DISABLED}) and $hash->{helper}{DISABLED} == 0))
|
||||
@ -488,7 +482,6 @@ PRESENCE_DoInit($)
|
||||
}
|
||||
|
||||
return undef;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -498,7 +491,6 @@ PRESENCE_Ready($)
|
||||
my ($hash) = @_;
|
||||
|
||||
return DevIo_OpenDev($hash, 1, "PRESENCE_DoInit") if($hash->{MODE} eq "lan-bluetooth");
|
||||
|
||||
}
|
||||
|
||||
##########################################################################################################################
|
||||
@ -517,41 +509,50 @@ sub PRESENCE_StartLocalScan($;$)
|
||||
|
||||
if(not (exists($hash->{ADDRESS}) or exists($hash->{helper}{call})))
|
||||
{
|
||||
return;
|
||||
return undef;
|
||||
}
|
||||
|
||||
$hash->{STATE} = "active" if($hash->{STATE} eq "???" or $hash->{STATE} eq "defined");
|
||||
unless(exists($hash->{helper}{RUNNING_PID}))
|
||||
{
|
||||
$hash->{STATE} = "active" if($hash->{STATE} eq "???" or $hash->{STATE} eq "defined");
|
||||
|
||||
if($local == 0)
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - stopping timer";
|
||||
RemoveInternalTimer($hash);
|
||||
}
|
||||
if($local == 0)
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - stopping timer";
|
||||
RemoveInternalTimer($hash);
|
||||
}
|
||||
|
||||
if($mode eq "local-bluetooth")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode local-bluetooth";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalBluetoothScan", $name."|".$hash->{ADDRESS}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
|
||||
if($mode eq "local-bluetooth")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode local-bluetooth";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalBluetoothScan", $name."|".$hash->{ADDRESS}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||
}
|
||||
elsif($mode eq "lan-ping")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode lan-ping";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalPingScan", $name."|".$hash->{ADDRESS}."|".$local."|".AttrVal($name, "ping_count", "4"), "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||
}
|
||||
elsif($mode eq "fritzbox")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode fritzbox";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFritzBoxScan", $name."|".$hash->{ADDRESS}."|".$local."|".AttrVal($name, "fritzbox_speed", "0"), "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||
}
|
||||
elsif($mode eq "shellscript")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode shellscript";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalShellScriptScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||
}
|
||||
elsif($mode eq "function")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode function";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFunctionScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash);
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
elsif($mode eq "lan-ping")
|
||||
else
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode lan-ping";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalPingScan", $name."|".$hash->{ADDRESS}."|".$local."|".AttrVal($name, "ping_count", "4"), "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
|
||||
}
|
||||
elsif($mode eq "fritzbox")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode fritzbox";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFritzBoxScan", $name."|".$hash->{ADDRESS}."|".$local."|".AttrVal($name, "fritzbox_speed", "0"), "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
|
||||
}
|
||||
elsif($mode eq "shellscript")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode shellscript";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalShellScriptScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
|
||||
}
|
||||
elsif($mode eq "function")
|
||||
{
|
||||
Log3 $name, 5, "PRESENCE ($name) - starting blocking call for mode function";
|
||||
$hash->{helper}{RUNNING_PID} = BlockingCall("PRESENCE_DoLocalFunctionScan", $name."|".$hash->{helper}{call}."|".$local, "PRESENCE_ProcessLocalScan", 60, "PRESENCE_ProcessAbortedScan", $hash) unless(exists($hash->{helper}{RUNNING_PID}));
|
||||
return "another check is currently running";
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user