From 4ea1d2ec62ab03f6233d6fcf5475f04d5661b0bd Mon Sep 17 00:00:00 2001 From: Eric Matte Date: Sat, 15 Jun 2024 22:07:36 -0400 Subject: [PATCH] Skip invalid color --- apps/media_lights_sync/media_lights_sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/media_lights_sync/media_lights_sync.py b/apps/media_lights_sync/media_lights_sync.py index cdf01dd..ba64fa6 100644 --- a/apps/media_lights_sync/media_lights_sync.py +++ b/apps/media_lights_sync/media_lights_sync.py @@ -70,7 +70,7 @@ def change_lights_color(self, entity, attribute, old_url, new_url, kwargs): self.media_player_callbacks[entity] = current_pictures for i in range(len(self.lights)): color = self.get_saturated_color(rgb_colors[i]) if self.use_saturated_colors else rgb_colors[i] - if color == [0, 0, 0]: + if color == [0, 0, 0] or len(color) == 0: self.log("Skipped black color for '{entity}' light".format(entity=self.lights[i])) continue self.set_light("on", self.lights[i], color=color, brightness=self.brightness, transition=self.transition)