From 3bc09edfe4c4c7342ca3e39ca38cea4b85c4bcd4 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Mon, 24 Aug 2026 21:18:26 +0000 Subject: [PATCH] feat: add moisture to soil history query --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index 3e7d6d5..dadcea9 100644 --- a/main.py +++ b/main.py @@ -525,7 +525,7 @@ async def history(request): q = 'select max("pm10") as max_p10, max("pm25") as max_p25, max("co2") as max_co2, max("voc_idx") as max_voc from air where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) elif measurement == 'soil': client = sensors_client - q = 'select mean("soil") as soil from soil where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) + q = 'select mean("soil") as soil, mean("moisture") as moisture from soil where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window) elif measurement == 'lux': client = sensors_client q = 'select mean("lux") as lux from air where "name" = \'{}\' and time >= {}s and time < {}s group by time({}) fill(linear)'.format(name, start, end, window)