From 9505c8d1fdd84a9bd513cbf7b3b65b6cdc988744 Mon Sep 17 00:00:00 2001 From: Paul Daumlechner Date: Fri, 5 Mar 2021 17:23:53 +0000 Subject: [PATCH 1/2] Remove disconnection on HA stop event --- homeassistant/components/velux/__init__.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/homeassistant/components/velux/__init__.py b/homeassistant/components/velux/__init__.py index 5c1d8bfd37060a..a7a87909aee909 100644 --- a/homeassistant/components/velux/__init__.py +++ b/homeassistant/components/velux/__init__.py @@ -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) From 94768de251954215dfda2ee6db073af103bb83d2 Mon Sep 17 00:00:00 2001 From: Paul Daumlechner Date: Fri, 5 Mar 2021 18:53:40 +0100 Subject: [PATCH 2/2] Remove unused import --- homeassistant/components/velux/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/velux/__init__.py b/homeassistant/components/velux/__init__.py index a7a87909aee909..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