Skip to content

Commit

Permalink
Support empty sunsets (fix diyHue crash)
Browse files Browse the repository at this point in the history
  • Loading branch information
zim514 committed Sep 26, 2024
1 parent 7d3fb44 commit b5262ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script.service.hue/resources/lib/hue.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def update_sunset(self):
geolocation = self.make_api_request("GET", "geolocation")
log(f"[SCRIPT.SERVICE.HUE] v2 update_sunset(): geolocation: {geolocation}")
sunset_str = self.search_dict(geolocation, "sunset_time")
if sunset_str is None:
if sunset_str is None or sunset_str == "":
log(f"[SCRIPT.SERVICE.HUE] Sunset not found; configure Hue geolocalisation")
notification(_("Hue Service"), _("Configure Hue Home location to use Sunset time, defaulting to 19:00"), icon=xbmcgui.NOTIFICATION_ERROR)
self.sunset = convert_time("19:00")
Expand Down

0 comments on commit b5262ba

Please sign in to comment.