diff --git a/homeassistant/components/velux/__init__.py b/homeassistant/components/velux/__init__.py index 5c1d8bfd37060a..9c53fd4ef26a3d 100644 --- a/homeassistant/components/velux/__init__.py +++ b/homeassistant/components/velux/__init__.py @@ -4,7 +4,7 @@ from pyvlx import PyVLX, PyVLXException import voluptuous as vol -from homeassistant.const import CONF_HOST, CONF_PASSWORD, EVENT_HOMEASSISTANT_STOP +from homeassistant.const import CONF_HOST, CONF_PASSWORD from homeassistant.helpers import discovery import homeassistant.helpers.config_validation as cv @@ -53,15 +53,9 @@ def __init__(self, hass, domain_config): def setup(self): """Velux component setup.""" - async def on_hass_stop(event): - """Close connection when hass stops.""" - _LOGGER.debug("Velux interface terminated") - await self.pyvlx.disconnect() - async def async_reboot_gateway(service_call): await self.pyvlx.reboot_gateway() - self._hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop) host = self._domain_config.get(CONF_HOST) password = self._domain_config.get(CONF_PASSWORD) self.pyvlx = PyVLX(host=host, password=password)