From 1de45ebe8bbc30b7203123630ba4a23ef7f419bf Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Sun, 10 Apr 2016 17:59:21 -0700 Subject: [PATCH] Fix api_password conditional and close zeroconf when we shut down --- homeassistant/components/zeroconf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/zeroconf.py b/homeassistant/components/zeroconf.py index 4c5c21f08dd..bda6dcb153b 100644 --- a/homeassistant/components/zeroconf.py +++ b/homeassistant/components/zeroconf.py @@ -32,7 +32,7 @@ def setup(hass, config): ZEROCONF_TYPE) params = {"version": __version__, "base_url": hass.config.api.base_url, - "needs_auth": (hass.config.api.api_password != "")} + "needs_auth": (hass.config.api.api_password is not None)} info = ServiceInfo(ZEROCONF_TYPE, zeroconf_name, socket.inet_aton(hass.config.api.host), @@ -43,6 +43,7 @@ def setup(hass, config): def stop_zeroconf(event): """Stop Zeroconf.""" zeroconf.unregister_service(info) + zeroconf.close() hass.bus.listen_once(EVENT_HOMEASSISTANT_STOP, stop_zeroconf)