Skip to content

Commit

Permalink
Version 0.0.4
Browse files Browse the repository at this point in the history
- Fix available
- Set sensor values during initialisation
  • Loading branch information
Øyvind Matheson Wergeland authored and Øyvind Matheson Wergeland committed May 12, 2024
1 parent cc88681 commit 0f63d3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/connectlife/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"requirements": ["connectlife==0.0.3"],
"ssdp": [],
"zeroconf": [],
"version": "0.0.3"
"version": "0.0.4"
}
3 changes: 2 additions & 1 deletion custom_components/connectlife/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ def __init__(self, coordinator: ConnectLifeCoordinator, appliance: ConnectLifeAp
description = status.replace("_", " ")
self._attr_name = f"{appliance._device_nickname} {description}"
self._attr_unique_id = f"{appliance.device_id}-{status}"
self._handle_coordinator_update()

@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._attr_native_value = self.coordinator.appliances[self.device_id].status_list[self.status]
self._attr_available = self.coordinator.appliances[self.device_id].offline_state == 1
self._attr_available = self.coordinator.appliances[self.device_id]._offline_state == 1

0 comments on commit 0f63d3f

Please sign in to comment.