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
This commit is contained in:
Matthias Alphart 2024-08-16 13:43:02 +02:00 committed by GitHub
parent 799e95c1bd
commit ea52acd7bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -147,18 +147,10 @@ CONFIG_SCHEMA = vol.Schema(
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Start the KNX integration.""" """Start the KNX integration."""
hass.data[DATA_HASS_CONFIG] = config hass.data[DATA_HASS_CONFIG] = config
conf: ConfigType | None = config.get(DOMAIN) if (conf := config.get(DOMAIN)) is not None:
hass.data[DATA_KNX_CONFIG] = dict(conf)
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
register_knx_services(hass) register_knx_services(hass)
return True return True