mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
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:
parent
19259d5cad
commit
d8ed10bcc7
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user