From d4201eaa23aeb45f931a1c0881357953c8611fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hjelseth=20H=C3=B8yer?= Date: Fri, 1 Oct 2021 09:12:45 +0200 Subject: [PATCH] Opengarage bug fix (#56869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Opengarage bug fix Signed-off-by: Daniel Hjelseth Høyer * Opengarage bug fix Signed-off-by: Daniel Hjelseth Høyer * Deprecated open garage config Signed-off-by: Daniel Hjelseth Høyer * Deprecated open garage config Signed-off-by: Daniel Hjelseth Høyer --- homeassistant/components/opengarage/config_flow.py | 13 +++++++------ homeassistant/components/opengarage/cover.py | 9 +++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/opengarage/config_flow.py b/homeassistant/components/opengarage/config_flow.py index 9121391b4e0..6ddc186cb9c 100644 --- a/homeassistant/components/opengarage/config_flow.py +++ b/homeassistant/components/opengarage/config_flow.py @@ -60,13 +60,14 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): async def async_step_import(self, import_info): """Set the config entry up from yaml.""" - import_info[CONF_HOST] = ( - f"{'https' if import_info[CONF_SSL] else 'http'}://" - f"{import_info.get(CONF_HOST)}" - ) - del import_info[CONF_SSL] - return await self.async_step_user(import_info) + user_input = { + CONF_DEVICE_KEY: import_info[CONF_DEVICE_KEY], + CONF_HOST: f"{'https' if import_info.get(CONF_SSL, False) else 'http'}://{import_info[CONF_HOST]}", + CONF_PORT: import_info.get(CONF_PORT, DEFAULT_PORT), + CONF_VERIFY_SSL: import_info.get(CONF_VERIFY_SSL, False), + } + return await self.async_step_user(user_input) async def async_step_user( self, user_input: dict[str, Any] | None = None diff --git a/homeassistant/components/opengarage/cover.py b/homeassistant/components/opengarage/cover.py index bf23d3286ad..12a1103f7df 100644 --- a/homeassistant/components/opengarage/cover.py +++ b/homeassistant/components/opengarage/cover.py @@ -50,15 +50,16 @@ COVER_SCHEMA = vol.Schema( ) PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( - vol.All( - cv.deprecated(DOMAIN), - {vol.Required(CONF_COVERS): cv.schema_with_slug_keys(COVER_SCHEMA)}, - ), + {vol.Required(CONF_COVERS): cv.schema_with_slug_keys(COVER_SCHEMA)} ) async def async_setup_platform(hass, config, async_add_entities, discovery_info=None): """Set up the OpenGarage covers.""" + _LOGGER.warning( + "Open Garage YAML configuration is deprecated, " + "it has been imported into the UI automatically and can be safely removed" + ) devices = config.get(CONF_COVERS) for device_config in devices.values(): hass.async_create_task(