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:
parent
f07849bc1a
commit
b552f13908
@ -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"
|
||||
|
@ -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"
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user