mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Fix envisalink reconnect (#15832)
* Fix logic for handling connection lost/reconnect * Fixed line length issue.
This commit is contained in:
parent
479dfd1710
commit
ccef9a3e43
@ -16,7 +16,7 @@ from homeassistant.helpers.entity import Entity
|
|||||||
from homeassistant.helpers.discovery import async_load_platform
|
from homeassistant.helpers.discovery import async_load_platform
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
|
|
||||||
REQUIREMENTS = ['pyenvisalink==2.2']
|
REQUIREMENTS = ['pyenvisalink==2.3']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -111,20 +111,24 @@ def async_setup(hass, config):
|
|||||||
def login_fail_callback(data):
|
def login_fail_callback(data):
|
||||||
"""Handle when the evl rejects our login."""
|
"""Handle when the evl rejects our login."""
|
||||||
_LOGGER.error("The Envisalink rejected your credentials")
|
_LOGGER.error("The Envisalink rejected your credentials")
|
||||||
sync_connect.set_result(False)
|
if not sync_connect.done():
|
||||||
|
sync_connect.set_result(False)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def connection_fail_callback(data):
|
def connection_fail_callback(data):
|
||||||
"""Network failure callback."""
|
"""Network failure callback."""
|
||||||
_LOGGER.error("Could not establish a connection with the Envisalink")
|
_LOGGER.error("Could not establish a connection with the Envisalink")
|
||||||
sync_connect.set_result(False)
|
if not sync_connect.done():
|
||||||
|
sync_connect.set_result(False)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def connection_success_callback(data):
|
def connection_success_callback(data):
|
||||||
"""Handle a successful connection."""
|
"""Handle a successful connection."""
|
||||||
_LOGGER.info("Established a connection with the Envisalink")
|
_LOGGER.info("Established a connection with the Envisalink")
|
||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, stop_envisalink)
|
if not sync_connect.done():
|
||||||
sync_connect.set_result(True)
|
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP,
|
||||||
|
stop_envisalink)
|
||||||
|
sync_connect.set_result(True)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def zones_updated_callback(data):
|
def zones_updated_callback(data):
|
||||||
|
@ -817,7 +817,7 @@ pyeight==0.0.9
|
|||||||
pyemby==1.5
|
pyemby==1.5
|
||||||
|
|
||||||
# homeassistant.components.envisalink
|
# homeassistant.components.envisalink
|
||||||
pyenvisalink==2.2
|
pyenvisalink==2.3
|
||||||
|
|
||||||
# homeassistant.components.climate.ephember
|
# homeassistant.components.climate.ephember
|
||||||
pyephember==0.1.1
|
pyephember==0.1.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user