From 393544b3e7a00c498c0e70d88a6cf91aa5547ccc Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 18 Oct 2023 22:41:39 -1000 Subject: [PATCH] Make group _update_at_start a callback (#102286) --- homeassistant/components/group/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/group/__init__.py b/homeassistant/components/group/__init__.py index 364ef15fa5e36..82c2651e76429 100644 --- a/homeassistant/components/group/__init__.py +++ b/homeassistant/components/group/__init__.py @@ -526,12 +526,13 @@ def async_state_changed_listener( self.hass, self._entity_ids, async_state_changed_listener ) ) + self.async_on_remove(start.async_at_start(self.hass, self._update_at_start)) - async def _update_at_start(_: HomeAssistant) -> None: - self.async_update_group_state() - self.async_write_ha_state() - - self.async_on_remove(start.async_at_start(self.hass, _update_at_start)) + @callback + def _update_at_start(self, _: HomeAssistant) -> None: + """Update the group state at start.""" + self.async_update_group_state() + self.async_write_ha_state() @callback def async_defer_or_update_ha_state(self) -> None: