mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-26 10:34:52 +00:00
PRESENCE: add set command active/inactive (by KernSani, Forum: #95696)
git-svn-id: https://svn.fhem.de/fhem/trunk@18314 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b27a4f1454
commit
04455e653d
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- feature: 73_PRESENCE: new set command active/inactive to temporarily
|
||||||
|
disable presence checks
|
||||||
- bugfix: DarkSkyAPI: fix reading values, add API Version
|
- bugfix: DarkSkyAPI: fix reading values, add API Version
|
||||||
- bugfix: 82_LGTV_WebOS: add SkyOnline at set commands
|
- bugfix: 82_LGTV_WebOS: add SkyOnline at set commands
|
||||||
- feature: 49_SSCam: 8.5.0, SVS device has "snapCams" command to take
|
- feature: 49_SSCam: 8.5.0, SVS device has "snapCams" command to take
|
||||||
|
@ -58,7 +58,7 @@ PRESENCE_Initialize($)
|
|||||||
"presenceTimeout ".
|
"presenceTimeout ".
|
||||||
"powerCmd ".
|
"powerCmd ".
|
||||||
$readingFnAttributes;
|
$readingFnAttributes;
|
||||||
|
|
||||||
$hash->{AttrRenameMap} = { "ping_count" => "pingCount",
|
$hash->{AttrRenameMap} = { "ping_count" => "pingCount",
|
||||||
"bluetooth_hci_device" => "bluetoothHciDevice",
|
"bluetooth_hci_device" => "bluetoothHciDevice",
|
||||||
"fritzbox_speed" => "fritzboxCheckSpeed"
|
"fritzbox_speed" => "fritzboxCheckSpeed"
|
||||||
@ -342,6 +342,7 @@ PRESENCE_Set($@)
|
|||||||
|
|
||||||
$usage .= " overrideInterval" if($hash->{MODE} !~ /^event|lan-bluetooth$/);
|
$usage .= " overrideInterval" if($hash->{MODE} !~ /^event|lan-bluetooth$/);
|
||||||
$usage .= " clearOverride:noArg" if($hash->{INTERVAL_OVERRIDED});
|
$usage .= " clearOverride:noArg" if($hash->{INTERVAL_OVERRIDED});
|
||||||
|
$usage .= " inactive:noArg active:noArg";
|
||||||
|
|
||||||
if($a[1] eq "statusRequest")
|
if($a[1] eq "statusRequest")
|
||||||
{
|
{
|
||||||
@ -403,6 +404,40 @@ PRESENCE_Set($@)
|
|||||||
{
|
{
|
||||||
delete($hash->{INTERVAL_OVERRIDED});
|
delete($hash->{INTERVAL_OVERRIDED});
|
||||||
}
|
}
|
||||||
|
elsif($a[1] eq "inactive")
|
||||||
|
{
|
||||||
|
if(defined($hash->{FD}))
|
||||||
|
{
|
||||||
|
DevIo_SimpleWrite($hash, "stop\n", 2);
|
||||||
|
}
|
||||||
|
RemoveInternalTimer($hash);
|
||||||
|
$hash->{helper}{DISABLED} = 1;
|
||||||
|
readingsSingleUpdate($hash, "state", "disabled",1);
|
||||||
|
}
|
||||||
|
elsif($a[1] eq "active")
|
||||||
|
{
|
||||||
|
readingsSingleUpdate($hash, "state", "defined",0) if(exists($hash->{helper}{DISABLED}) and $hash->{helper}{DISABLED} == 1);
|
||||||
|
|
||||||
|
if(defined($hash->{DeviceName}))
|
||||||
|
{
|
||||||
|
$hash->{helper}{DISABLED} = 0;
|
||||||
|
|
||||||
|
if(defined($hash->{FD}))
|
||||||
|
{
|
||||||
|
PRESENCE_DoInit($hash) if(exists($hash->{helper}{DISABLED}));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$hash->{helper}{DISABLED} = 0;
|
||||||
|
PRESENCE_StartLocalScan($hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return $usage;
|
return $usage;
|
||||||
@ -427,14 +462,15 @@ PRESENCE_Attr(@)
|
|||||||
|
|
||||||
if(defined($hash->{DeviceName}))
|
if(defined($hash->{DeviceName}))
|
||||||
{
|
{
|
||||||
|
$hash->{helper}{DISABLED} = 0;
|
||||||
|
|
||||||
if(defined($hash->{FD}))
|
if(defined($hash->{FD}))
|
||||||
{
|
{
|
||||||
PRESENCE_DoInit($hash) if(exists($hash->{helper}{DISABLED}));
|
PRESENCE_DoInit($hash) if(exists($hash->{helper}{DISABLED}));
|
||||||
$hash->{helper}{DISABLED} = 0;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$hash->{helper}{DISABLED} = 0;
|
|
||||||
DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
|
DevIo_OpenDev($hash, 0, "PRESENCE_DoInit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user