def start():
global localHTTP, zeroconf, info, httpthread
ip = get_local_address()
logging.info("Local IP is " + ip)
desc = {'version': '0.1'}
info = ServiceInfo("_http._tcp.local.",
"Alexa Device._http._tcp.local.",
socket.inet_aton(ip), alexa_params.LOCAL_PORT, 0, 0,
desc, alexa_params.LOCAL_HOST + ".")
zeroconf = Zeroconf()
zeroconf.registerService(info)
logging.info("Local mDNS is started, domain is " + alexa_params.LOCAL_HOST)
localHTTP = HTTPServer(("", alexa_params.LOCAL_PORT), alexa_http_config.AlexaConfig)
httpthread = threading.Thread(target=localHTTP.serve_forever)
httpthread.start()
logging.info("Local HTTP is " + alexa_params.BASE_URL)
alexa_control.start()
评论列表
文章目录