Roombalocate (#25508)

* Add Roomba Locate

* Update vacuum.py
pull/25498/head
Anglac 2019-07-28 13:37:25 -05:00 committed by Fabian Affolter
parent 4936e55979
commit a14c299a78
1 changed files with 6 additions and 2 deletions

View File

@ -8,7 +8,7 @@ import voluptuous as vol
from homeassistant.components.vacuum import (
PLATFORM_SCHEMA, SUPPORT_BATTERY, SUPPORT_FAN_SPEED, SUPPORT_PAUSE,
SUPPORT_RETURN_HOME, SUPPORT_SEND_COMMAND, SUPPORT_STATUS, SUPPORT_STOP,
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, VacuumDevice)
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_LOCATE, VacuumDevice)
from homeassistant.const import (
CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_USERNAME)
from homeassistant.exceptions import PlatformNotReady
@ -54,7 +54,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
# Commonly supported features
SUPPORT_ROOMBA = SUPPORT_BATTERY | SUPPORT_PAUSE | SUPPORT_RETURN_HOME | \
SUPPORT_SEND_COMMAND | SUPPORT_STATUS | SUPPORT_STOP | \
SUPPORT_TURN_OFF | SUPPORT_TURN_ON
SUPPORT_TURN_OFF | SUPPORT_TURN_ON | SUPPORT_LOCATE
# Only Roombas with CarpetBost can set their fanspeed
SUPPORT_ROOMBA_CARPET_BOOST = SUPPORT_ROOMBA | SUPPORT_FAN_SPEED
@ -194,6 +194,10 @@ class RoombaVacuum(VacuumDevice):
await self.hass.async_add_job(self.vacuum.send_command, 'dock')
self._is_on = False
async def async_locate(self, **kwargs):
"""Located vacuum."""
await self.hass.async_add_job(self.vacuum.send_command, 'find')
async def async_set_fan_speed(self, fan_speed, **kwargs):
"""Set fan speed."""
if fan_speed.capitalize() in FAN_SPEEDS: