Skip to content

Commit

Permalink
fix(vaccum): use activity property instead of deprecated state
Browse files Browse the repository at this point in the history
* use activity instead of state
  • Loading branch information
xZetsubou authored Jan 11, 2025
1 parent 9ac19b4 commit d689d1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/localtuya/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def supported_features(self) -> VacuumEntityFeature:
return supported_features

@property
def state(self):
def activity(self) -> VacuumActivity | None:
"""Return the vacuum state."""
return self._state

Expand Down Expand Up @@ -222,9 +222,9 @@ async def async_send_command(self, command, params=None, **kwargs):

def status_updated(self):
"""Device status was updated."""
state_value = str(self.dp_value(self._dp_id))
state_value = self.dp_value(self._dp_id)

if state_value == "None":
if state_value is None:
self._state = None
elif state_value in self._idle_status_list:
self._state = VacuumActivity.IDLE
Expand Down

0 comments on commit d689d1a

Please sign in to comment.