From b1b8b8ba00c5e2a55e1b65fd1c434cb2d89659ed Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 24 Apr 2024 03:32:07 +0200 Subject: [PATCH] Fix non-thread-safe operations in wake_on_lan (#116069) Fix unsafe thread operations in wake_on_lan https://github.com/home-assistant/core/actions/runs/8808429751/job/24177715837?pr=116066 --- homeassistant/components/wake_on_lan/switch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/wake_on_lan/switch.py b/homeassistant/components/wake_on_lan/switch.py index a0b54fd8db0..e5c3a055310 100644 --- a/homeassistant/components/wake_on_lan/switch.py +++ b/homeassistant/components/wake_on_lan/switch.py @@ -129,7 +129,7 @@ class WolSwitch(SwitchEntity): if self._attr_assumed_state: self._state = True - self.async_write_ha_state() + self.schedule_update_ha_state() def turn_off(self, **kwargs: Any) -> None: """Turn the device off if an off action is present.""" @@ -138,7 +138,7 @@ class WolSwitch(SwitchEntity): if self._attr_assumed_state: self._state = False - self.async_write_ha_state() + self.schedule_update_ha_state() def update(self) -> None: """Check if device is on and update the state. Only called if assumed state is false."""