Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CodeQL warning #142

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading