#198: correct logic

This commit is contained in:
copycat-killer 2016-05-30 21:01:44 +02:00
parent 153806998f
commit 0802b5a704
2 changed files with 8 additions and 8 deletions

View File

@ -1,10 +1,10 @@
--[[
Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham
* (c) 2013, Rman
Licensed under GNU General Public License v2
* (c) 2013, Luke Bonham
* (c) 2013, Rman
--]]
local newtimer = require("lain.helpers").newtimer

View File

@ -126,9 +126,9 @@ local function worker(args)
if not err and weather_now and tonumber(weather_now["cod"]) == 200 then
-- weather icon based on localtime
now = os.time() - (utc * 3600)
sunrise = tonumber(weather_now["sys"]["sunrise"])
sunset = tonumber(weather_now["sys"]["sunset"])
now = os.time()
sunrise = tonumber(weather_now["sys"]["sunrise"]) + (utc * 3600)
sunset = tonumber(weather_now["sys"]["sunset"]) + (utc * 3600)
icon = weather_now["weather"][1]["icon"]
if sunrise <= now and now <= sunset then