From b8fd49a59975a9b55087f11ea2c6fed379b9a3b4 Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Tue, 14 May 2024 13:30:24 +0200 Subject: [PATCH] no config support --- custom_components/eltako/eltako_integration_init.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/custom_components/eltako/eltako_integration_init.py b/custom_components/eltako/eltako_integration_init.py index 2f7de392..a7d53553 100644 --- a/custom_components/eltako/eltako_integration_init.py +++ b/custom_components/eltako/eltako_integration_init.py @@ -99,20 +99,24 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b # Initialise the gateway # get base_id from user input if CONF_GATEWAY_DESCRIPTION not in config_entry.data.keys(): - raise Exception("[{LOG_PREFIX}] Ooops, device information for gateway is not available. Try to delete and recreate the gateway.") + LOGGER.warn("[{LOG_PREFIX}] Ooops, device information for gateway is not available. Try to delete and recreate the gateway.") + return gateway_description = config_entry.data[CONF_GATEWAY_DESCRIPTION] # from user input if not ('(' in gateway_description and ')' in gateway_description): - raise Exception("[{LOG_PREFIX}] Ooops, no base id of gateway available. Try to delete and recreate the gateway.") + LOGGER.warn("[{LOG_PREFIX}] Ooops, no base id of gateway available. Try to delete and recreate the gateway.") + return gateway_id = config_helpers.get_id_from_name(gateway_description) # get home assistant configuration section matching base_id gateway_config = await config_helpers.async_find_gateway_config_by_id(gateway_id, hass, CONFIG_SCHEMA) if not gateway_config: - raise Exception(f"[{LOG_PREFIX}] Ooops, no gateway configuration found in '/homeassistant/configuration.yaml'.") + LOGGER.warn(f"[{LOG_PREFIX}] Ooops, no gateway configuration found in '/homeassistant/configuration.yaml'.") + return # get serial path info if CONF_SERIAL_PATH not in config_entry.data.keys(): - raise Exception("[{LOG_PREFIX}] Ooops, no information about serial path available for gateway.") + LOGGER.warn("[{LOG_PREFIX}] Ooops, no information about serial path available for gateway.") + return gateway_serial_path = config_entry.data[CONF_SERIAL_PATH] # only transceiver can send teach-in telegrams