diff --git a/fhem/CHANGED b/fhem/CHANGED index 3c54ff491..74aa5c9a3 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII - SVN + - feature: WeatherAsHtmlH() added to 59_Weather.pm (Boris) - feature: new module I2C_BMP180 for reading I2C digital pressure sensor BMP180 or BMP085 connected to Raspberry Pi (Dirk) - feature: new module 35_SWAP_0000002200000003 for panstamp rgb led driver diff --git a/fhem/FHEM/59_Weather.pm b/fhem/FHEM/59_Weather.pm index ab1a29f8c..31d7794bf 100755 --- a/fhem/FHEM/59_Weather.pm +++ b/fhem/FHEM/59_Weather.pm @@ -466,7 +466,7 @@ WeatherIconIMGTag($) { ##################################### sub -WeatherAsHtml($) +WeatherAsHtmlV($) { my ($d) = @_; @@ -476,8 +476,8 @@ WeatherAsHtml($) my $width= int(ICONSCALE*ICONWIDTH); - my $ret = sprintf("
%s | %s %s°C %s%% %s |
%s | %s %s°C %s%% %s |
%s | %s: %s min %s°C max %s°C |
| ',
+ $width,
+ WeatherIconIMGTag(ReadingsVal($d, "icon", "")),
+ ReadingsVal($d, "condition", ""),
+ ReadingsVal($d, "temp_c", ""), ReadingsVal($d, "humidity", ""),
+ ReadingsVal($d, "wind_condition", ""));
+
+
+ for(my $i=1; $i<=5; $i++) {
+ $ret .= sprintf('
| ',
$width,
WeatherIconIMGTag(ReadingsVal($d, "fc${i}_icon", "")),
ReadingsVal($d, "fc${i}_day_of_week", ""),
@@ -496,10 +532,9 @@ WeatherAsHtml($)
ReadingsVal($d, "fc${i}_low_c", ""), ReadingsVal($d, "fc${i}_high_c", ""));
}
- $ret .= "
WeatherAsHtml
, WeatherAsHtmlV
and
+ WeatherAsHtmlH
. The former two functions are identical: they return the HTML code for a
+ vertically arranged weather forecast. The latter returns the HTML code for a horizontally arranged weather forecast.+ define MyWeatherWeblink weblink htmlCode { WeatherAsHtmlH("MyWeather") } ++ +
get <name> <reading>
city | name of town returned for location |
code | current condition code |