wait for Zeroconf to init before registering service
This commit is contained in:
parent
abfe0809fa
commit
0401f76621
1 changed files with 2 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
# vi:si:et:sw=4:sts=4:ts=4
|
# vi:si:et:sw=4:sts=4:ts=4
|
||||||
|
|
||||||
import socket
|
import socket
|
||||||
|
import time
|
||||||
|
|
||||||
from zeroconf import (
|
from zeroconf import (
|
||||||
get_all_addresses,
|
get_all_addresses,
|
||||||
|
@ -58,6 +59,7 @@ class LocalNodes(dict):
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.local_ips = sorted(get_all_addresses(socket.AF_INET))
|
self.local_ips = sorted(get_all_addresses(socket.AF_INET))
|
||||||
self.zeroconf = Zeroconf()
|
self.zeroconf = Zeroconf()
|
||||||
|
time.sleep(0.02)
|
||||||
self.register_service()
|
self.register_service()
|
||||||
self.browse()
|
self.browse()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue