From ea52acd7bd3611e35a2dbe7c0d49fc1f6b4dc51e Mon Sep 17 00:00:00 2001 From: Matthias Alphart Date: Fri, 16 Aug 2024 13:43:02 +0200 Subject: [PATCH] Fix loading KNX integration actions when not using YAML (#124027) * Fix loading KNX integration services when not using YAML * remove unnecessary comment * Remove unreachable test --- homeassistant/components/knx/__init__.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/knx/__init__.py b/homeassistant/components/knx/__init__.py index fd46cad8489..a401ee2ccac 100644 --- a/homeassistant/components/knx/__init__.py +++ b/homeassistant/components/knx/__init__.py @@ -147,18 +147,10 @@ CONFIG_SCHEMA = vol.Schema( async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: """Start the KNX integration.""" hass.data[DATA_HASS_CONFIG] = config - conf: ConfigType | None = config.get(DOMAIN) - - if conf is None: - # If we have a config entry, setup is done by that config entry. - # If there is no config entry, this should fail. - return bool(hass.config_entries.async_entries(DOMAIN)) - - conf = dict(conf) - hass.data[DATA_KNX_CONFIG] = conf + if (conf := config.get(DOMAIN)) is not None: + hass.data[DATA_KNX_CONFIG] = dict(conf) register_knx_services(hass) - return True