From a14c299a78259386bbcf7787689e3e7dfa5b1dfd Mon Sep 17 00:00:00 2001 From: Anglac <32984070+Anglac@users.noreply.github.com> Date: Sun, 28 Jul 2019 13:37:25 -0500 Subject: [PATCH] Roombalocate (#25508) * Add Roomba Locate * Update vacuum.py --- homeassistant/components/roomba/vacuum.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/roomba/vacuum.py b/homeassistant/components/roomba/vacuum.py index e9f62d3bc17..85e1cff19fd 100644 --- a/homeassistant/components/roomba/vacuum.py +++ b/homeassistant/components/roomba/vacuum.py @@ -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: