Skip to content

Commit

Permalink
fix CodeQL warning
Browse files Browse the repository at this point in the history
unified lights properties
  • Loading branch information
litinoveweedle committed Sep 27, 2024
1 parent fa27343 commit e833f1d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion custom_components/smartir/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ def name(self):
"""Return the display name of the light."""
return self._name

@property
def state(self):
"""Return the current state."""
return self._state

@property
def color_mode(self):
# We only support a single color mode currently, so no need to track it
Expand All @@ -178,15 +183,22 @@ def color_temp_kelvin(self):
def min_color_temp_kelvin(self):
if self._colortemps:
return self._colortemps[0]
else:
return None

@property
def max_color_temp_kelvin(self):
if self._colortemps:
return self._colortemps[-1]
else:
return None

@property
def is_on(self):
return self._state == STATE_ON or self._on_by_remote
if self._state == STATE_ON:
return True
else:
return False

@property
def brightness(self):
Expand Down

0 comments on commit e833f1d

Please sign in to comment.