From 4859d30fbe33d8caa31db39e0187b3a645b97b7d Mon Sep 17 00:00:00 2001 From: mate71pl <67105053+mate71pl@users.noreply.github.com> Date: Sun, 14 Jul 2024 23:01:24 +0200 Subject: [PATCH] Add plugins to conf_wrapper.py --- app/conf_wrapper.py | 23 ++++++++++++++++++++--- app/meshtastic-matrix-relay | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/app/conf_wrapper.py b/app/conf_wrapper.py index 0822639..317ae05 100644 --- a/app/conf_wrapper.py +++ b/app/conf_wrapper.py @@ -49,9 +49,25 @@ if nodes_plugin_active: plugins_config["nodes"] = {"active": nodes_plugin_active.lower() == "true"} -nodes_plugin_active = os.environ.get('CHUTILZ_PLUGIN_ACTIVE') -if nodes_plugin_active: - plugins_config["chutilz"] = {"active": chutilz_plugin_active.lower() == "true"} +chutilz_plugin_active = os.environ.get('CHUTILZ_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: @@ -60,3 +76,4 @@ # Write the configuration to config.yaml with open("config.yaml", "w") as f: yaml.dump(relay_config, f) + diff --git a/app/meshtastic-matrix-relay b/app/meshtastic-matrix-relay index 25bada2..46021e9 160000 --- a/app/meshtastic-matrix-relay +++ b/app/meshtastic-matrix-relay @@ -1 +1 @@ -Subproject commit 25bada2cb62cdc2e3ee77413577a4d68760c6513 +Subproject commit 46021e9eae5c6ae87bbb4cf99a00fee3610a49e9