diff --git a/dashboard-writer/utils.py b/dashboard-writer/utils.py index ed66972..fcf3034 100644 --- a/dashboard-writer/utils.py +++ b/dashboard-writer/utils.py @@ -67,6 +67,7 @@ def __init__(self, influx_url, token, org_id, influx_bucket, debug=False, verbos self.debug = debug self.verbose = verbose self.client = InfluxDBClient(url=self.influx_url, token=self.token, org=self.org_id, debug=False) + self.test = self.test_influx() return def __del__(self): @@ -82,7 +83,7 @@ def get_start_times(self, devices, default_start, dynamic): device_ids = [device.split("/")[1] for device in devices] start_times = [] - if self.test_influx() == 0: + if self.test == 0: for device in device_ids: start_times.append(default_start_dt) else: @@ -106,7 +107,7 @@ def write_influx(self, name, df): """ from influxdb_client import WriteOptions - if self.test_influx() == 0: + if self.test == 0: return _write_client = self.client.write_api(