2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

ROOMMATE, GUEST, RESIDENTS: stop any running wakeuptimers if user went away

git-svn-id: https://svn.fhem.de/fhem/trunk@8565 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2015-05-11 06:33:33 +00:00
parent f07849bc1a
commit b552f13908
3 changed files with 39 additions and 0 deletions

View File

@ -925,6 +925,19 @@ sub RESIDENTS_UpdateReadings (@) {
$newstate = "unspecified";
}
# stop any running wakeup-timers in case user went away
if ( $newstate eq "away" || $newstate eq "gone"|| $newstate eq "none" ) {
my $wakeupDeviceList = AttrVal( $name, "rgr_wakeupDevice", 0 );
for my $wakeupDevice ( split /,/, $wakeupDeviceList ) {
next if !$wakeupDevice;
if ( defined( $defs{$wakeupDevice} ) && $defs{$wakeupDevice}{TYPE} eq "dummy" ) {
fhem "set $wakeupDevice:FILTER=running!=0 stop";
}
}
}
# calculate presence state
$presence = "present"
if ( $newstate ne "gone"

View File

@ -463,6 +463,19 @@ sub GUEST_Set($@) {
);
}
# stop any running wakeup-timers in case user went away
if ( $newstate eq "away" || $newstate eq "gone" ) {
my $wakeupDeviceList = AttrVal( $name, "rg_wakeupDevice", 0 );
for my $wakeupDevice ( split /,/, $wakeupDeviceList ) {
next if !$wakeupDevice;
if ( defined( $defs{$wakeupDevice} ) && $defs{$wakeupDevice}{TYPE} eq "dummy" ) {
fhem "set $wakeupDevice:FILTER=running!=0 stop";
}
}
}
# calculate presence state
my $newpresence =
( $newstate ne "none"

View File

@ -465,6 +465,19 @@ sub ROOMMATE_Set($@) {
);
}
# stop any running wakeup-timers in case user went away
if ( $newstate eq "away" || $newstate eq "gone"|| $newstate eq "none" ) {
my $wakeupDeviceList = AttrVal( $name, "rr_wakeupDevice", 0 );
for my $wakeupDevice ( split /,/, $wakeupDeviceList ) {
next if !$wakeupDevice;
if ( defined( $defs{$wakeupDevice} ) && $defs{$wakeupDevice}{TYPE} eq "dummy" ) {
fhem "set $wakeupDevice:FILTER=running!=0 stop";
}
}
}
# calculate presence state
my $newpresence =
( $newstate ne "none"