From 7096701cab833ce8c95c4b068b5906349ae15fef Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 6 Mar 2024 08:10:26 -1000 Subject: [PATCH] Use an eager task for Sonos async_update_device_properties (#112488) If the device does not need to be polled for the battery state which is only present on portable speakers, the task will never suspend and never need to be scheduled on the event loop --- homeassistant/components/sonos/speaker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/sonos/speaker.py b/homeassistant/components/sonos/speaker.py index 3c9e4692fdc..d541da40e15 100644 --- a/homeassistant/components/sonos/speaker.py +++ b/homeassistant/components/sonos/speaker.py @@ -456,7 +456,9 @@ class SonosSpeaker: def async_dispatch_device_properties(self, event: SonosEvent) -> None: """Update device properties from an event.""" self.event_stats.process(event) - self.hass.async_create_task(self.async_update_device_properties(event)) + self.hass.async_create_task( + self.async_update_device_properties(event), eager_start=True + ) async def async_update_device_properties(self, event: SonosEvent) -> None: """Update device properties from an event."""