From 6fd4d445bec2a623247f6d915d777e9732ab198e Mon Sep 17 00:00:00 2001 From: borisneubert Date: Sun, 10 May 2020 12:22:05 +0000 Subject: [PATCH] 57_Calendar: new attribute delay git-svn-id: https://svn.fhem.de/fhem/trunk@21910 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/57_Calendar.pm | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 5c7626c3a..862bb8672 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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 diff --git a/fhem/FHEM/57_Calendar.pm b/fhem/FHEM/57_Calendar.pm index d73738ae8..9d35545bb 100644 --- a/fhem/FHEM/57_Calendar.pm +++ b/fhem/FHEM/57_Calendar.pm @@ -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 none, the calendar will not be updated at all.

+

  • delay <time>
    + 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. +
  • +

  • removevcalendar 0|1
    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 get <name> vcalendar is then no longer possible. @@ -4279,7 +4287,7 @@ sub CalendarEventsAsHtml($;$) {
    - Attributes + Attribute