diff --git a/myems-api/reports/combinedequipmentcost.py b/myems-api/reports/combinedequipmentcost.py index b2562c7e..7d6f74ac 100644 --- a/myems-api/reports/combinedequipmentcost.py +++ b/myems-api/reports/combinedequipmentcost.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -286,6 +286,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -337,6 +339,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentefficiency.py b/myems-api/reports/combinedequipmentefficiency.py index afaf9a08..49b2a832 100644 --- a/myems-api/reports/combinedequipmentefficiency.py +++ b/myems-api/reports/combinedequipmentefficiency.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -436,6 +436,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -455,6 +457,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -573,6 +577,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -592,6 +598,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentenergycategory.py b/myems-api/reports/combinedequipmentenergycategory.py index c2886cf1..c06eb07e 100644 --- a/myems-api/reports/combinedequipmentenergycategory.py +++ b/myems-api/reports/combinedequipmentenergycategory.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -291,6 +291,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -349,6 +351,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentenergyitem.py b/myems-api/reports/combinedequipmentenergyitem.py index 863b6c07..1ce17c22 100644 --- a/myems-api/reports/combinedequipmentenergyitem.py +++ b/myems-api/reports/combinedequipmentenergyitem.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -290,6 +290,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -341,6 +343,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentincome.py b/myems-api/reports/combinedequipmentincome.py index 004be5e5..d52133a4 100644 --- a/myems-api/reports/combinedequipmentincome.py +++ b/myems-api/reports/combinedequipmentincome.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -286,6 +286,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -333,6 +335,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentload.py b/myems-api/reports/combinedequipmentload.py index d18897f6..16659100 100644 --- a/myems-api/reports/combinedequipmentload.py +++ b/myems-api/reports/combinedequipmentload.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -298,6 +298,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -355,6 +357,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentoutput.py b/myems-api/reports/combinedequipmentoutput.py index 1e5be77a..eb438d6a 100644 --- a/myems-api/reports/combinedequipmentoutput.py +++ b/myems-api/reports/combinedequipmentoutput.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -286,6 +286,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -333,6 +335,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentsaving.py b/myems-api/reports/combinedequipmentsaving.py index febb3815..52ab71c6 100644 --- a/myems-api/reports/combinedequipmentsaving.py +++ b/myems-api/reports/combinedequipmentsaving.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -312,6 +312,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -351,6 +353,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -427,6 +431,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -466,6 +472,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/combinedequipmentstatistics.py b/myems-api/reports/combinedequipmentstatistics.py index 531a1c4b..3fd366ad 100644 --- a/myems-api/reports/combinedequipmentstatistics.py +++ b/myems-api/reports/combinedequipmentstatistics.py @@ -60,7 +60,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -299,6 +299,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -359,6 +361,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/dashboard.py b/myems-api/reports/dashboard.py index 0b03d626..f75fde71 100644 --- a/myems-api/reports/dashboard.py +++ b/myems-api/reports/dashboard.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -312,6 +312,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -359,6 +361,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -413,6 +417,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -480,6 +486,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentcost.py b/myems-api/reports/equipmentcost.py index 26706313..2f606913 100644 --- a/myems-api/reports/equipmentcost.py +++ b/myems-api/reports/equipmentcost.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -264,6 +264,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -314,6 +316,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentefficiency.py b/myems-api/reports/equipmentefficiency.py index ce882a25..64baabd6 100644 --- a/myems-api/reports/equipmentefficiency.py +++ b/myems-api/reports/equipmentefficiency.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -350,6 +350,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -369,6 +371,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -487,6 +491,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -506,6 +512,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentenergycategory.py b/myems-api/reports/equipmentenergycategory.py index 331a0466..7f063db8 100644 --- a/myems-api/reports/equipmentenergycategory.py +++ b/myems-api/reports/equipmentenergycategory.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -269,6 +269,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -326,6 +328,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentenergyitem.py b/myems-api/reports/equipmentenergyitem.py index 3ed11fbb..1ba96618 100644 --- a/myems-api/reports/equipmentenergyitem.py +++ b/myems-api/reports/equipmentenergyitem.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -268,6 +268,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -318,6 +320,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentincome.py b/myems-api/reports/equipmentincome.py index 8c9efb77..d08fd615 100644 --- a/myems-api/reports/equipmentincome.py +++ b/myems-api/reports/equipmentincome.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -264,6 +264,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -310,6 +312,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentload.py b/myems-api/reports/equipmentload.py index f14ce0e2..7c701228 100644 --- a/myems-api/reports/equipmentload.py +++ b/myems-api/reports/equipmentload.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -277,6 +277,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -334,6 +336,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentoutput.py b/myems-api/reports/equipmentoutput.py index c6789fdf..e4a2fcfe 100644 --- a/myems-api/reports/equipmentoutput.py +++ b/myems-api/reports/equipmentoutput.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -264,6 +264,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -310,6 +312,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentsaving.py b/myems-api/reports/equipmentsaving.py index bf3cc013..d8f8d1f6 100644 --- a/myems-api/reports/equipmentsaving.py +++ b/myems-api/reports/equipmentsaving.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -290,6 +290,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -328,6 +330,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -403,6 +407,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -441,6 +447,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/equipmentstatistics.py b/myems-api/reports/equipmentstatistics.py index 214ac8ae..830f7c5e 100644 --- a/myems-api/reports/equipmentstatistics.py +++ b/myems-api/reports/equipmentstatistics.py @@ -54,7 +54,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -278,6 +278,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -338,6 +340,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/metercost.py b/myems-api/reports/metercost.py index 4a528e57..318e51fa 100644 --- a/myems-api/reports/metercost.py +++ b/myems-api/reports/metercost.py @@ -59,7 +59,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -220,6 +220,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -287,6 +289,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/metersubmetersbalance.py b/myems-api/reports/metersubmetersbalance.py index e575cfe8..944fefa9 100644 --- a/myems-api/reports/metersubmetersbalance.py +++ b/myems-api/reports/metersubmetersbalance.py @@ -51,7 +51,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -183,6 +183,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -225,6 +227,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -284,6 +288,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/offlinemetercost.py b/myems-api/reports/offlinemetercost.py index deac662c..83c8fca8 100644 --- a/myems-api/reports/offlinemetercost.py +++ b/myems-api/reports/offlinemetercost.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -198,6 +198,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -265,6 +267,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/offlinemeterenergy.py b/myems-api/reports/offlinemeterenergy.py index 8db9ad16..d2b3dd26 100644 --- a/myems-api/reports/offlinemeterenergy.py +++ b/myems-api/reports/offlinemeterenergy.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -185,6 +185,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -228,6 +230,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorcost.py b/myems-api/reports/shopfloorcost.py index be6355d5..77914495 100644 --- a/myems-api/reports/shopfloorcost.py +++ b/myems-api/reports/shopfloorcost.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -279,6 +279,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -329,6 +331,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorenergycategory.py b/myems-api/reports/shopfloorenergycategory.py index 279c6412..5043654f 100644 --- a/myems-api/reports/shopfloorenergycategory.py +++ b/myems-api/reports/shopfloorenergycategory.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -284,6 +284,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -341,6 +343,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorenergyitem.py b/myems-api/reports/shopfloorenergyitem.py index 7a77eab3..1a011f46 100644 --- a/myems-api/reports/shopfloorenergyitem.py +++ b/myems-api/reports/shopfloorenergyitem.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -283,6 +283,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -333,6 +335,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorload.py b/myems-api/reports/shopfloorload.py index cdee1aba..591a1e94 100644 --- a/myems-api/reports/shopfloorload.py +++ b/myems-api/reports/shopfloorload.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -292,6 +292,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -349,6 +351,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorsaving.py b/myems-api/reports/shopfloorsaving.py index 9a97a4f1..9ea673cf 100644 --- a/myems-api/reports/shopfloorsaving.py +++ b/myems-api/reports/shopfloorsaving.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -305,6 +305,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -343,6 +345,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -418,6 +422,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -456,6 +462,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/shopfloorstatistics.py b/myems-api/reports/shopfloorstatistics.py index 30dc1957..0fbd706d 100644 --- a/myems-api/reports/shopfloorstatistics.py +++ b/myems-api/reports/shopfloorstatistics.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -293,6 +293,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -353,6 +355,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spacecost.py b/myems-api/reports/spacecost.py index 44239857..1fcb9b52 100644 --- a/myems-api/reports/spacecost.py +++ b/myems-api/reports/spacecost.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -294,6 +294,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -343,6 +345,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceefficiency.py b/myems-api/reports/spaceefficiency.py index 7b95cf39..b3215c26 100644 --- a/myems-api/reports/spaceefficiency.py +++ b/myems-api/reports/spaceefficiency.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -307,6 +307,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -352,6 +354,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -397,6 +401,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -443,6 +449,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceenergycategory.py b/myems-api/reports/spaceenergycategory.py index f2961888..b005436f 100644 --- a/myems-api/reports/spaceenergycategory.py +++ b/myems-api/reports/spaceenergycategory.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -299,6 +299,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -355,6 +357,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceenergyitem.py b/myems-api/reports/spaceenergyitem.py index c53c554b..3762105f 100644 --- a/myems-api/reports/spaceenergyitem.py +++ b/myems-api/reports/spaceenergyitem.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -298,6 +298,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -347,6 +349,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceincome.py b/myems-api/reports/spaceincome.py index bf56b4ab..87803b62 100644 --- a/myems-api/reports/spaceincome.py +++ b/myems-api/reports/spaceincome.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -294,6 +294,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -339,6 +341,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceload.py b/myems-api/reports/spaceload.py index 9d5aafd1..bb0e8570 100644 --- a/myems-api/reports/spaceload.py +++ b/myems-api/reports/spaceload.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -292,6 +292,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -349,6 +351,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spaceoutput.py b/myems-api/reports/spaceoutput.py index 3081ed77..39f95a03 100644 --- a/myems-api/reports/spaceoutput.py +++ b/myems-api/reports/spaceoutput.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -294,6 +294,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -339,6 +341,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spacesaving.py b/myems-api/reports/spacesaving.py index 0bb185bb..c3a5bf0e 100644 --- a/myems-api/reports/spacesaving.py +++ b/myems-api/reports/spacesaving.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -320,6 +320,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -357,6 +359,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -431,6 +435,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -468,6 +474,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/spacestatistics.py b/myems-api/reports/spacestatistics.py index 90aa5fdb..a615eaf7 100644 --- a/myems-api/reports/spacestatistics.py +++ b/myems-api/reports/spacestatistics.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -293,6 +293,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -352,6 +354,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storecost.py b/myems-api/reports/storecost.py index 1f03ab2b..04b17e96 100644 --- a/myems-api/reports/storecost.py +++ b/myems-api/reports/storecost.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -279,6 +279,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -328,6 +330,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storeenergycategory.py b/myems-api/reports/storeenergycategory.py index aacbcf81..9326a0e9 100644 --- a/myems-api/reports/storeenergycategory.py +++ b/myems-api/reports/storeenergycategory.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -284,6 +284,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -340,6 +342,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storeenergyitem.py b/myems-api/reports/storeenergyitem.py index 69b9dc68..e8bded63 100644 --- a/myems-api/reports/storeenergyitem.py +++ b/myems-api/reports/storeenergyitem.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -283,6 +283,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -332,6 +334,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storeload.py b/myems-api/reports/storeload.py index 1be7f6d4..364d7d20 100644 --- a/myems-api/reports/storeload.py +++ b/myems-api/reports/storeload.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -292,6 +292,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -349,6 +351,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storesaving.py b/myems-api/reports/storesaving.py index 7c22f648..be1af2be 100644 --- a/myems-api/reports/storesaving.py +++ b/myems-api/reports/storesaving.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -305,6 +305,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -342,6 +344,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -416,6 +420,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -453,6 +459,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/storestatistics.py b/myems-api/reports/storestatistics.py index ef782eb3..1ef536e5 100644 --- a/myems-api/reports/storestatistics.py +++ b/myems-api/reports/storestatistics.py @@ -56,7 +56,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -294,6 +294,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -353,6 +355,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantbill.py b/myems-api/reports/tenantbill.py index a6381da6..a748ecce 100644 --- a/myems-api/reports/tenantbill.py +++ b/myems-api/reports/tenantbill.py @@ -211,6 +211,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -256,6 +258,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantcost.py b/myems-api/reports/tenantcost.py index 3ea1f4f6..add30dad 100644 --- a/myems-api/reports/tenantcost.py +++ b/myems-api/reports/tenantcost.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -279,6 +279,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -328,6 +330,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantenergycategory.py b/myems-api/reports/tenantenergycategory.py index 3d268806..9c7858d0 100644 --- a/myems-api/reports/tenantenergycategory.py +++ b/myems-api/reports/tenantenergycategory.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -284,6 +284,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -340,6 +342,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantenergyitem.py b/myems-api/reports/tenantenergyitem.py index fab9a0bf..ea20590c 100644 --- a/myems-api/reports/tenantenergyitem.py +++ b/myems-api/reports/tenantenergyitem.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -283,6 +283,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -332,6 +334,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantload.py b/myems-api/reports/tenantload.py index fa6fe848..1287714b 100644 --- a/myems-api/reports/tenantload.py +++ b/myems-api/reports/tenantload.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -292,6 +292,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -349,6 +351,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantsaving.py b/myems-api/reports/tenantsaving.py index 103ea9c6..d9ed4d88 100644 --- a/myems-api/reports/tenantsaving.py +++ b/myems-api/reports/tenantsaving.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -305,6 +305,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -342,6 +344,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -416,6 +420,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -453,6 +459,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/tenantstatistics.py b/myems-api/reports/tenantstatistics.py index 49a4224d..f4e38112 100644 --- a/myems-api/reports/tenantstatistics.py +++ b/myems-api/reports/tenantstatistics.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -293,6 +293,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -352,6 +354,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/virtualmetercost.py b/myems-api/reports/virtualmetercost.py index e8bc8a5a..e6eae2df 100644 --- a/myems-api/reports/virtualmetercost.py +++ b/myems-api/reports/virtualmetercost.py @@ -57,7 +57,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -197,6 +197,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -264,6 +266,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': diff --git a/myems-api/reports/virtualmeterenergy.py b/myems-api/reports/virtualmeterenergy.py index c3c0dec7..962749c7 100644 --- a/myems-api/reports/virtualmeterenergy.py +++ b/myems-api/reports/virtualmeterenergy.py @@ -55,7 +55,7 @@ class Reporting: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') else: period_type = str.strip(period_type) - if period_type not in ['hourly', 'daily', 'monthly', 'yearly']: + if period_type not in ['hourly', 'daily', 'weekly', 'monthly', 'yearly']: raise falcon.HTTPError(falcon.HTTP_400, title='API.BAD_REQUEST', description='API.INVALID_PERIOD_TYPE') timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6]) @@ -188,6 +188,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly': @@ -231,6 +233,8 @@ class Reporting: current_datetime = current_datetime_local.strftime('%Y-%m-%dT%H:%M:%S') elif period_type == 'daily': current_datetime = current_datetime_local.strftime('%Y-%m-%d') + elif period_type == 'weekly': + current_datetime = current_datetime_local.strftime('%Y-%m-%d') elif period_type == 'monthly': current_datetime = current_datetime_local.strftime('%Y-%m') elif period_type == 'yearly':