Skip to content

Commit

Permalink
no config support
Browse files Browse the repository at this point in the history
  • Loading branch information
grimmpp committed May 14, 2024
1 parent 2e3db54 commit b8fd49a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/eltako/eltako_integration_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8fd49a

Please sign in to comment.