+ and - symbols for config files

This commit is contained in:
l_samenv
2024-09-03 11:08:07 +02:00
parent a73fe1653e
commit c0e25f6467
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
[chart]
T_stat=K_3
T_stat.raw=unit
T_nvd.raw=unit
T_stat.raw=+
T_nvd.raw=+

View File

@ -351,13 +351,13 @@ class InfluxDataGetter:
variable = {
"name":name,
"label":content[1]["secop_module"],
"params":{"value":{"cat":"unit", "color":"", "unit":value_unit}} # main value, shown by default
"params":{"value":{"cat":"+", "color":"", "unit":value_unit}} # main value, shown by default
}
for param_name, param_content in content[1]["params_cfg"].items():
param_unit = "1" if (not "unit" in param_content.keys() or param_content["unit"] == "") else param_content["unit"]
variable["params"][param_name] = {
"cat":"unit" if param_name == "target" else "None", # target is also shown by default, not the other parameters
"cat":"+" if param_name == "target" else "-", # target is also shown by default, not the other parameters
"color":"",
"unit":param_unit
}
@ -417,7 +417,7 @@ class InfluxDataGetter:
for variable in available_variables:
params = list(variable["params"].keys())
for param_key in params:
if variable["params"][param_key]["cat"] == "None":
if variable["params"][param_key]["cat"] == "-":
del variable["params"][param_key]
return available_variables
@ -472,7 +472,7 @@ class InfluxDataGetter:
for available_variable in available_variables:
key = available_variable["unit"]
if available_variable["cat"] != "unit":
if available_variable["cat"] != "+":
key = available_variable["cat"]
if key not in groups.keys():
groups[key] = {"tag":key, "unit":available_variable["unit"], "curves":[]}