59_Weather: fix for warning caused by empty wind speed

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@11004 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert
2016-03-06 11:41:45 +00:00
parent e240fc0377
commit f844bf26f1

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)) {