Skip to content

Commit

Permalink
Fixed reference issue regarding coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelprete committed Jul 6, 2024
1 parent b4ebbb5 commit c35bae1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions custom_components/sinapsi_alfa/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(self, coordinator, name, key, icon, device_class, state_class, unit
@callback
def _handle_coordinator_update(self) -> None:
"""Fetch new state data for the sensor."""
self._state = self.coordinator.api.data[self._key]
self._state = self._coordinator.api.data[self._key]
self.async_write_ha_state()
# write debug log only on first sensor to avoid spamming the log
if self.name == "Manufacturer":
Expand Down Expand Up @@ -126,8 +126,8 @@ def entity_category(self):
@property
def native_value(self):
"""Return the state of the sensor."""
if self._key in self.coordinator.api.data:
return self.coordinator.api.data[self._key]
if self._key in self._coordinator.api.data:
return self._coordinator.api.data[self._key]
else:
return None

Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Alfa by Sinapsi",
"homeassistant": "2024.3.0",
"homeassistant": "2024.6.0",
"content_in_root": false,
"render_readme": true,
"zip_release": true,
Expand Down

0 comments on commit c35bae1

Please sign in to comment.