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__(
44
44
45
45
def register_zeroconf (self ):
46
46
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
+ }
47
53
# LabThing service
48
54
self .service_infos .add (
49
55
ServiceInfo (
@@ -56,11 +62,7 @@ def register_zeroconf(self):
56
62
"description" : self .labthing .description ,
57
63
"types" : ";" .join (self .labthing .types ),
58
64
},
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 ,
64
66
)
65
67
)
66
68
# Mozilla WebThing service
@@ -70,11 +72,7 @@ def register_zeroconf(self):
70
72
f"{ self .labthing .safe_title } ._webthing._tcp.local." ,
71
73
port = self .port ,
72
74
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 ,
78
76
)
79
77
)
80
78
self .zeroconf_server = Zeroconf (ip_version = IPVersion .V4Only )
You can’t perform that action at this time.
0 commit comments