weather: fix parsing of negative temperatures
Signed-off-by: Adrian C. (anrxc) <anrxc@sysphere.org>
This commit is contained in:
parent
2100ea1d8c
commit
fba4db6d37
|
@ -54,9 +54,9 @@ local function worker(format, station)
|
||||||
weather["{weather}"] = -- Weather conditions if available
|
weather["{weather}"] = -- Weather conditions if available
|
||||||
string.match(ws, "Weather:[%s](.-)[%c]") or weather["{weather}"]
|
string.match(ws, "Weather:[%s](.-)[%c]") or weather["{weather}"]
|
||||||
weather["{tempf}"] = -- Temperature in fahrenheit
|
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
|
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
|
weather["{humid}"] = -- Relative humidity in percent
|
||||||
string.match(ws, "Relative[%s]Humidity:[%s]([%d]+)%%") or weather["{humid}"]
|
string.match(ws, "Relative[%s]Humidity:[%s]([%d]+)%%") or weather["{humid}"]
|
||||||
weather["{press}"] = -- Pressure in hPa
|
weather["{press}"] = -- Pressure in hPa
|
||||||
|
|
Loading…
Reference in New Issue