diff --git a/myems-aggregation/combined_equipment_billing_input_category.py b/myems-aggregation/combined_equipment_billing_input_category.py index 581d32e6..80045cec 100644 --- a/myems-aggregation/combined_equipment_billing_input_category.py +++ b/myems-aggregation/combined_equipment_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_combined_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/combined_equipment_billing_input_item.py b/myems-aggregation/combined_equipment_billing_input_item.py index d7d14f18..3d3381f8 100644 --- a/myems-aggregation/combined_equipment_billing_input_item.py +++ b/myems-aggregation/combined_equipment_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_combined_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/combined_equipment_billing_output_category.py b/myems-aggregation/combined_equipment_billing_output_category.py index c8d520a6..9dfd166b 100644 --- a/myems-aggregation/combined_equipment_billing_output_category.py +++ b/myems-aggregation/combined_equipment_billing_output_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_combined_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/combined_equipment_energy_input_category.py b/myems-aggregation/combined_equipment_energy_input_category.py index bbca4468..ad0ad5bc 100644 --- a/myems-aggregation/combined_equipment_energy_input_category.py +++ b/myems-aggregation/combined_equipment_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_combined_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/combined_equipment_energy_input_item.py b/myems-aggregation/combined_equipment_energy_input_item.py index f91f3a50..82a39c72 100644 --- a/myems-aggregation/combined_equipment_energy_input_item.py +++ b/myems-aggregation/combined_equipment_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_combined_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/combined_equipment_energy_output_category.py b/myems-aggregation/combined_equipment_energy_output_category.py index 7eb7acc8..d73e442e 100644 --- a/myems-aggregation/combined_equipment_energy_output_category.py +++ b/myems-aggregation/combined_equipment_energy_output_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + combined_equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_combined_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - combined_equipment_list = list() for row in rows_combined_equipments: combined_equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/equipment_billing_input_category.py b/myems-aggregation/equipment_billing_input_category.py index 5b2bfc81..765fc43b 100644 --- a/myems-aggregation/equipment_billing_input_category.py +++ b/myems-aggregation/equipment_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/equipment_billing_input_item.py b/myems-aggregation/equipment_billing_input_item.py index ea094f32..5573bc5e 100644 --- a/myems-aggregation/equipment_billing_input_item.py +++ b/myems-aggregation/equipment_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/equipment_billing_output_category.py b/myems-aggregation/equipment_billing_output_category.py index 76668ebe..8a64d2d8 100644 --- a/myems-aggregation/equipment_billing_output_category.py +++ b/myems-aggregation/equipment_billing_output_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_equipments " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/equipment_energy_input_category.py b/myems-aggregation/equipment_energy_input_category.py index e672e688..a7c06d34 100644 --- a/myems-aggregation/equipment_energy_input_category.py +++ b/myems-aggregation/equipment_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/equipment_energy_input_item.py b/myems-aggregation/equipment_energy_input_item.py index 011d0e85..22bf1e8c 100644 --- a/myems-aggregation/equipment_energy_input_item.py +++ b/myems-aggregation/equipment_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/equipment_energy_output_category.py b/myems-aggregation/equipment_energy_output_category.py index 8e2fadcd..12e59c5d 100644 --- a/myems-aggregation/equipment_energy_output_category.py +++ b/myems-aggregation/equipment_energy_output_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + equipment_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_equipments " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - equipment_list = list() for row in rows_equipments: equipment_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/meter_billing.py b/myems-aggregation/meter_billing.py index d043fddd..91e104c6 100644 --- a/myems-aggregation/meter_billing.py +++ b/myems-aggregation/meter_billing.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + meter_list = list() try: cursor_system_db.execute(" SELECT id, name, energy_category_id, cost_center_id " " FROM tbl_meters " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - meter_list = list() for row in rows_meters: meter_list.append({"id": row[0], "name": row[1], diff --git a/myems-aggregation/shopfloor_billing_input_category.py b/myems-aggregation/shopfloor_billing_input_category.py index 4013a54a..ee103cfd 100644 --- a/myems-aggregation/shopfloor_billing_input_category.py +++ b/myems-aggregation/shopfloor_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + shopfloor_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_shopfloors " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - shopfloor_list = list() for row in rows_shopfloors: shopfloor_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/shopfloor_billing_input_item.py b/myems-aggregation/shopfloor_billing_input_item.py index cc47fe06..3db10182 100644 --- a/myems-aggregation/shopfloor_billing_input_item.py +++ b/myems-aggregation/shopfloor_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + shopfloor_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_shopfloors " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - shopfloor_list = list() for row in rows_shopfloors: shopfloor_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/shopfloor_energy_input_category.py b/myems-aggregation/shopfloor_energy_input_category.py index 6a15a265..72f0289e 100644 --- a/myems-aggregation/shopfloor_energy_input_category.py +++ b/myems-aggregation/shopfloor_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + shopfloor_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_shopfloors " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - shopfloor_list = list() for row in rows_shopfloors: shopfloor_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/shopfloor_energy_input_item.py b/myems-aggregation/shopfloor_energy_input_item.py index e144ff55..d704c322 100644 --- a/myems-aggregation/shopfloor_energy_input_item.py +++ b/myems-aggregation/shopfloor_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + shopfloor_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_shopfloors " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - shopfloor_list = list() for row in rows_shopfloors: shopfloor_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/space_billing_input_category.py b/myems-aggregation/space_billing_input_category.py index fdfbcf2e..410c4f26 100644 --- a/myems-aggregation/space_billing_input_category.py +++ b/myems-aggregation/space_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_spaces " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/space_billing_input_item.py b/myems-aggregation/space_billing_input_item.py index 40b7620c..1fa53a36 100644 --- a/myems-aggregation/space_billing_input_item.py +++ b/myems-aggregation/space_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_spaces " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/space_billing_output_category.py b/myems-aggregation/space_billing_output_category.py index 71ba2e8d..09bc005f 100644 --- a/myems-aggregation/space_billing_output_category.py +++ b/myems-aggregation/space_billing_output_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_spaces " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/space_energy_input_category.py b/myems-aggregation/space_energy_input_category.py index dc145dbc..bf69efdc 100644 --- a/myems-aggregation/space_energy_input_category.py +++ b/myems-aggregation/space_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_spaces " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/space_energy_input_item.py b/myems-aggregation/space_energy_input_item.py index 2ebf7a0b..d094e524 100644 --- a/myems-aggregation/space_energy_input_item.py +++ b/myems-aggregation/space_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_spaces " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/space_energy_output_category.py b/myems-aggregation/space_energy_output_category.py index f8aa7c5a..cf2886ba 100644 --- a/myems-aggregation/space_energy_output_category.py +++ b/myems-aggregation/space_energy_output_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + space_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_spaces " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - space_list = list() for row in rows_spaces: space_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/store_billing_input_category.py b/myems-aggregation/store_billing_input_category.py index 6813921c..f0de9ccb 100644 --- a/myems-aggregation/store_billing_input_category.py +++ b/myems-aggregation/store_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + store_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_stores " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - store_list = list() for row in rows_stores: store_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/store_billing_input_item.py b/myems-aggregation/store_billing_input_item.py index 37787059..be66fe38 100644 --- a/myems-aggregation/store_billing_input_item.py +++ b/myems-aggregation/store_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + store_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_stores " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - store_list = list() for row in rows_stores: store_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) diff --git a/myems-aggregation/store_energy_input_category.py b/myems-aggregation/store_energy_input_category.py index dda181db..96dab648 100644 --- a/myems-aggregation/store_energy_input_category.py +++ b/myems-aggregation/store_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + store_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_stores " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - store_list = list() for row in rows_stores: store_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/store_energy_input_item.py b/myems-aggregation/store_energy_input_item.py index b9c71925..3cea655e 100644 --- a/myems-aggregation/store_energy_input_item.py +++ b/myems-aggregation/store_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + store_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_stores " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - store_list = list() for row in rows_stores: store_list.append({"id": row[0], "name": row[1]}) diff --git a/myems-aggregation/tenant_billing_input_category.py b/myems-aggregation/tenant_billing_input_category.py index 29fff4eb..e148022e 100644 --- a/myems-aggregation/tenant_billing_input_category.py +++ b/myems-aggregation/tenant_billing_input_category.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + tenant_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_tenants " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - tenant_list = list() for row in rows_tenants: tenant_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) @@ -124,7 +124,6 @@ def main(logger): print("Connected to MyEMS Billing Database") for tenant in tenant_list: - ############################################################################################################ # Step 2: get the latest start_datetime_utc ############################################################################################################ diff --git a/myems-aggregation/tenant_billing_input_item.py b/myems-aggregation/tenant_billing_input_item.py index 2a0685ce..aa75c8cc 100644 --- a/myems-aggregation/tenant_billing_input_item.py +++ b/myems-aggregation/tenant_billing_input_item.py @@ -42,6 +42,7 @@ def main(logger): print("Connected to MyEMS System Database") + tenant_list = list() try: cursor_system_db.execute(" SELECT id, name, cost_center_id " " FROM tbl_tenants " @@ -58,7 +59,6 @@ def main(logger): time.sleep(60) continue - tenant_list = list() for row in rows_tenants: tenant_list.append({"id": row[0], "name": row[1], "cost_center_id": row[2]}) @@ -124,7 +124,6 @@ def main(logger): print("Connected to MyEMS Billing Database") for tenant in tenant_list: - ############################################################################################################ # Step 2: get the latest start_datetime_utc ############################################################################################################ diff --git a/myems-aggregation/tenant_energy_input_category.py b/myems-aggregation/tenant_energy_input_category.py index 5142a281..9e21be65 100644 --- a/myems-aggregation/tenant_energy_input_category.py +++ b/myems-aggregation/tenant_energy_input_category.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + tenant_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_tenants " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - tenant_list = list() for row in rows_tenants: tenant_list.append({"id": row[0], "name": row[1]}) @@ -66,7 +66,7 @@ def main(logger): print("Got all tenants in MyEMS System Database") - # shuffle the tenant list for randomly calculating the meter hourly value + # shuffle the tenant list for randomly calculating the hourly values random.shuffle(tenant_list) ################################################################################################################ diff --git a/myems-aggregation/tenant_energy_input_item.py b/myems-aggregation/tenant_energy_input_item.py index 76b76268..99220c9a 100644 --- a/myems-aggregation/tenant_energy_input_item.py +++ b/myems-aggregation/tenant_energy_input_item.py @@ -37,6 +37,7 @@ def main(logger): continue print("Connected to MyEMS System Database") + tenant_list = list() try: cursor_system_db.execute(" SELECT id, name " " FROM tbl_tenants " @@ -49,7 +50,6 @@ def main(logger): time.sleep(60) continue - tenant_list = list() for row in rows_tenants: tenant_list.append({"id": row[0], "name": row[1]}) @@ -66,7 +66,7 @@ def main(logger): print("Got all tenants in MyEMS System Database") - # shuffle the tenant list for randomly calculating the meter hourly value + # shuffle the tenant list for randomly calculating the hourly values random.shuffle(tenant_list) ################################################################################################################