From f57a253256f3a30bbbed7ed8a3e5edc1efe23847 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 26 Jan 2024 16:20:02 -0800 Subject: [PATCH] Update dependencies Add public IP to network_info --- neon_nodes/voice_client.py | 7 +++++++ requirements/voice_client.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/neon_nodes/voice_client.py b/neon_nodes/voice_client.py index bebfd78..4a9cc44 100644 --- a/neon_nodes/voice_client.py +++ b/neon_nodes/voice_client.py @@ -30,6 +30,8 @@ from threading import Thread from unittest.mock import Mock from base64 import b64decode, b64encode + +import requests from ovos_plugin_manager.microphone import OVOSMicrophoneFactory from ovos_plugin_manager.vad import OVOSVADFactory from ovos_dinkum_listener.voice_loop.voice_loop import DinkumVoiceLoop @@ -134,6 +136,9 @@ def error_sound(self) -> AudioSegment: def network_info(self) -> dict: if not self._network_info: self._network_info = get_adapter_info() + public_ip = requests.get('https://api.ipify.org').text + self._network_info["public"] = public_ip + LOG.debug(f"Resolved network info: {self._network_info}") return self._network_info @property @@ -142,8 +147,10 @@ def node_data(self): self._node_data = {"device_description": "test client", "networking": { "local_ip": self.network_info.get('ipv4'), + "public_ip": self.network_info.get('public'), "mac_address": self.network_info.get('mac')} } + LOG.info(f"Resolved node_data: {self._node_data}") return self._node_data @property diff --git a/requirements/voice_client.txt b/requirements/voice_client.txt index a93a487..bb7f057 100644 --- a/requirements/voice_client.txt +++ b/requirements/voice_client.txt @@ -1,4 +1,4 @@ -neon-utils~=1.8,>=1.8.3a3 +neon-utils[network]~=1.8,>=1.8.3a3 ovos-dinkum-listener~=0.0.2,>=0.0.3a27 ovos-vad-plugin-webrtcvad~=0.0.1 ovos-microphone-plugin-alsa~=0.0.0