Use _handle_coordinator_update() instead of own callback in Feedreader event entity (#145520)

use _handle_coordinator_update() instead of own callback
This commit is contained in:
Michael 2025-05-23 21:10:26 +02:00 committed by GitHub
parent 19259d5cad
commit d8ed10bcc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -61,15 +61,9 @@ class FeedReaderEvent(CoordinatorEntity[FeedReaderCoordinator], EventEntity):
entry_type=DeviceEntryType.SERVICE,
)
async def async_added_to_hass(self) -> None:
"""Entity added to hass."""
await super().async_added_to_hass()
self.async_on_remove(
self.coordinator.async_add_listener(self._async_handle_update)
)
@callback
def _async_handle_update(self) -> None:
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
if (data := self.coordinator.data) is None or not data:
return