Skip to content

Commit 84041da

Browse files
Add time_trunc param to Indicator class
1 parent 5de9766 commit 84041da

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

esios/indicators.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
class Indicator(base.RESTResource):
88
path = 'indicators'
9+
time_trunc = 'hour'
910
time_agg = 'sum'
1011

1112
@base.apimethod
@@ -16,7 +17,7 @@ def get(self, start_date, end_date):
1617
raise Exception('Start date must have time zone')
1718
if end_date.tzinfo is None:
1819
raise Exception('End date must have time zone')
19-
time_trunc = 'hour'
20+
time_trunc = self.time_trunc
2021
time_agg = self.time_agg
2122
start_date = start_date.isoformat()
2223
end_date = end_date.isoformat()

0 commit comments

Comments
 (0)