From fba4db6d3764f95b7dbf9bb3794c4fe1587206c4 Mon Sep 17 00:00:00 2001 From: Martin Striz Date: Sun, 27 Dec 2009 18:39:12 +0100 Subject: weather: fix parsing of negative temperatures Signed-off-by: Adrian C. (anrxc) --- weather.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'weather.lua') diff --git a/weather.lua b/weather.lua index 57362c8..383be97 100644 --- a/weather.lua +++ b/weather.lua @@ -54,9 +54,9 @@ local function worker(format, station) weather["{weather}"] = -- Weather conditions if available string.match(ws, "Weather:[%s](.-)[%c]") or weather["{weather}"] weather["{tempf}"] = -- Temperature in fahrenheit - string.match(ws, "Temperature:[%s]([%d%.]+).*[%c]") or weather["{tempf}"] + string.match(ws, "Temperature:[%s]([%-]?[%d%.]+).*[%c]") or weather["{tempf}"] weather["{tempc}"] = -- Temperature in celsius - string.match(ws, "Temperature:[%s][%d%.]+[%s]F[%s]%(([%d%.]+)[%s]C%)[%c]") or weather["{tempc}"] + string.match(ws, "Temperature:[%s][%d%.]+[%s]F[%s]%(([%-]?[%d%.]+)[%s]C%)[%c]") or weather["{tempc}"] weather["{humid}"] = -- Relative humidity in percent string.match(ws, "Relative[%s]Humidity:[%s]([%d]+)%%") or weather["{humid}"] weather["{press}"] = -- Pressure in hPa -- cgit v1.2.3