Skip to content

Commit

Permalink
Fix websockets dependency
Browse files Browse the repository at this point in the history
Cleanup code to resolve warnings
Update bundled configuration
  • Loading branch information
NeonDaniel committed May 7, 2024
1 parent 5cf75cb commit c508844
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
7 changes: 3 additions & 4 deletions neon_nodes/configuration/system.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
neon_node:
description: Neon Node
# hana_address: https://hana.neonaiservices.com
hana_address: http://10.0.30.10:8080
hana_username: node_user
hana_password: node_password
hana_address: https://hana.neonaialpha.com
hana_username: neon
hana_password: neon
microphone:
module: ovos-microphone-plugin-alsa
listener:
Expand Down
10 changes: 5 additions & 5 deletions neon_nodes/websocket_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,17 @@ def __init__(self, bus=None, ready_hook=on_ready, error_hook=on_error,
"password": node_config["hana_password"]}).json()
LOG.info(auth_data)

def on_connect(*_, **__):
def ws_connect(*_, **__):
self._connected.set()

def on_error(_, exception):
self.error_hook()
def ws_error(_, exception):
self.error_hook(exception)
raise ConnectionError(f"Failed to connect: {exception}")
ws_address = server_addr.replace("http", "ws", 1)
self.websocket = WebSocketApp(f"{ws_address}/node/v1?token={auth_data['access_token']}",
on_message=self._on_ws_data,
on_open=on_connect,
on_error=on_error)
on_open=ws_connect,
on_error=ws_error)
Thread(target=self.websocket.run_forever, daemon=True).start()
self._device_data = self.config.get('neon_node', {})
LOG.init(self.config.get("logging"))
Expand Down
2 changes: 1 addition & 1 deletion requirements/websocket_client.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
websocket~=0.2
websockets~=12.0

0 comments on commit c508844

Please sign in to comment.