Skip to content

Commit

Permalink
Merge pull request #142 from litinoveweedle/fix_state_handling
Browse files Browse the repository at this point in the history
fix CodeQL warning
  • Loading branch information
litinoveweedle committed Sep 27, 2024
2 parents 9d5e3f8 + e833f1d commit 1fd607b
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 1fd607b

Please sign in to comment.