File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
custom_components/robovac Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change 3030from homeassistant .components .vacuum import (
3131 StateVacuumEntity ,
3232 VacuumEntityFeature ,
33- STATE_CLEANING ,
34- STATE_DOCKED ,
35- STATE_ERROR ,
36- STATE_IDLE ,
37- STATE_RETURNING ,
33+ VacuumActivity ,
3834)
3935from homeassistant .config_entries import ConfigEntry
4036from homeassistant .core import HomeAssistant
@@ -208,15 +204,15 @@ def state(self) -> str | None:
208204 getErrorMessage (self .error_code )
209205 )
210206 )
211- return STATE_ERROR
207+ return VacuumActivity . ERROR
212208 elif self .tuya_state == "Charging" or self .tuya_state == "completed" :
213- return STATE_DOCKED
209+ return VacuumActivity . DOCKED
214210 elif self .tuya_state == "Recharge" :
215- return STATE_RETURNING
211+ return VacuumActivity . RETURNING
216212 elif self .tuya_state == "Sleeping" or self .tuya_state == "standby" :
217- return STATE_IDLE
213+ return VacuumActivity . IDLE
218214 else :
219- return STATE_CLEANING
215+ return VacuumActivity . CLEANING
220216
221217 @property
222218 def extra_state_attributes (self ) -> dict [str , Any ]:
You can’t perform that action at this time.
0 commit comments