Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vacuum): Updated deprecated constant #472

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions custom_components/localtuya/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Loading