Skip to content

Commit

Permalink
Skip invalid color
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmatte committed Jun 16, 2024
1 parent 6d0586c commit 4ea1d2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/media_lights_sync/media_lights_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4ea1d2e

Please sign in to comment.