mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
98_RandomTimer: improvment when diabling a timer during active runtime
git-svn-id: https://svn.fhem.de/fhem/trunk@13356 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
53aff73ca0
commit
31c3aae9ef
@ -168,8 +168,9 @@ sub RandomTimer_Exec($) {
|
|||||||
Log3 $hash, 3, "[".$hash->{NAME}."]"." ending RandomTimer on $hash->{DEVICE}: "
|
Log3 $hash, 3, "[".$hash->{NAME}."]"." ending RandomTimer on $hash->{DEVICE}: "
|
||||||
. strftime("%H:%M:%S(%d)",localtime($hash->{helper}{startTime})) . " - "
|
. strftime("%H:%M:%S(%d)",localtime($hash->{helper}{startTime})) . " - "
|
||||||
. strftime("%H:%M:%S(%d)",localtime($hash->{helper}{stopTime}));
|
. strftime("%H:%M:%S(%d)",localtime($hash->{helper}{stopTime}));
|
||||||
RandomTimer_setState ($hash);
|
RandomTimer_down($hash);
|
||||||
RandomTimer_setActive($hash,0);
|
RandomTimer_setActive($hash,0);
|
||||||
|
RandomTimer_setState ($hash);
|
||||||
}
|
}
|
||||||
# Wenn aktiv und Abschaltzeit erreicht, dann Gerät ausschalten, Meldung ausgeben und Timer schließen
|
# Wenn aktiv und Abschaltzeit erreicht, dann Gerät ausschalten, Meldung ausgeben und Timer schließen
|
||||||
if ($stopTimeReached) {
|
if ($stopTimeReached) {
|
||||||
@ -264,9 +265,9 @@ sub RandomTimer_Attr($$$) {
|
|||||||
|
|
||||||
if( $attrName ~~ ["disable","disableCond"] ) {
|
if( $attrName ~~ ["disable","disableCond"] ) {
|
||||||
|
|
||||||
#RandomTimer_setState($hash); # funktioniert nicht, weil zu diesem Zeitpunkt der Attributwerte noch nicht gesetzt ist.
|
# Schaltung vorziehen, damit bei einem disable abgeschaltet wird.
|
||||||
RemoveInternalTimer($hash);
|
myRemoveInternalTimer("Exec", $hash);
|
||||||
InternalTimer (time()+1, "RandomTimer_setState", $hash, 0);
|
myInternalTimer ("Exec", time()+1, "RandomTimer_Exec", $hash, 0);
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user