Add plugins to conf_wrapper.py

feature/plugins-parameters
mate71pl 2024-07-14 21:32:25 +02:00
rodzic b15dc3b445
commit 6a30c3968f
1 zmienionych plików z 17 dodań i 1 usunięć

Wyświetl plik

@ -50,9 +50,25 @@ if nodes_plugin_active:
plugins_config["nodes"] = {"active": nodes_plugin_active.lower() == "true"}
chutilz_plugin_active = os.environ.get('CHUTILZ_PLUGIN_ACTIVE')
if nodes_plugin_active:
if chutilz_plugin_active:
plugins_config["chutilz"] = {"active": chutilz_plugin_active.lower() == "true"}
airutilz_plugin_active = os.environ.get('AIRUTILZ_PLUGIN_ACTIVE')
if airutilz_plugin_active:
plugins_config["airutilz"] = {"active": airutilz_plugin_active.lower() == "true"}
battery_plugin_active = os.environ.get('BATTERY_PLUGIN_ACTIVE')
if battery_plugin_active:
plugins_config["battery"] = {"active": battery_plugin_active.lower() == "true"}
voltage_plugin_active = os.environ.get('VOLTAGE_PLUGIN_ACTIVE')
if voltage_plugin_active:
plugins_config["voltage"] = {"active": voltage_plugin_active.lower() == "true"}
snr_plugin_active = os.environ.get('SNR_PLUGIN_ACTIVE')
if snr_plugin_active:
plugins_config["snr"] = {"active": snr_plugin_active.lower() == "true"}
# Add the plugins dictionary to the relay_config if it's not empty
if plugins_config:
relay_config["plugins"] = plugins_config