mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
73_PRESENCE: fix restart of threshold counter after FHEM restart (thx to DeeSPe & CoolTux, Forum: #71744)
git-svn-id: https://svn.fhem.de/fhem/trunk@14263 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
deeb3a154a
commit
0ac70f7ddf
@ -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: 73_PRESENCE: fix restart of threshold counter after FHEM restart
|
||||
- feature: 44_S7: new attribute receiveTimeoutMs
|
||||
- feature: 38_CO20: introduced state reading
|
||||
- change: 73_NUKIBridge,74_NUKIDevice: fix Perlwarnings
|
||||
|
@ -1289,7 +1289,8 @@ sub PRESENCE_ProcessState($$)
|
||||
{
|
||||
if(++$count >= $absenceThreshold)
|
||||
{
|
||||
readingsBulkUpdate($hash, ".absenceThresholdCounter", 0);
|
||||
readingsBulkUpdate($hash, ".presenceThresholdCounter", 0);
|
||||
readingsBulkUpdate($hash, ".absenceThresholdCounter", ($count-1));
|
||||
readingsBulkUpdate($hash, "state", "absent");
|
||||
readingsBulkUpdate($hash, "presence", "absent");
|
||||
}
|
||||
@ -1297,6 +1298,7 @@ sub PRESENCE_ProcessState($$)
|
||||
{
|
||||
$hash->{helper}{ABSENT_COUNT} = $count;
|
||||
|
||||
readingsBulkUpdate($hash, ".presenceThresholdCounter", 0);
|
||||
readingsBulkUpdate($hash, ".absenceThresholdCounter", $count);
|
||||
readingsBulkUpdate($hash, "state", "maybe absent");
|
||||
readingsBulkUpdate($hash, "presence", "maybe absent");
|
||||
@ -1334,7 +1336,8 @@ sub PRESENCE_ProcessState($$)
|
||||
{
|
||||
if(++$count >= $presenceThreshold)
|
||||
{
|
||||
readingsBulkUpdate($hash, ".presenceThresholdCounter", "0");
|
||||
readingsBulkUpdate($hash, ".absenceThresholdCounter", 0);
|
||||
readingsBulkUpdate($hash, ".presenceThresholdCounter", ($count-1));
|
||||
readingsBulkUpdate($hash, "state", "present");
|
||||
readingsBulkUpdate($hash, "presence", "present");
|
||||
|
||||
@ -1344,6 +1347,7 @@ sub PRESENCE_ProcessState($$)
|
||||
{
|
||||
$hash->{helper}{PRESENT_COUNT} = $count;
|
||||
|
||||
readingsBulkUpdate($hash, ".absenceThresholdCounter", 0);
|
||||
readingsBulkUpdate($hash, ".presenceThresholdCounter", $count);
|
||||
readingsBulkUpdate($hash, "state", "maybe present");
|
||||
readingsBulkUpdate($hash, "presence", "maybe present");
|
||||
|
Loading…
Reference in New Issue
Block a user