Skip to content

Commit 650bb86

Browse files
author
Andy Werner
committed
Netconnectd now shows multiple ip addresses if present
1 parent 8ea8192 commit 650bb86

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

octoprint_netconnectd/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
from octoprint_netconnectd.analytics import Analytics
1818

1919
class NetconnectdSettingsPlugin(octoprint.plugin.SettingsPlugin,
20-
octoprint.plugin.TemplatePlugin,
21-
octoprint.plugin.SimpleApiPlugin,
22-
octoprint.plugin.AssetPlugin):
20+
octoprint.plugin.TemplatePlugin,
21+
octoprint.plugin.SimpleApiPlugin,
22+
octoprint.plugin.AssetPlugin):
2323

2424
LOG_STATE_DELAY = 15.0
2525

@@ -265,7 +265,10 @@ def _get_ip_address(self, interface):
265265
:return: String IP
266266
"""
267267
try:
268-
return netifaces.ifaddresses(interface)[netifaces.AF_INET][0]['addr']
268+
res = []
269+
for tmp in netifaces.ifaddresses(interface)[netifaces.AF_INET]:
270+
res.append(tmp['addr'])
271+
return ", ".join(res)
269272
except:
270273
pass
271274

0 commit comments

Comments
 (0)