2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

59_Weather: fix for warning caused by empty wind speed

git-svn-id: https://svn.fhem.de/fhem/trunk@11004 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2016-03-06 11:41:45 +00:00
parent 56e8d4dff2
commit e921040ae9

View File

@ -465,7 +465,7 @@ sub Weather_RetrieveDataFinished($$$)
$value =~/chill="(-?[0-9.]*?)" .*direction="([0-9.]*?)" .*speed="([0-9.]*?)" .*/;
$urlResult->{"readings"}->{"wind_chill"} = $1 if (defined($1));
$urlResult->{"readings"}->{"wind_direction"} = $2 if defined($2);
my $windspeed= defined($3) ? int($3+0.5) : "";
my $windspeed= defined($3) and ($3 ne "") ? int($3+0.5) : "";
$urlResult->{"readings"}->{"wind_speed"} = $windspeed;
$urlResult->{"readings"}->{"wind"} = $windspeed;# duplicate for compatibility
if (defined($2) & defined($3)) {