From a1a5de42f1033b7a0403ad4581ba6fe4b90f6e36 Mon Sep 17 00:00:00 2001 From: nedyarrd Date: Wed, 4 Oct 2023 21:52:23 +0200 Subject: [PATCH] No hardcoded yaml names Path adds auto scan of inverter_definitions directory to get all files in it --- custom_components/solarman/const.py | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/custom_components/solarman/const.py b/custom_components/solarman/const.py index 37eef05..7b28cfc 100644 --- a/custom_components/solarman/const.py +++ b/custom_components/solarman/const.py @@ -5,25 +5,8 @@ DEFAULT_PORT_INVERTER = 8899 DEFAULT_INVERTER_MB_SLAVEID = 1 DEFAULT_LOOKUP_FILE = 'deye_hybrid.yaml' -LOOKUP_FILES = [ - 'deye_2mppt.yaml', - 'deye_4mppt.yaml', - 'deye_hybrid.yaml', - 'deye_sg04lp3.yaml', - 'deye_string.yaml', - 'kstar_hybrid.yaml', - 'sofar_g3hyd.yaml', - 'sofar_hyd3k-6k-es.yaml', - 'sofar_lsw3.yaml', - 'sofar_wifikit.yaml', - 'solis_1p8k-5g.yaml', - 'solis_3p-4g.yaml', - 'solis_hybrid.yaml', - 'solis_s6-gr1p.yaml', - 'zcs_azzurro-ktl-v3.yaml', - 'Afore_BNTxxxKTL-2mppt.yaml', - 'custom_parameters.yaml' -] + +LOOKUP_FILES = (os.listdir(os.path.dirname(__file__) + '/inverter_definitions')) MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=15)