2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 16:46:35 +00:00

98_weekdayTimer.pm: Allow flexible state values when execution is delayed by function call

git-svn-id: https://svn.fhem.de/fhem/trunk@22989 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2020-10-19 06:10:01 +00:00
parent 0c92e91a2b
commit a8719cebc9
2 changed files with 6 additions and 4 deletions

View File

@ -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.
- feature: 98_WeekdayTimer: Allow flexible state values when delayed.
- feature: 89_FULLY: Several new commands. Now using JSON.
- change: 59_Weather: add forcast attributs to english commandref
- bugfix: TimeSeries: fix for calculation of standard deviation

View File

@ -950,8 +950,9 @@ sub WeekdayTimer_Update {
#Log3 $hash, 3, "[$name] $idx ". $time . " " . $newParam . " " . join("",@$tage);
# Fenserkontakte abfragen - wenn einer im Status closed, dann Schaltung um 60 Sekunden verzögern
if (WeekdayTimer_FensterOffen($hash, $newParam, $idx)) {
readingsSingleUpdate ($hash, "state", "open window", 1);
my $winopen = WeekdayTimer_FensterOffen($hash, $newParam, $idx);
if ($winopen) {
readingsSingleUpdate ($hash, "state", ($winopen == 1 or lc($winopen) eq "true") ? "open window" : $winopen, 1);
return;
}
@ -1095,7 +1096,7 @@ sub WeekdayTimer_FensterOffen {
WeekdayTimer_RemoveInternalTimer("$time", $hash);
WeekdayTimer_InternalTimer ("$time", $nextRetry, "$hash->{TYPE}_Update", $hash, 0);
$hash->{VERZOEGRUNG} = 1;
return 1;
return $verzoegerteAusfuehrung;
}
my %contacts = ( "CUL_FHTTK" => { "READING" => "Window", "STATUS" => "(Open)", "MODEL" => "r" },
@ -1560,7 +1561,7 @@ sub WeekdayTimer_GetWeekprofileReadingTriplett {
attr wd delayedExecutionCond isDelayed("$WEEKDAYTIMER","$TIME","$NAME","$EVENT")
</pre>
the parameter $WEEKDAYTIMER(timer name) $TIME $NAME(device name) $EVENT are replaced at runtime by the correct value.
<br><br>
<br><br>Note: If the function returns "1" or "true", state of the WeekdayTimer will be "open window", other return values will be used as values for state.<br>
<b>Example of a function:</b>
<pre>
sub isDelayed($$$$) {