From f2c5c249d29e54121fa3e8e79d4ccceb712c7933 Mon Sep 17 00:00:00 2001 From: Dan Cinnamon Date: Thu, 3 Oct 2019 19:15:52 -0500 Subject: [PATCH] Envisalink startup reconnect (#27063) * Added retry capability to the component initialization. * Removed extra chars * Black formatting. * Removed issue with block upon setup. Now setup will only fail if auth failed to the device. --- homeassistant/components/envisalink/__init__.py | 7 +++++-- homeassistant/components/envisalink/manifest.json | 2 +- requirements_all.txt | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/envisalink/__init__.py b/homeassistant/components/envisalink/__init__.py index 76d6a7e369c..6cdedf89744 100644 --- a/homeassistant/components/envisalink/__init__.py +++ b/homeassistant/components/envisalink/__init__.py @@ -141,9 +141,12 @@ async def async_setup(hass, config): @callback def connection_fail_callback(data): """Network failure callback.""" - _LOGGER.error("Could not establish a connection with the Envisalink") + _LOGGER.error( + "Could not establish a connection with the Envisalink- retrying..." + ) if not sync_connect.done(): - sync_connect.set_result(False) + hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_envisalink) + sync_connect.set_result(True) @callback def connection_success_callback(data): diff --git a/homeassistant/components/envisalink/manifest.json b/homeassistant/components/envisalink/manifest.json index 6c5405c75ea..3cee270f099 100644 --- a/homeassistant/components/envisalink/manifest.json +++ b/homeassistant/components/envisalink/manifest.json @@ -3,7 +3,7 @@ "name": "Envisalink", "documentation": "https://www.home-assistant.io/integrations/envisalink", "requirements": [ - "pyenvisalink==3.8" + "pyenvisalink==4.0" ], "dependencies": [], "codeowners": [] diff --git a/requirements_all.txt b/requirements_all.txt index dcb114c1896..208eeac899b 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1168,7 +1168,7 @@ pyeight==0.1.1 pyemby==1.6 # homeassistant.components.envisalink -pyenvisalink==3.8 +pyenvisalink==4.0 # homeassistant.components.ephember pyephember==0.2.0