diff --git a/docs/commandref.html b/docs/commandref.html index ab174b754..31ec6bd5b 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -7285,7 +7285,7 @@ AB600, Duewi, DomiaLite, COCO) and others.
Define
diff --git a/webfrontend/pgm2/01_FHEMWEB.pm b/webfrontend/pgm2/01_FHEMWEB.pm index 0220bf0ea..480c990f3 100755 --- a/webfrontend/pgm2/01_FHEMWEB.pm +++ b/webfrontend/pgm2/01_FHEMWEB.pm @@ -2003,4 +2003,34 @@ FW_devState($$) return ($allSets, $cmdlist, $txt); } +##################################### +# This has to be modularized in the future. +sub +WeatherAsHtml($) +{ + my ($d) = @_; + $d = "" if(!$d); + return "$d is not a Weather instance
" + if(!$defs{$d} || $defs{$d}{TYPE} ne "Weather"); + my $imgHome="http://www.google.com"; + + my $ret = ""; + $ret .= sprintf('', + $imgHome, ReadingsVal($d, "icon", ""), + ReadingsVal($d, "condition", ""), + ReadingsVal($d, "temp_c", ""), ReadingsVal($d, "humidity", ""), + ReadingsVal($d, "wind_condition", "")); + + for(my $i=1; $i<=4; $i++) { + $ret .= sprintf('', + $imgHome, ReadingsVal($d, "fc${i}_icon", ""), + ReadingsVal($d, "fc${i}_day_of_week", ""), + ReadingsVal($d, "fc${i}_condition", ""), + ReadingsVal($d, "fc${i}_low_c", ""), ReadingsVal($d, "fc${i}_high_c", "")); + } + + $ret .= "
%s
temp %s, hum %s, %s
%s: %s
min %s max %s
"; + return $ret; +} + 1;