From f564a0ca24a9a6f3aad3a9226a50d68cf10e63b7 Mon Sep 17 00:00:00 2001 From: Ziv <16467659+ziv1234@users.noreply.github.com> Date: Wed, 17 May 2023 14:05:36 +0300 Subject: [PATCH] Fix failure to register services in dynalite (#93069) * fixed bug that fails to register services when there is no YAML config * style improvement per thecode's suggestion --- homeassistant/components/dynalite/__init__.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/dynalite/__init__.py b/homeassistant/components/dynalite/__init__.py index c7f23af5fb1..77880fd74cb 100644 --- a/homeassistant/components/dynalite/__init__.py +++ b/homeassistant/components/dynalite/__init__.py @@ -43,19 +43,11 @@ CONFIG_SCHEMA = vol.Schema( async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Set up the Dynalite platform.""" - conf = config.get(DOMAIN) + conf = config.get(DOMAIN, {}) LOGGER.debug("Setting up dynalite component config = %s", conf) - - if conf is None: - conf = {} - hass.data[DOMAIN] = {} - # User has configured bridges - if CONF_BRIDGES not in conf: - return True - - bridges = conf[CONF_BRIDGES] + bridges = conf.get(CONF_BRIDGES, []) for bridge_conf in bridges: host = bridge_conf[CONF_HOST]