diff --git a/modules/logs/endpoints.py b/modules/logs/endpoints.py index 32b3e48..4eb7e2b 100644 --- a/modules/logs/endpoints.py +++ b/modules/logs/endpoints.py @@ -56,7 +56,7 @@ class LogView(FlaskView): "name": "avg", "align_sampling": True, "sampling": { - "value": "5", + "value": cbpi.cache["config"]["kairos_db_sampling_value"].__dict__["value"], "unit": "seconds" }, "align_start_time": True @@ -66,7 +66,7 @@ class LogView(FlaskView): ], cache_time=0, start_relative={ - "value": "1", + "value": cbpi.cache["config"]["kairos_db_start_relative"].__dict__["value"], "unit": "days" }) diff --git a/update/4_kairosdb_config.sql b/update/4_kairosdb_config.sql index 32fd59e..ce824a1 100644 --- a/update/4_kairosdb_config.sql +++ b/update/4_kairosdb_config.sql @@ -1,2 +1,4 @@ INSERT OR IGNORE INTO config VALUES ('kairos_db', 'NO', 'select', 'Use timeseries database KairosDB for storing sensor values. You can install KairosDB with the CraftBeerPi installer.', '["YES","NO"]' ); -INSERT OR IGNORE INTO config VALUES ('kairos_db_port', 8080, 'number', 'Port for KairosDB. We assume the DB is running on your PI, so IP-Address is 127.0.0.1.', NULL ); \ No newline at end of file +INSERT OR IGNORE INTO config VALUES ('kairos_db_port', 8080, 'number', 'Port for KairosDB. We assume the DB is running on your PI, so IP-Address is 127.0.0.1.', NULL ); +INSERT OR IGNORE INTO config VALUES ('kairos_db_sampling_value', 5, 'number', 'A timeseries database has the advantage to aggregate data points and therefore to reduce the transmitted data. This value sets a time span in seconds to calculate the average', NULL ); +INSERT OR IGNORE INTO config VALUES ('kairos_db_start_relative', 1, 'number', 'If you have an ongoing brew or fermentation process only values related to this process will be shown in the graph. Additionally you can define in days how far the time series should reach in the past. The earliest time of both information defines when the data series starts.', NULL ); \ No newline at end of file