From 9552250f3662e6b4d88081ca324fc3d18d0c51b0 Mon Sep 17 00:00:00 2001 From: Aaron Bach Date: Sun, 7 Aug 2022 13:44:50 -0600 Subject: [PATCH] Fix bug where RainMachine entity states don't populate on startup (#76412) --- homeassistant/components/rainmachine/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index dccdaaba74c..f46b1aa0f4c 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -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."""