fixed warnings in myems-aggregation service
parent
545d16660d
commit
04df9ac030
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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],
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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]})
|
||||
|
||||
|
|
|
@ -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
|
||||
############################################################################################################
|
||||
|
|
|
@ -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
|
||||
############################################################################################################
|
||||
|
|
|
@ -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)
|
||||
|
||||
################################################################################################################
|
||||
|
|
|
@ -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)
|
||||
|
||||
################################################################################################################
|
||||
|
|
Loading…
Reference in New Issue