added parameters validator to statistics_hourly_data_by_period in API
parent
985ffb55aa
commit
8b1ead660f
|
@ -636,6 +636,12 @@ def averaging_hourly_data_by_period(rows_hourly, start_datetime_utc, end_datetim
|
||||||
########################################################################################################################
|
########################################################################################################################
|
||||||
def statistics_hourly_data_by_period(rows_hourly, start_datetime_utc, end_datetime_utc, period_type):
|
def statistics_hourly_data_by_period(rows_hourly, start_datetime_utc, end_datetime_utc, period_type):
|
||||||
# todo: validate parameters
|
# todo: validate parameters
|
||||||
|
if start_datetime_utc is None or \
|
||||||
|
end_datetime_utc is None or \
|
||||||
|
start_datetime_utc >= end_datetime_utc or \
|
||||||
|
period_type not in ('hourly', 'daily', 'monthly', 'yearly'):
|
||||||
|
return list(), None, None, None, None, None, None
|
||||||
|
|
||||||
start_datetime_utc = start_datetime_utc.replace(tzinfo=None)
|
start_datetime_utc = start_datetime_utc.replace(tzinfo=None)
|
||||||
end_datetime_utc = end_datetime_utc.replace(tzinfo=None)
|
end_datetime_utc = end_datetime_utc.replace(tzinfo=None)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue