mirror of https://github.com/home-assistant/core
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
This commit is contained in:
parent
f2336a5a3a
commit
b1b8b8ba00
|
@ -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."""
|
||||
|
|
Loading…
Reference in New Issue