Skip to content

Commit 449f2db

Browse files
committed
fix: inverse logic
I only need to add a prefix when it is not day. Signed-off-by: André Jaenisch <[email protected]>
1 parent 6f4c1de commit 449f2db

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

weather-api-widget/weather.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ local function worker(user_args)
295295
layout = wibox.layout.flex.horizontal,
296296
update = function(self, weather)
297297
local day_night_extension = ""
298-
if weather.is_day then
298+
if not weather.is_day then
299299
day_night_extension = "-night"
300300
end
301301

@@ -322,7 +322,7 @@ local function worker(user_args)
322322
-- Free plan allows forecast for up to three days, each with hours
323323
if i > 3 then break end
324324
local day_night_extension = ""
325-
if day.is_day then
325+
if not day.is_day then
326326
day_night_extension = "-night"
327327
end
328328

@@ -591,7 +591,7 @@ local function worker(user_args)
591591
local result = json.decode(stdout)
592592

593593
local day_night_extension = ""
594-
if result.current.is_day then
594+
if not result.current.is_day then
595595
day_night_extension = "-night"
596596
end
597597

0 commit comments

Comments
 (0)