From 3bcce2197c75375f9ab51efa60401161b862c049 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 28 Apr 2024 11:36:01 -0500 Subject: [PATCH] Fix incorrect call to async_schedule_update_ha_state in command_line switch (#116347) --- homeassistant/components/command_line/switch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/command_line/switch.py b/homeassistant/components/command_line/switch.py index fee94424fa1..8a75276c8b4 100644 --- a/homeassistant/components/command_line/switch.py +++ b/homeassistant/components/command_line/switch.py @@ -191,12 +191,12 @@ class CommandSwitch(ManualTriggerEntity, SwitchEntity): """Turn the device on.""" if await self._switch(self._command_on) and not self._command_state: self._attr_is_on = True - self.async_schedule_update_ha_state() + self.async_write_ha_state() await self._update_entity_state() async def async_turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" if await self._switch(self._command_off) and not self._command_state: self._attr_is_on = False - self.async_schedule_update_ha_state() + self.async_write_ha_state() await self._update_entity_state()