From b8f03aa3becc189ebf4631a5c1198a2dc5bc055b Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Wed, 27 Nov 2019 05:15:59 -0500 Subject: [PATCH] move neato service to neato domain (#29148) --- homeassistant/components/neato/const.py | 2 ++ homeassistant/components/neato/services.yaml | 18 ++++++++++++++++++ homeassistant/components/neato/vacuum.py | 6 ++---- homeassistant/components/vacuum/services.yaml | 19 ------------------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/homeassistant/components/neato/const.py b/homeassistant/components/neato/const.py index 6dbaeb10d36..cfe8a2dad9d 100644 --- a/homeassistant/components/neato/const.py +++ b/homeassistant/components/neato/const.py @@ -11,6 +11,8 @@ NEATO_ROBOTS = "neato_robots" SCAN_INTERVAL_MINUTES = 5 +SERVICE_NEATO_CUSTOM_CLEANING = "custom_cleaning" + VALID_VENDORS = ["neato", "vorwerk"] MODE = {1: "Eco", 2: "Turbo"} diff --git a/homeassistant/components/neato/services.yaml b/homeassistant/components/neato/services.yaml index e69de29bb2d..b40edabd779 100644 --- a/homeassistant/components/neato/services.yaml +++ b/homeassistant/components/neato/services.yaml @@ -0,0 +1,18 @@ +custom_cleaning: + description: Zone Cleaning service call specific to Neato Botvacs. + fields: + entity_id: + description: Name of the vacuum entity. [Required] + example: 'vacuum.neato' + mode: + description: "Set the cleaning mode: 1 for eco and 2 for turbo. Defaults to turbo if not set." + example: 2 + navigation: + description: "Set the navigation mode: 1 for normal, 2 for extra care, 3 for deep. Defaults to normal if not set." + example: 1 + category: + description: "Whether to use a persistent map or not for cleaning (i.e. No go lines): 2 for no map, 4 for map. Default to using map if not set (and fallback to no map if no map is found)." + example: 2 + zone: + description: Only supported on the Botvac D7. Name of the zone to clean. Defaults to no zone i.e. complete house cleanup. + example: "Kitchen" \ No newline at end of file diff --git a/homeassistant/components/neato/vacuum.py b/homeassistant/components/neato/vacuum.py index 40ed79042c7..ec8ff22d83e 100644 --- a/homeassistant/components/neato/vacuum.py +++ b/homeassistant/components/neato/vacuum.py @@ -7,7 +7,6 @@ import voluptuous as vol from homeassistant.components.vacuum import ( ATTR_STATUS, - DOMAIN, STATE_CLEANING, STATE_DOCKED, STATE_ERROR, @@ -40,6 +39,7 @@ from .const import ( NEATO_PERSISTENT_MAPS, NEATO_ROBOTS, SCAN_INTERVAL_MINUTES, + SERVICE_NEATO_CUSTOM_CLEANING, ) _LOGGER = logging.getLogger(__name__) @@ -73,8 +73,6 @@ ATTR_NAVIGATION = "navigation" ATTR_CATEGORY = "category" ATTR_ZONE = "zone" -SERVICE_NEATO_CUSTOM_CLEANING = "neato_custom_cleaning" - SERVICE_NEATO_CUSTOM_CLEANING_SCHEMA = vol.Schema( { vol.Required(ATTR_ENTITY_ID): cv.entity_ids, @@ -126,7 +124,7 @@ async def async_setup_entry(hass, entry, async_add_entities): return entities hass.services.async_register( - DOMAIN, + NEATO_DOMAIN, SERVICE_NEATO_CUSTOM_CLEANING, neato_custom_cleaning_service, schema=SERVICE_NEATO_CUSTOM_CLEANING_SCHEMA, diff --git a/homeassistant/components/vacuum/services.yaml b/homeassistant/components/vacuum/services.yaml index fe5bb77cefe..792658bbdfd 100644 --- a/homeassistant/components/vacuum/services.yaml +++ b/homeassistant/components/vacuum/services.yaml @@ -144,22 +144,3 @@ xiaomi_clean_zone: repeats: description: Number of cleaning repeats for each zone between 1 and 3. example: '1' - -neato_custom_cleaning: - description: Zone Cleaning service call specific to Neato Botvacs. - fields: - entity_id: - description: Name of the vacuum entity. [Required] - example: 'vacuum.neato' - mode: - description: "Set the cleaning mode: 1 for eco and 2 for turbo. Defaults to turbo if not set." - example: 2 - navigation: - description: "Set the navigation mode: 1 for normal, 2 for extra care, 3 for deep. Defaults to normal if not set." - example: 1 - category: - description: "Whether to use a persistent map or not for cleaning (i.e. No go lines): 2 for no map, 4 for map. Default to using map if not set (and fallback to no map if no map is found)." - example: 2 - zone: - description: Only supported on the Botvac D7. Name of the zone to clean. Defaults to no zone i.e. complete house cleanup. - example: "Kitchen"