2 Commits

2 changed files with 4 additions and 4 deletions

View File

@@ -267,7 +267,7 @@ class BackendServer:
self.logger.warning(f"Client {client_id} not found")
return None
return {
"id": client.mac_id,
"id": client.id,
"addr": client.addr,
"last_seen": client.last_seen,
"status": client.status,

View File

@@ -32,7 +32,7 @@ class Client:
)
self.logger.debug(f"Initializing Client {addr}...")
self.mac_id: str | None = mac_id
self.id: str | None = mac_id
self.last_seen: float = 0.0 # unix timestanp of last inbound message
self.status: ClientStatus = ClientStatus.CONNECTED
@@ -42,10 +42,10 @@ class Client:
self.outbound: bytes = b""
def __str__(self) -> str:
return f"Client({self.mac_id} ({self.addr[0]}:{self.addr[1]}))"
return f"Client({self.id} ({self.addr[0]}:{self.addr[1]}))"
def __repr__(self) -> str:
return f"Client({self.mac_id}, {self.addr})"
return f"Client({self.id}, {self.addr})"
def disconnect(self) -> None:
"""Disconnect the client and close the socket."""