wait for Zeroconf to init before registering service

This commit is contained in:
j 2016-03-23 19:48:15 +01:00
parent abfe0809fa
commit 0401f76621
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
# vi:si:et:sw=4:sts=4:ts=4
import socket
import time
from zeroconf import (
get_all_addresses,
@ -58,6 +59,7 @@ class LocalNodes(dict):
def setup(self):
self.local_ips = sorted(get_all_addresses(socket.AF_INET))
self.zeroconf = Zeroconf()
time.sleep(0.02)
self.register_service()
self.browse()