From 0a81c665ab409af2ffbc4d8fde9ad8bb5f542737 Mon Sep 17 00:00:00 2001 From: Keyvan Hardani Date: Wed, 24 Apr 2024 17:01:01 +0200 Subject: [PATCH] Update base_device.py --- software/source/clients/base_device.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/software/source/clients/base_device.py b/software/source/clients/base_device.py index 188e915..412e92a 100644 --- a/software/source/clients/base_device.py +++ b/software/source/clients/base_device.py @@ -291,18 +291,18 @@ class Device: # Receive authentication request from the server auth_request = await websocket.recv() auth_data = json.loads(auth_request) - + if auth_data["type"] == "auth_request": # Send authentication response with the token token = os.getenv("WS_TOKEN") if token: auth_response = {"token": token} await websocket.send(json.dumps(auth_response)) - + # Receive authentication result from the server auth_result = await websocket.recv() result_data = json.loads(auth_result) - + if result_data["type"] == "auth_success": # Authentication successful return True