2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

57_Calendar: new attribute delay

git-svn-id: https://svn.fhem.de/fhem/trunk@21910 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2020-05-10 12:22:05 +00:00
parent 00c80a2c97
commit 6fd4d445be
2 changed files with 18 additions and 2 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: 57_Calendar: new attribute delay
- feature: 72_XiaomiDevice: supporting EvpHumidifier and AirPurifier3H
- remove: 98_DSBMobile: removed due to unavailability of API
- feature: 73_DoorBird: ftui image history as links

View File

@ -1722,6 +1722,7 @@ sub Calendar_Initialize($) {
$hash->{NotifyFn}= "Calendar_Notify";
$hash->{AttrList}= "update:none,onUrlChanged ".
"synchronousUpdate:0,1 ".
"delay " .
"removevcalendar:0,1 " .
"ignoreCancelled:0,1 ".
"SSLVerify:0,1 ".
@ -1845,7 +1846,7 @@ sub Calendar_Notify($$)
# update calendar after initialization or change of configuration
# wait 10 to 29 seconds to avoid congestion due to concurrent activities
Calendar_DisarmTimer($hash);
my $delay= 10+int(rand(20));
my $delay= AttrVal($name, "delay", 10+int(rand(20)));
Log3 $hash, 5, "Calendar $name: FHEM initialization or rereadcfg triggered update, delay $delay seconds.";
InternalTimer(time()+$delay, "Calendar_Wakeup", $hash, 0) ;
@ -3676,6 +3677,13 @@ sub CalendarEventsAsHtml($;$) {
If this attribute is set to <code>none</code>, the calendar will not be updated at all.
</li><p>
<li><code>delay &lt;time&gt;</code><br>
The waiting time in seconds after the initialization of FHEM or a configuration change before
actually retrieving the calendar from its source. If not set, a random time between 10 and 29
seconds is chosen. When several calendar devices are defined, staggered delays reduce
load error rates.
</li><p>
<li><code>removevcalendar 0|1</code><br>
If this attribute is set to 1, the vCalendar will be discarded after the processing to reduce the memory consumption of the module.
A retrieval via <code>get &lt;name&gt; vcalendar</code> is then no longer possible.
@ -4279,7 +4287,7 @@ sub CalendarEventsAsHtml($;$) {
<br>
<a name="Calendarattr"></a>
<b>Attributes</b>
<b>Attribute</b>
<br><br>
<ul>
<li><code>defaultFormat &lt;formatSpec&gt;</code><br>
@ -4307,6 +4315,13 @@ sub CalendarEventsAsHtml($;$) {
URL seit dem letzten Aufruf ver&auml;ndert hat, insbesondere nach der Auswertung von wildcards im define.<br/>
</li><p>
<li><code>delay &lt;time&gt;</code><br>
Wartezeit in Sekunden nach der Initialisierung von FHEM oder einer Konfigurations&auml;nderung bevor
der Kalender tats&auml;chlich von der Quelle geladen wird. Wenn nicht gesetzt wird eine
Zufallszeit zwischen 10 und 29 Sekunden gew&auml;hlt. Wenn mehrere Kalender definiert sind, f&uuml;hren
gestaffelte Wartezeiten zu einer Verminderung der Ladefehleranf&auml;lligkeit.
</li><p>
<li><code>removevcalendar 0|1</code><br>
Wenn dieses Attribut auf 1 gesetzt ist, wird der vCalendar nach der Verarbeitung verworfen,
gleichzeitig reduziert sich der Speicherverbrauch des Moduls.