Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Add public IP to network_info
  • Loading branch information
NeonDaniel committed Jan 27, 2024
1 parent d29dbe9 commit f57a253
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions neon_nodes/voice_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/voice_client.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f57a253

Please sign in to comment.