diff --git a/script.service.hue/addon.xml b/script.service.hue/addon.xml index 1e97387c..215a34d1 100644 --- a/script.service.hue/addon.xml +++ b/script.service.hue/addon.xml @@ -1,4 +1,4 @@ - + @@ -20,7 +20,7 @@ https://github.com/zim514/script.service.hue https://forum.kodi.tv/showthread.php?tid=344886 - v1.5.8 + v2.0.0 - Hue API V2 support (requires reconfiguration of scenes and ambilight) - Now uses standard scenes - Sunrise is now manually configured (Default 8AM) @@ -30,7 +30,6 @@ - Various bug fixes - Localisation updates from Weblate - Automatitza les llums Hue amb la reproducció de Kodi Automatizace Hue světel s přehráváním Kodi diff --git a/script.service.hue/resources/lib/core.py b/script.service.hue/resources/lib/core.py index 37bd84a9..1a0ec5e1 100644 --- a/script.service.hue/resources/lib/core.py +++ b/script.service.hue/resources/lib/core.py @@ -194,7 +194,8 @@ def _run_sunset(self): def _set_daytime(self): now = datetime.now() - + xbmc.log(f"[SCRIPT.SERVICE.HUE] _set_daytime(): Morning Time: {self.morning_time}, Now: {now.time()}, bridge.sunset: {self.bridge.sunset}") + xbmc.log(f"[SCRIPT.SERVICE.HUE] _set_daytime(): Morning Time: {type(self.morning_time)}, Now: {type(now.time())}, bridge.sunset: {type(self.bridge.sunset)}") if self.morning_time <= now.time() < self.bridge.sunset: cache_set("daytime", True) else: diff --git a/script.service.hue/resources/lib/lightgroup.py b/script.service.hue/resources/lib/lightgroup.py index 3596a64f..568b1979 100644 --- a/script.service.hue/resources/lib/lightgroup.py +++ b/script.service.hue/resources/lib/lightgroup.py @@ -227,6 +227,7 @@ def _is_within_schedule(self): # Check if schedule setting is enabled if schedule_enabled: + xbmc.log(f"[SCRIPT.SERVICE.HUE] Schedule enabled: {schedule_enabled}, start: {schedule_start}, end: {schedule_end}") xbmc.log(f"[SCRIPT.SERVICE.HUE] Schedule enabled: {schedule_enabled}, start: {schedule_start}, end: {schedule_end}") # Check if current time is within start and end times if schedule_start < datetime.now().time() < schedule_end: diff --git a/script.service.hue/resources/lib/settings.py b/script.service.hue/resources/lib/settings.py index d5540daa..cc2e30f8 100644 --- a/script.service.hue/resources/lib/settings.py +++ b/script.service.hue/resources/lib/settings.py @@ -45,9 +45,9 @@ def reload_settings(self): self.daylight_disable = ADDON.getSettingBool("daylightDisable") self.schedule_enabled = ADDON.getSettingBool("enableSchedule") - self.morning_time = ADDON.getSettingString("morningTime") - self.schedule_start = ADDON.getSettingString("startTime") - self.schedule_end = ADDON.getSettingString("endTime") + self.morning_time = convert_time(ADDON.getSettingString("morningTime")) + self.schedule_start = convert_time(ADDON.getSettingString("startTime")) + self.schedule_end = convert_time(ADDON.getSettingString("endTime")) # video activation settings self.minimum_duration = ADDON.getSettingInt("video_MinimumDuration") @@ -118,9 +118,7 @@ def _validate_ambilight(self): def _validate_schedule(self): xbmc.log(f"[SCRIPT.SERVICE.HUE] Validate schedule. Schedule Enabled: {self.schedule_enabled}, Start time: {self.schedule_start}, End time: {self.schedule_end}") if self.schedule_enabled: - start_time = convert_time(self.schedule_start) - end_time = convert_time(self.schedule_end) - if start_time > end_time: # checking if start time is after the end time + if self.schedule_start > self.schedule_end: # checking if start time is after the end time ADDON.setSettingBool('EnableSchedule', False) xbmc.log('[SCRIPT.SERVICE.HUE] _validate_schedule: Start time is after end time, schedule disabled') notification(_('Hue Service'), _('Invalid start or end time, schedule disabled'), icon=xbmcgui.NOTIFICATION_ERROR)