resolution = resolutions['year']
# TODO: filter out samples from 'result'
# something like
- # select mean(temperature) from sensors where ... group by mod(timestamp, resolution)
- # func.avg(...)
- #
- # from https://stackoverflow.com/questions/4342370/grouping-into-interval-of-5-minutes-within-a-time-range
- # SELECT
- # timestamp, -- not sure about that
- # name,
- # count(b.name)
- # FROM time a, id
- # WHERE …
- # GROUP BY
- # UNIX_TIMESTAMP(timestamp) DIV 300, name
+ # select to_seconds(datetime) DIV (60*60*24) as interval_id, min(datetime), max(datetime), min(temp), avg(temp), max(temp), count(temp) from openweathermap group by interval_id order by interval_id;
return query.all()