Skip to content

Commit

Permalink
fixed entity update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed May 10, 2023
1 parent 4b30177 commit b9fe492
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion custom_components/portainer/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,14 @@ def __init__(
self._uid = uid
self._data = coordinator.data[self.description.data_path]
if self._uid:
self._data = self._data[self._uid]
self._data = coordinator.data[self.description.data_path][self._uid]

@callback
def _handle_coordinator_update(self) -> None:
self._data = self.coordinator.data[self.description.data_path]
if self._uid:
self._data = self.coordinator.data[self.description.data_path][self._uid]
super()._handle_coordinator_update()

@property
def name(self) -> str:
Expand Down

0 comments on commit b9fe492

Please sign in to comment.