Skip to content

Commit

Permalink
Fix deprecated warnings if supported color modes is 1. rospogrigio#168
Browse files Browse the repository at this point in the history
  • Loading branch information
xZetsubou committed Mar 16, 2024
1 parent 4d09fed commit aafabc3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions custom_components/localtuya/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ def is_music_mode(self):
@property
def color_mode(self) -> ColorMode:
"""Return the color_mode of the light."""
if len(self.supported_color_modes) == 1:
return next(iter(self.supported_color_modes))

if self.is_color_mode:
return ColorMode.HS
if self.is_white_mode:
Expand Down

0 comments on commit aafabc3

Please sign in to comment.