From 7a892ba2bb095fc5b413576284d43db03fc057b2 Mon Sep 17 00:00:00 2001 From: tupol Date: Sun, 24 Feb 2019 16:08:46 +0000 Subject: [PATCH] PROPLANTA: added PROPLANTA_Html_Landscape git-svn-id: https://svn.fhem.de/fhem/trunk@18714 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_PROPLANTA.pm | 56 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/59_PROPLANTA.pm b/fhem/FHEM/59_PROPLANTA.pm index ca5ba2a02..227cd1524 100644 --- a/fhem/FHEM/59_PROPLANTA.pm +++ b/fhem/FHEM/59_PROPLANTA.pm @@ -842,6 +842,58 @@ PROPLANTA_Html(@) return $ret; } +sub ##################################### +PROPLANTA_Html_Landscape(@) +{ + my ($d,$days) = @_; + $d = "" if(!$d); + $days = 3 unless defined $days; + return "$d is not a PROPLANTA instance
" + if(!$defs{$d} || $defs{$d}{TYPE} ne "PROPLANTA"); + + my $uselocal= 0; #AttrVal($d,"localicons",0); + my $isday; + if ( exists &isday) { + $isday = isday(); + } + else { + $isday = 1; #($hour>6 && $hour<19); + } + + my $ret = ""; + $ret .= ""; + $ret .= sprintf '', $defs{$d}{DEF}; + $ret .= ''; + for(my $i=0; $i<$days; $i++) { + if ($i==0) { + $ret .= '' : ''; + }; + + $ret .= ''; + for(my $i=0; $i<$days; $i++) { + $ret .= ''; + }; + $ret .= ''; + for(my $i=0; $i<$days; $i++) { + $ret .= ''; + }; + $ret .= ''; + for(my $i=0; $i<$days; $i++) { + $ret .= ''; + }; + $ret .= "
%s
Tagheute'; + } elsif ($i==1) { + $ret .= 'morgen'; + } else { + $ret .= ''.substr(ReadingsVal($d, "fc".$i."_date", ""),0,5); + } + $ret .= ReadingsVal($d, "fc".$i."_frost", "") ? ' (Frost)
Temp'.ReadingsVal($d, "fc".$i."_tempMin", "").'-'.ReadingsVal($d, "fc".$i."_tempMax", "").'℃
Regen'.ReadingsVal($d, "fc".$i."_chOfRainDay", "").'%
Wetter + + |
"; + + return $ret; +} + ##################################### 1; @@ -887,7 +939,7 @@ PROPLANTA_Html(@)
Optional. Possible values: de (default), at, ch, fr, it
- The function PROPLANTA_Html creates a HTML code for a weather forecast for the given days (default is 3). + The function PROPLANTA_Html and PROPLANTA_Html_Landscape creates a HTML code for a weather forecast for the given days (default is 3).
Example:
@@ -997,7 +1049,7 @@ PROPLANTA_Html(@)
Optional. Mögliche Werte: de (Standard), at, ch, fr, it
- Über die Funktion PROPLANTA_Html wird ein HTML-Code für eine Vorhersage für die angegebenen Anzahl Tage (standardmäßig 3) erzeugt. + Über die Funktion PROPLANTA_Html und PROPLANTA_Html_Landscape wird ein HTML-Code für eine Vorhersage für die angegebenen Anzahl Tage (standardmäßig 3) erzeugt.
Beispiel: