Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ufozone committed Jan 15, 2025
2 parents 34c086f + 3cd6d1e commit 637cf52
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
19 changes: 7 additions & 12 deletions custom_components/zcsmower/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
from homeassistant.config_entries import ConfigEntry
from homeassistant.components.vacuum import (
ATTR_STATUS,
STATE_CLEANING,
STATE_DOCKED,
STATE_PAUSED,
STATE_IDLE,
STATE_RETURNING,
STATE_ERROR,
VacuumActivity,
StateVacuumEntity,
StateVacuumEntityDescription,
VacuumEntityFeature,
Expand Down Expand Up @@ -104,16 +99,16 @@ def _update_extra_state_attributes(self) -> None:
def state(self) -> str:
"""Return the state of the lawn mower."""
if self._get_attribute(ATTR_STATE) in ("work", "gotoarea", "bordercut", "mapping_started"):
return STATE_CLEANING
return VacuumActivity.CLEANING
if self._get_attribute(ATTR_STATE) == "charge":
return STATE_DOCKED
return VacuumActivity.DOCKED
if self._get_attribute(ATTR_STATE) == "pause":
return STATE_PAUSED
return VacuumActivity.PAUSED
if self._get_attribute(ATTR_STATE) in ("gotostation", "mapping_ended"):
return STATE_RETURNING
return VacuumActivity.RETURNING
if self._get_attribute(ATTR_STATE) == "work_standby":
return STATE_IDLE
return STATE_ERROR
return VacuumActivity.IDLE
return VacuumActivity.ERROR

@property
def error(self) -> str | None:
Expand Down
6 changes: 3 additions & 3 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pip>=21.0,<24.4
colorlog==6.9.0
ruff==0.8.2
ruff==0.9.1
pydocstyle==6.3.0
isort==5.13.2
geopy==2.3.0
numpy==2.1.3
numpy==2.2.0
Pillow==11.0.0
pytest-homeassistant-custom-component==0.13.191
pytest-homeassistant-custom-component==0.13.203
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pip>=21.0,<24.4
colorlog==6.9.0
ruff==0.8.2
ruff==0.9.1
pydocstyle==6.3.0
isort==5.13.2
geopy==2.3.0
numpy==2.1.3
numpy==2.2.0
Pillow==11.0.0
homeassistant==2025.1.0

0 comments on commit 637cf52

Please sign in to comment.