Fix bug where RainMachine entity states don't populate on startup (#76412)

pull/76405/head
Aaron Bach 2022-08-07 13:44:50 -06:00 committed by GitHub
parent e89459453b
commit 9552250f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -437,6 +437,11 @@ class RainMachineEntity(CoordinatorEntity):
self.update_from_latest_data()
self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
self.update_from_latest_data()
@callback
def update_from_latest_data(self) -> None:
"""Update the state."""