From b56332f5e059bad304485601afd8638f4f55e521 Mon Sep 17 00:00:00 2001 From: Michael Stovenour Date: Wed, 1 Jan 2014 14:21:21 -0600 Subject: [PATCH] Fix issue #349: internet_weather.pl negative temp Modified regex to look for - sign on temperature Also corrected some perl warnings --- code/common/internet_weather.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/common/internet_weather.pl b/code/common/internet_weather.pl index ee5b8c981..393d3a70d 100644 --- a/code/common/internet_weather.pl +++ b/code/common/internet_weather.pl @@ -101,9 +101,9 @@ sub normalize_conditions { $forecast = read_all $f_weather_forecast; if (length($forecast) < 50) { - respond "app=weather Last weather forecast received was incomplete." + respond("app=weather Last weather forecast received was incomplete."); } else { - respond "app=weather $forecast"; + respond("app=weather $forecast"); } } @@ -113,7 +113,7 @@ sub normalize_conditions { $conditions = read_all $f_weather_conditions; $conditions = normalize_conditions($conditions); - respond "app=weather $conditions"; + respond("app=weather $conditions"); } if (done_now $p_weather_forecast) { @@ -140,7 +140,7 @@ sub normalize_conditions { $conditions = normalize_conditions($conditions); - $w{TempOutdoor} = $1 if $conditions =~ /(\d+) degrees/i; + $w{TempOutdoor} = $1 if $conditions =~ /(-?\d+) degrees/i; if ($conditions =~ /(\d+)\%/) { $w{HumidOutdoor} = $1; $w{HumidOutdoorMeasured}=1; # tell Weather_Common that we directly measured humidity