Skip to content

Commit

Permalink
Fixed the fix - color_mode should *not* be a set. Also, bool comparis…
Browse files Browse the repository at this point in the history
…ons with None is risky (e.g. a dimmable light with 0 brighness would suddenly stop being registered as dimmable), so fixed that as well.
  • Loading branch information
optiluca authored and gicamm committed Sep 15, 2024
1 parent 1ce7d60 commit 9fc26b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/comelit/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def is_on(self):

@property
def supported_color_modes(self):
return {ColorMode.BRIGHTNESS} if self._brightness else {ColorMode.ONOFF}
return {ColorMode.BRIGHTNESS} if self._brightness is not None else {ColorMode.ONOFF}

@property
def color_mode(self):
return {ColorMode.BRIGHTNESS} if self._brightness else {ColorMode.ONOFF}
return ColorMode.BRIGHTNESS if self._brightness is not None else ColorMode.ONOFF

@property
def brightness(self):
Expand Down

0 comments on commit 9fc26b1

Please sign in to comment.