mirror of https://github.com/lcpz/lain.git
#198: correct logic
This commit is contained in:
parent
153806998f
commit
0802b5a704
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue