Casper 3 months ago
parent
commit
0d62fb7571
2 changed files with 3 additions and 3 deletions
  1. 1 1
      sri-server-bg01/api/v6/code2000.py
  2. 2 2
      sri-server-bg03/lib/Connection_e1.py

+ 1 - 1
sri-server-bg01/api/v6/code2000.py

@@ -82,7 +82,7 @@ async def code2002(**sources):
         }
 
         # --- update state ---
-        vehicle_id = int(f"{item.get('host_address').replace('.', '')}")
+        vehicle_id = str(f"{item.get('host_address').replace('.', '')}")
         if not status_dict.get(vehicle_id):
             data['state'] = 1
         else:

+ 2 - 2
sri-server-bg03/lib/Connection_e1.py

@@ -55,7 +55,7 @@ class SRIConnection(asyncio.Protocol):
         data = item.get('args', {})
 
         # --- set VehicleStatus ---
-        data[self.connection_id] = 2
+        data[str(self.connection_id)] = 2
         update_dict = {'args': data}
         Global.mdb.update_one('GlobalVariable', unique_dict, update_dict)
 
@@ -505,7 +505,7 @@ class SRIConnection(asyncio.Protocol):
         data = item.get('args', {})
 
         # --- set VehicleStatus ---
-        data[self.connection_id] = 4
+        data[str(self.connection_id)] = 4
         update_dict = {'args': data}
         Global.mdb.update_one('GlobalVariable', unique_dict, update_dict)