From 4af6e505b3dd3adf048da6d522f09a5498207c92 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Tue, 4 May 2021 22:18:22 +0200 Subject: [PATCH] Deprecate speedtest.net YAML config (#50072) --- .../components/speedtestdotnet/__init__.py | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/homeassistant/components/speedtestdotnet/__init__.py b/homeassistant/components/speedtestdotnet/__init__.py index 9c76b351f33..b8f80de1b52 100644 --- a/homeassistant/components/speedtestdotnet/__init__.py +++ b/homeassistant/components/speedtestdotnet/__init__.py @@ -29,20 +29,25 @@ from .const import ( _LOGGER = logging.getLogger(__name__) CONFIG_SCHEMA = vol.Schema( - { - DOMAIN: vol.Schema( - { - vol.Optional(CONF_SERVER_ID): cv.positive_int, - vol.Optional( - CONF_SCAN_INTERVAL, default=timedelta(minutes=DEFAULT_SCAN_INTERVAL) - ): cv.positive_time_period, - vol.Optional(CONF_MANUAL, default=False): cv.boolean, - vol.Optional( - CONF_MONITORED_CONDITIONS, default=list(SENSOR_TYPES) - ): vol.All(cv.ensure_list, [vol.In(list(SENSOR_TYPES))]), - } - ) - }, + vol.All( + # Deprecated in Home Assistant 2021.6 + cv.deprecated(DOMAIN), + { + DOMAIN: vol.Schema( + { + vol.Optional(CONF_SERVER_ID): cv.positive_int, + vol.Optional( + CONF_SCAN_INTERVAL, + default=timedelta(minutes=DEFAULT_SCAN_INTERVAL), + ): cv.positive_time_period, + vol.Optional(CONF_MANUAL, default=False): cv.boolean, + vol.Optional( + CONF_MONITORED_CONDITIONS, default=list(SENSOR_TYPES) + ): vol.All(cv.ensure_list, [vol.In(list(SENSOR_TYPES))]), + } + ) + }, + ), extra=vol.ALLOW_EXTRA, )