From 104fe8db9c134595959bb8610d05b9b4a5eba434 Mon Sep 17 00:00:00 2001 From: Snuffy2 Date: Fri, 19 May 2023 21:42:44 -0400 Subject: [PATCH] Change to async_write_ha_state --- custom_components/variable/binary_sensor.py | 2 +- custom_components/variable/sensor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/variable/binary_sensor.py b/custom_components/variable/binary_sensor.py index b8744b1..1f28e98 100644 --- a/custom_components/variable/binary_sensor.py +++ b/custom_components/variable/binary_sensor.py @@ -279,4 +279,4 @@ async def async_update_variable( else: self._attr_is_on = value - await self.async_update_ha_state() + self.async_write_ha_state() diff --git a/custom_components/variable/sensor.py b/custom_components/variable/sensor.py index ac3f98b..c45def6 100644 --- a/custom_components/variable/sensor.py +++ b/custom_components/variable/sensor.py @@ -283,6 +283,6 @@ async def async_update_variable( ) self._attr_native_value = value - await self.async_update_ha_state() + self.async_write_ha_state() _LOGGER.debug(f"({self._attr_name}) [async_update_variable] self: {self}") _LOGGER.debug(f"({self._attr_name}) [async_update_variable] name: {self.name}")