From 9df0239066453507acf1f3e5a032388d6bfd5301 Mon Sep 17 00:00:00 2001 From: Erlend Fosseide Sellie Date: Wed, 1 May 2024 21:10:39 +0200 Subject: [PATCH] Change async_write_ha_state to schedule_update_ha_state to fix #37 Change async_write_ha_state to schedule_update_ha_state to fix #37 --- custom_components/priceanalyzer/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/priceanalyzer/sensor.py b/custom_components/priceanalyzer/sensor.py index 3eb248b..76a5d22 100644 --- a/custom_components/priceanalyzer/sensor.py +++ b/custom_components/priceanalyzer/sensor.py @@ -253,7 +253,7 @@ def _update(self, data) -> None: self._data.update(data) def update_sensor(self): - self.async_write_ha_state() + self.schedule_update_ha_state() async def async_added_to_hass(self): """Connect to dispatcher listening for entity data notifications.""" @@ -346,7 +346,7 @@ def _update(self, data) -> None: self._data.update(data) def update_sensor(self): - self.async_write_ha_state() + self.schedule_update_ha_state() async def async_added_to_hass(self): """Connect to dispatcher listening for entity data notifications.""" @@ -418,7 +418,7 @@ def _update(self, data) -> None: self._data.update(data) def update_sensor(self): - self.async_write_ha_state() + self.schedule_update_ha_state() async def async_added_to_hass(self): """Connect to dispatcher listening for entity data notifications."""