From e94b7d732c1097a3052248c14a6f095cef7c1656 Mon Sep 17 00:00:00 2001 From: xZetsubou Date: Sat, 11 Jan 2025 07:31:17 +0300 Subject: [PATCH] fix(vacuum): updated deprecated constant --- custom_components/localtuya/vacuum.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index 330588c1d..4b9fffec8 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -7,14 +7,9 @@ import voluptuous as vol from homeassistant.components.vacuum import ( DOMAIN, - STATE_CLEANING, - STATE_DOCKED, - STATE_ERROR, - STATE_IDLE, - STATE_PAUSED, - STATE_RETURNING, - VacuumEntityFeature, StateVacuumEntity, + VacuumActivity, + VacuumEntityFeature, ) from .entity import LocalTuyaEntity, async_setup_entry @@ -232,17 +227,17 @@ def status_updated(self): if state_value == "None": self._state = None elif state_value in self._idle_status_list: - self._state = STATE_IDLE + self._state = VacuumActivity.IDLE elif state_value in self._docked_status_list: - self._state = STATE_DOCKED + self._state = VacuumActivity.DOCKED elif state_value in self._returning_status_list: - self._state = STATE_RETURNING + self._state = VacuumActivity.RETURNING elif state_value in [self._config[CONF_PAUSED_STATE], "pause"] or ( not state_value and self.dp_value(CONF_PAUSE_DP) is True ): - self._state = STATE_PAUSED + self._state = VacuumActivity.PAUSED else: - self._state = STATE_CLEANING + self._state = VacuumActivity.CLEANING if self.has_config(CONF_BATTERY_DP): self._battery_level = self.dp_value(CONF_BATTERY_DP)