get_available_variables_at_time usable without config file

This commit is contained in:
l_samenv
2024-08-30 10:17:08 +02:00
parent 94424bd422
commit 07f4e69a94
3 changed files with 18 additions and 15 deletions

View File

@ -4,6 +4,7 @@ import logging
from colors import assign_colors_to_curves
import json
import io
from chart_config import ChartConfig
class InfluxGraph:
"""
@ -29,6 +30,7 @@ class InfluxGraph:
def __init__(self, influx_data_getter):
self.influx_data_getter = influx_data_getter
self.chart_config = ChartConfig("./variables_config.ini")
self.livemode = self.HISTORICAL
self.end_query = 0
self.lastvalues = {}
@ -129,7 +131,7 @@ class InfluxGraph:
start_time = int(self.get_abs_time(time)[0])
end_time = int(self.get_abs_time(time)[-1])
blocks = self.influx_data_getter.get_available_variables_at_time([start_time, end_time])
blocks = self.influx_data_getter.get_available_variables_at_time([start_time, end_time], self.chart_config)
device_name = self.influx_data_getter.get_device_name(end_time)
# updates the self.variables attribute to keep track of the available variables
self.variables = {variable["name"]:variable["label"] for block in blocks for variable in block["curves"]}