fix: add RETURN_HOME functionality for new vacuum cleaner model (#1344)
Some checks failed
Tests / check-rule-format (push) Failing after 4s
Validate / validate-hassfest (push) Failing after 3s
Validate / validate-hacs (push) Failing after 9s
Validate / validate-lint (push) Failing after 2s
Validate / validate-setup (push) Failing after 4s

This commit is contained in:
Brandon Chen
2025-08-19 10:15:01 +08:00
committed by GitHub
parent 7c97b85f02
commit 58c671483e
2 changed files with 15 additions and 0 deletions

View File

@ -203,6 +203,16 @@ class Vacuum(MIoTServiceEntity, StateVacuumEntity):
self._attr_supported_features |= VacuumEntityFeature.LOCATE
self._action_identify = action
# Use start-charge from battery service as fallback
# if stop-and-gocharge is not available
if self._action_stop_and_gocharge is None:
for action in entity_data.actions:
if action.name == 'start-charge':
self._attr_supported_features |= (
VacuumEntityFeature.RETURN_HOME)
self._action_stop_and_gocharge = action
break
async def async_start(self) -> None:
"""Start or resume the cleaning task."""
if self._prop_status is not None: