serial number to table looku, because order changed in record
This commit is contained in:
@@ -70,14 +70,20 @@ def main():
|
||||
last_status_time_downstairs = ''
|
||||
|
||||
|
||||
serial_to_table = {"4721W204230": "CARRIER_DOWNSTAIRS_STATUS",
|
||||
"4221W206632": "CARRIER_UPSTAIRS_STATUS"}
|
||||
|
||||
while True:
|
||||
try:
|
||||
print('Get Log')
|
||||
api_connection.activate()
|
||||
status = api_connection.get_status(systems[1].serial)
|
||||
last_status_time_downstairs = parse_status(status, last_status_time_downstairs, "CARRIER_DOWNSTAIRS_STATUS")
|
||||
status = api_connection.get_status(systems[0].serial)
|
||||
last_status_time_upstairs = parse_status(status, last_status_time_upstairs, "CARRIER_UPSTAIRS_STATUS")
|
||||
|
||||
for i in range(2):
|
||||
print('')
|
||||
table = serial_to_table[systems[i].serial]
|
||||
print('Get Log Downstairs', systems[i].serial, table)
|
||||
status_downstairs = api_connection.get_status(systems[1].serial)
|
||||
last_status_time_downstairs = parse_status(status_downstairs, last_status_time_downstairs, table)
|
||||
|
||||
except:
|
||||
# print("Reconnect to server")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user