mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 15:47:12 +00:00
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
This commit is contained in:
parent
770e48d512
commit
7096701cab
@ -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."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user