FHEM Forum

FHEM => Sonstiges => Thema gestartet von: betateilchen am 23 April 2014, 10:40:03

Titel: [patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: betateilchen am 23 April 2014, 10:40:03
Bezugnehmend auf diese Idee

http://forum.fhem.de/index.php/topic,22646.msg160635.html#msg160635

schlage ich folgende Änderung im Modul 95_holiday.pm vor:


  if($internal) {
    readingsBeginUpdate($hash);
    readingsBulkUpdate($hash, 'state', $found);
    readingsBulkUpdate($hash, 'yesterday',  CommandGet(undef, "$name yesterday"));
    readingsBulkUpdate($hash, 'tomorrow',   CommandGet(undef, "$name tomorrow"));
    readingsEndUpdate($hash,1);
#    $hash->{STATE} = $found;
    return undef;
  } else {
    return $found;
  }


Das reading "yesterday" habe ich nur mit eingebaut, weil sonst bestimmt irgendjemand gekommen wäre, der wissen will, warum "morgen" beachtet wird,  "gestern" aber nicht  8)
Die Änderung ist abwärtskompatibel, da in state immer noch der (meistens wirklich relevante) Wert für "heute" steht.
Titel: Antw:[patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: rudolfkoenig am 23 April 2014, 12:46:22
Habs kurz getestet und eingecheckt.
Mit readingFnAttributes und Doku-Hinweis.
Titel: Antw:[patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: betateilchen am 12 Mai 2014, 21:36:30
Hallo Rudi,

damit holiday2we auch weiterhin korrekt funktioniert, sollte man in der fhem.pl noch eine Änderung nachziehen, für den Fall, dass jemand eine eventMap im holiday-Device setzt. fhem.pl prüft nämlich derzeit noch auf STATE und nicht auf state, wenn ich das richtig sehe.


  if(!$we) {
    my $h2we = $attr{global}{holiday2we};
    $we = 1 if($h2we && $value{$h2we} && $value{$h2we} ne "none");
  }


Problemthread z.B. hier: http://forum.fhem.de/index.php/topic,23532.0.html
Titel: Antw:[patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: rudolfkoenig am 16 Mai 2014, 22:38:23
Habs gefixed, siehe verlinktes Diskussion.
Apropos Link: dein Link funktioniert nur per Kopieren, nicht per draufklicken.
Titel: Antw:[patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: betateilchen am 17 Mai 2014, 16:19:53
Der Link funktioniert bei mir einwandfrei - gerade draufgeklickt.

Dürfte ein Problem Deines Browsers sein, nicht des Links selbst.
Titel: Antw:[patch] 95_holiday.pm - zusätzliche Readings für tomorrow (und yesterday)
Beitrag von: rudolfkoenig am 17 Mai 2014, 18:07:38
Komisch, jetzt tut der Link. Gestern stand da was von "session..." drin.