From 41371547fe66a8d5f108bc08e997a54bc1f6311c Mon Sep 17 00:00:00 2001 From: Philipp Grimm Date: Thu, 23 May 2024 13:14:09 +0200 Subject: [PATCH] added support for mgw lan --- custom_components/eltako/config_flow.py | 4 ++-- custom_components/eltako/const.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/custom_components/eltako/config_flow.py b/custom_components/eltako/config_flow.py index 1cfb5009..41e104b9 100644 --- a/custom_components/eltako/config_flow.py +++ b/custom_components/eltako/config_flow.py @@ -76,7 +76,7 @@ async def manual_selection_routine(self, user_input=None, manual_setp:bool=False if len(g_list) == 0: errors = {CONF_GATEWAY_DESCRIPTION: ERROR_NO_GATEWAY_CONFIGURATION_AVAILABLE} - # add serial paths from configuration + # add manually added serial paths and ip addresses from configuration for g_id in g_list_dict.keys(): g_c = config_helpers.find_gateway_config_by_id(config, g_id) if CONF_SERIAL_PATH in g_c: @@ -118,7 +118,7 @@ async def validate_eltako_conf(self, user_input) -> bool: gateway_selection: str = user_input[CONF_GATEWAY_DESCRIPTION] for gdc in gateway.GatewayDeviceType: - if gdc in gateway_selection and gdc in gateway.BAUD_RATE_DEVICE_TYPE_MAPPING: + if gdc in gateway_selection: baud_rate = gateway.BAUD_RATE_DEVICE_TYPE_MAPPING[gdc] break diff --git a/custom_components/eltako/const.py b/custom_components/eltako/const.py index 4b99febb..9c887fc7 100644 --- a/custom_components/eltako/const.py +++ b/custom_components/eltako/const.py @@ -120,4 +120,5 @@ def is_lan_gateway(cls, dev_type) -> bool: GatewayDeviceType.EltakoFAMUSB: 9600, GatewayDeviceType.USB300: 57600, GatewayDeviceType.ESP3: 57600, + GatewayDeviceType.LAN: -1, } \ No newline at end of file