#198: correct logic
This commit is contained in:
parent
153806998f
commit
0802b5a704
2 changed files with 8 additions and 8 deletions
|
@ -126,9 +126,9 @@ local function worker(args)
|
||||||
|
|
||||||
if not err and weather_now and tonumber(weather_now["cod"]) == 200 then
|
if not err and weather_now and tonumber(weather_now["cod"]) == 200 then
|
||||||
-- weather icon based on localtime
|
-- weather icon based on localtime
|
||||||
now = os.time() - (utc * 3600)
|
now = os.time()
|
||||||
sunrise = tonumber(weather_now["sys"]["sunrise"])
|
sunrise = tonumber(weather_now["sys"]["sunrise"]) + (utc * 3600)
|
||||||
sunset = tonumber(weather_now["sys"]["sunset"])
|
sunset = tonumber(weather_now["sys"]["sunset"]) + (utc * 3600)
|
||||||
icon = weather_now["weather"][1]["icon"]
|
icon = weather_now["weather"][1]["icon"]
|
||||||
|
|
||||||
if sunrise <= now and now <= sunset then
|
if sunrise <= now and now <= sunset then
|
||||||
|
|
Loading…
Add table
Reference in a new issue