From 9dc9d49c67478afcead1c6ee1db5bdc287d757d7 Mon Sep 17 00:00:00 2001 From: Dave Foster Date: Fri, 11 Oct 2024 13:35:56 +0100 Subject: [PATCH] Update battery_controller.py deprecation async_track_change To fix deprecation warning, replaces async_track_change with async_track_change_event --- custom_components/foxess_em/battery/battery_controller.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/foxess_em/battery/battery_controller.py b/custom_components/foxess_em/battery/battery_controller.py index 342bd52..749e3c5 100755 --- a/custom_components/foxess_em/battery/battery_controller.py +++ b/custom_components/foxess_em/battery/battery_controller.py @@ -4,7 +4,7 @@ import logging from homeassistant.core import HomeAssistant -from homeassistant.helpers.event import async_track_state_change +from homeassistant.helpers.event import async_track_state_change_event from custom_components.foxess_em.battery.battery_util import BatteryUtils from custom_components.foxess_em.battery.schedule import Schedule @@ -65,7 +65,7 @@ def __init__( HassLoadController.__init__(self, hass, self.async_refresh) # Refresh on SoC change - battery_refresh = async_track_state_change( + battery_refresh = async_track_state_change_event( self._hass, battery_soc, self.refresh ) self._unload_listeners.append(battery_refresh)