From 3029a95410d2e97ed052174962451d18c4d0a93c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 21 Jan 2021 14:07:47 -0600 Subject: [PATCH] Remove YAML support from rachio (#45383) --- homeassistant/components/rachio/__init__.py | 34 ++----------------- .../components/rachio/config_flow.py | 4 --- 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/homeassistant/components/rachio/__init__.py b/homeassistant/components/rachio/__init__.py index 2c2918da4c97..672ff272344c 100644 --- a/homeassistant/components/rachio/__init__.py +++ b/homeassistant/components/rachio/__init__.py @@ -5,21 +5,14 @@ import secrets from rachiopy import Rachio from requests.exceptions import ConnectTimeout -import voluptuous as vol -from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry +from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import config_validation as cv -from .const import ( - CONF_CLOUDHOOK_URL, - CONF_MANUAL_RUN_MINS, - CONF_WEBHOOK_ID, - DEFAULT_MANUAL_RUN_MINS, - DOMAIN, -) +from .const import CONF_CLOUDHOOK_URL, CONF_MANUAL_RUN_MINS, CONF_WEBHOOK_ID, DOMAIN from .device import RachioPerson from .webhooks import ( async_get_or_create_registered_webhook_id_and_url, @@ -30,35 +23,14 @@ _LOGGER = logging.getLogger(__name__) SUPPORTED_DOMAINS = ["switch", "binary_sensor"] -CONFIG_SCHEMA = vol.Schema( - { - DOMAIN: vol.Schema( - { - vol.Required(CONF_API_KEY): cv.string, - vol.Optional( - CONF_MANUAL_RUN_MINS, default=DEFAULT_MANUAL_RUN_MINS - ): cv.positive_int, - } - ) - }, - extra=vol.ALLOW_EXTRA, -) +CONFIG_SCHEMA = cv.deprecated(DOMAIN) async def async_setup(hass: HomeAssistant, config: dict): """Set up the rachio component from YAML.""" - conf = config.get(DOMAIN) hass.data.setdefault(DOMAIN, {}) - if not conf: - return True - - hass.async_create_task( - hass.config_entries.flow.async_init( - DOMAIN, context={"source": SOURCE_IMPORT}, data=conf - ) - ) return True diff --git a/homeassistant/components/rachio/config_flow.py b/homeassistant/components/rachio/config_flow.py index 96420d56ba71..63e5bd56954a 100644 --- a/homeassistant/components/rachio/config_flow.py +++ b/homeassistant/components/rachio/config_flow.py @@ -94,10 +94,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): await self.async_set_unique_id(properties["id"]) return await self.async_step_user() - async def async_step_import(self, user_input): - """Handle import.""" - return await self.async_step_user(user_input) - @staticmethod @callback def async_get_options_flow(config_entry):