From 9bcdc2b84739e6444e54d8f12ea8c5bc1be11d40 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 11 Jan 2022 08:22:23 +0100 Subject: [PATCH] Deprecate iCloud YAML configuration (#63875) Co-authored-by: epenet --- homeassistant/components/icloud/__init__.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/homeassistant/components/icloud/__init__.py b/homeassistant/components/icloud/__init__.py index af263e3b1ea..8b6c8355e40 100644 --- a/homeassistant/components/icloud/__init__.py +++ b/homeassistant/components/icloud/__init__.py @@ -1,4 +1,6 @@ """The iCloud component.""" +import logging + import voluptuous as vol from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry @@ -84,12 +86,22 @@ CONFIG_SCHEMA = vol.Schema( extra=vol.ALLOW_EXTRA, ) +_LOGGER = logging.getLogger(__name__) + async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up iCloud from legacy config file.""" if (conf := config.get(DOMAIN)) is None: return True + # Note: need to remember to cleanup device_tracker (remove async_setup_scanner) + _LOGGER.warning( + "Configuration of the iCloud integration in YAML is deprecated and " + "will be removed in Home Assistant 2022.4; Your existing configuration " + "has been imported into the UI automatically and can be safely removed " + "from your configuration.yaml file" + ) + for account_conf in conf: hass.async_create_task( hass.config_entries.flow.async_init(