Skip to content

Commit

Permalink
Fix operational status value key fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Apr 6, 2023
1 parent 37f846b commit c8161d0
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,15 @@ def device_class(self):
@property
def is_on(self):
"""Return the state of the sensor."""
operational_status_value = getattr(
self.coordinator.data.heat_pumps[self.idx], self._value_prop
)
active_operational_statuses = self.coordinator.data.heat_pumps[
self.idx
].operational_status
operational_status_name = self.coordinator.data.heat_pumps[
self.idx
].available_operational_statuses_map[self._value_prop]
].available_operational_statuses_map[operational_status_value]

if type(active_operational_statuses) is list:
return operational_status_name in active_operational_statuses
Expand Down

0 comments on commit c8161d0

Please sign in to comment.