diff --git a/deploy/websocket_server/websocket_server.py b/deploy/websocket_server/websocket_server.py index 0df32361..a082a849 100644 --- a/deploy/websocket_server/websocket_server.py +++ b/deploy/websocket_server/websocket_server.py @@ -217,8 +217,8 @@ def split_message(message): case "firmware": client["firmware"] = data parts = data.split("_", 1) - tracker.store.set_user_property("firmware_v", parts[0]) - tracker.store.set_user_property("identifier", parts[1]) + #tracker.store.set_user_property("firmware_v", parts[0]) + #tracker.store.set_user_property("identifier", parts[1]) logger.debug(f"{client_ip}:{client_id} >>> firmware saved") case "user_info": json_data = json.loads(data) @@ -226,30 +226,30 @@ def split_message(message): tracker.store.set_user_property(key, value) case "chip_id": client["chip_id"] = data - tracker.client_id = data - tracker.store.set_session_parameter("session_id", f"{data}_{datetime.now().timestamp()}") - tracker.store.set_user_property("user_id", data) - tracker.store.set_user_property("chip_id", data) - tracker.store.set_user_property("country", country) - tracker.store.set_user_property("region", region) - tracker.store.set_user_property("city", city) - tracker.store.set_user_property("ip", client_ip) - online_event = tracker.create_new_event("status") - online_event.set_event_param("online", "true") - tracker.send(events=[online_event], date=datetime.now()) + #tracker.client_id = data + #tracker.store.set_session_parameter("session_id", f"{data}_{datetime.now().timestamp()}") + #tracker.store.set_user_property("user_id", data) + #tracker.store.set_user_property("chip_id", data) + #tracker.store.set_user_property("country", country) + #tracker.store.set_user_property("region", region) + #tracker.store.set_user_property("city", city) + #tracker.store.set_user_property("ip", client_ip) + #online_event = tracker.create_new_event("status") + #online_event.set_event_param("online", "true") + #tracker.send(events=[online_event], date=datetime.now()) logger.debug(f"{client_ip}:{client_id} >>> chip_id saved") case "pong": - ping_event = tracker.create_new_event("ping") - ping_event.set_event_param("state", "alive") - tracker.send(events=[ping_event], date=datetime.now()) + #ping_event = tracker.create_new_event("ping") + #ping_event.set_event_param("state", "alive") + #tracker.send(events=[ping_event], date=datetime.now()) logger.debug(f"{client_ip}:{client_id} >>> ping analytics sent") case "settings": json_data = json.loads(data) - settings_event = tracker.create_new_event("settings") - for key, value in json_data.items(): - settings_event.set_event_param(key, value) - tracker.send(events=[settings_event], date=datetime.now()) - logger.debug(f"{client_ip}:{client_id} >>> settings analytics sent") + #settings_event = tracker.create_new_event("settings") + #for key, value in json_data.items(): + # settings_event.set_event_param(key, value) + #tracker.send(events=[settings_event], date=datetime.now()) + #logger.debug(f"{client_ip}:{client_id} >>> settings analytics sent") case _: logger.debug(f"{client_ip}:{client_id} !!! unknown data request") except websockets.exceptions.ConnectionClosedError as e: @@ -257,9 +257,9 @@ def split_message(message): except Exception as e: pass finally: - offline_event = tracker.create_new_event("status") - offline_event.set_event_param("online", "false") - tracker.send(events=[offline_event], date=datetime.now()) + #offline_event = tracker.create_new_event("status") + #offline_event.set_event_param("online", "false") + #tracker.send(events=[offline_event], date=datetime.now()) data_task.cancel() del shared_data.trackers[f"{client_ip}_{client_port}"] del shared_data.clients[f"{client_ip}_{client_port}"]