diff --git a/fhem/FHEM/95_holiday.pm b/fhem/FHEM/95_holiday.pm index 4b8fe489d..167deb0fc 100644 --- a/fhem/FHEM/95_holiday.pm +++ b/fhem/FHEM/95_holiday.pm @@ -199,6 +199,19 @@ holiday_refresh($;$$) Log 1, "Wrong distance spec: $l"; next; } + } elsif($l =~ m/^6/) { # own calculation + my @args = split(" +", $l, 4); + my $res = "?"; + no strict "refs"; + eval { $res = &{$args[1]}($args[2]); }; + use strict "refs"; + if($@) { + Log 1, "holiday: Error in own function: $@"; + next; + } + if($res eq $fordate) { + $found = $args[3]; + } } push @foundList, $found if($found); @@ -430,6 +443,28 @@ holiday_FW_detailFn($$$$) 5 1 Mon 01 31 First Monday after Jan, 31st (1st Monday in February)
+
  • 6
    + Use a perl function to calculate a date. Function must return the result as + an exact date in format "mm-dd", e.g. "12-02"
    +
    + Example:
    + +
    + Explanation:
    + +
    + this will call "calcAdvent(21)" to calculate a date.
    + Errors will be logged in Loglevel 1.
    +

  • @@ -560,6 +595,28 @@ holiday_FW_detailFn($$$$) 5 1 Mon 01 31 Erster Montag in Februar
    +
  • 6
    + Datum mit einer perl Funktion berechnen. Das Ergebnis muss ein exaktes + Datum im Format "mm-dd" sein, z.B."12-02"
    +
    + Beispiel:
    + +
    + Erklärung:
    + +
    + erzeugt einen Funktionsaufruf "calcAdvent(21)" zur Berechnung eines Datums.
    + Fehler werden im Loglevel 1 protokolliert.
    +