Handle broadcast IDs in client details retrieval

Add a check for broadcast node IDs (4294967295 and 1) in the `_get_client_details` method to return a predefined `ClientDetails` instance. This prevents unnecessary database queries for broadcast IDs and ensures consistent handling of these special cases.
```
This commit is contained in:
Gleb Tcivie 2025-01-05 20:20:16 +02:00
parent 1fc4096772
commit 0650382405

View file

@ -308,6 +308,8 @@ class MessageProcessor:
).set(mesh_packet.rx_rssi)
def _get_client_details(self, node_id: int) -> ClientDetails:
if node_id == 4294967295 or node_id == 1: # FFFFFFFF or 1 (Broadcast)
return ClientDetails(node_id=node_id, short_name='Broadcast', long_name='Broadcast')
node_id_str = str(node_id) # Convert the integer to a string
with self.db_pool.connection() as conn:
with conn.cursor() as cur: