mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-14 13:20:42 +08:00
Merge a022b36356 into 7c97b85f02
This commit is contained in:
commit
1194a96a99
@ -170,6 +170,11 @@ SPEC_DEVICE_TRANS_MAP: dict = {
|
||||
'properties': {
|
||||
'battery-level': {'read'}
|
||||
}
|
||||
},
|
||||
'optional': {
|
||||
'actions': {
|
||||
'start-charge'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@ -202,6 +202,14 @@ class Vacuum(MIoTServiceEntity, StateVacuumEntity):
|
||||
elif action.name == 'identify':
|
||||
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."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user