File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
src/labthings/server/wsgi Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,12 @@ def __init__(
4444
4545 def register_zeroconf (self ):
4646 if self .labthing :
47+ # Get list of host addresses
48+ mdns_addresses = {
49+ socket .inet_aton (i )
50+ for i in get_all_addresses ()
51+ if i not in ("127.0.0.1" , "0.0.0.0" )
52+ }
4753 # LabThing service
4854 self .service_infos .add (
4955 ServiceInfo (
@@ -56,11 +62,7 @@ def register_zeroconf(self):
5662 "description" : self .labthing .description ,
5763 "types" : ";" .join (self .labthing .types ),
5864 },
59- addresses = {
60- socket .inet_aton (i )
61- for i in get_all_addresses ()
62- if i not in ("127.0.0.1" , "0.0.0.0" )
63- },
65+ addresses = mdns_addresses ,
6466 )
6567 )
6668 # Mozilla WebThing service
@@ -70,11 +72,7 @@ def register_zeroconf(self):
7072 f"{ self .labthing .safe_title } ._webthing._tcp.local." ,
7173 port = self .port ,
7274 properties = {"path" : self .labthing .url_prefix },
73- addresses = {
74- socket .inet_aton (i )
75- for i in get_all_addresses ()
76- if i not in ("127.0.0.1" , "0.0.0.0" )
77- },
75+ addresses = mdns_addresses ,
7876 )
7977 )
8078 self .zeroconf_server = Zeroconf (ip_version = IPVersion .V4Only )
You can’t perform that action at this time.
0 commit comments