ADD: fetch raw measurements
This commit is contained in:
parent
8aba5ac6c2
commit
5a04bf2e91
@ -11,6 +11,7 @@ def utc_now() -> datetime:
|
||||
return datetime.now(timezone.utc)
|
||||
|
||||
class MeasurementResolution(str, Enum):
|
||||
raw = "raw"
|
||||
hourly = "hourly"
|
||||
daily = "daily"
|
||||
weekly = "weekly"
|
||||
|
||||
@ -101,10 +101,11 @@ def _query_measurements(
|
||||
grouped[m.station_id] = []
|
||||
grouped[m.station_id].append(MeasurementResponse.model_validate(m))
|
||||
|
||||
grouped = {
|
||||
station_id: aggregate(measurements, resolution)
|
||||
for station_id, measurements in grouped.items()
|
||||
}
|
||||
if resolution != MeasurementResolution.raw:
|
||||
grouped = {
|
||||
station_id: aggregate(measurements, resolution)
|
||||
for station_id, measurements in grouped.items()
|
||||
}
|
||||
|
||||
if limit:
|
||||
grouped = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user