Skip to content

Commit

Permalink
- fix inverted value (for switch)
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jan 2, 2024
1 parent 413da1a commit 8998add
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions custom_components/senec/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def is_on(self) -> bool | None:
self.entity_description.array_pos] == 1
else:
value = getattr(self.coordinator.senec, self.entity_description.key)

if value is not None and self.entity_description.inverted:
value != value

if value is None or value == "":
value = None
else:
Expand Down

0 comments on commit 8998add

Please sign in to comment.