Compare commits
2 Commits
6971548589
...
1e38be5ec5
| Author | SHA1 | Date | |
|---|---|---|---|
|
1e38be5ec5
|
|||
|
b265feba7a
|
@@ -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,
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user