update hangups to 0.4.6 and fix Issue #16593 hangouts reconnects. (#17518)

This commit is contained in:
Marcel Hoppe 2018-10-16 20:09:34 +02:00 committed by Paulus Schoutsen
parent 6e4a99cec0
commit 91dc0c3731
4 changed files with 11 additions and 8 deletions

View File

@ -27,7 +27,7 @@ from .const import (
# We need an import from .config_flow, without it .config_flow is never loaded.
from .config_flow import HangoutsFlowHandler # noqa: F401
REQUIREMENTS = ['hangups==0.4.5']
REQUIREMENTS = ['hangups==0.4.6']
_LOGGER = logging.getLogger(__name__)

View File

@ -191,16 +191,19 @@ class HangoutsBot:
self._connected = True
dispatcher.async_dispatcher_send(self.hass, EVENT_HANGOUTS_CONNECTED)
def _on_disconnect(self):
async def _on_disconnect(self):
"""Handle disconnecting."""
_LOGGER.debug('Connection lost!')
self._connected = False
dispatcher.async_dispatcher_send(self.hass,
EVENT_HANGOUTS_DISCONNECTED)
if self._connected:
_LOGGER.debug('Connection lost! Reconnect...')
await self.async_connect()
else:
dispatcher.async_dispatcher_send(self.hass,
EVENT_HANGOUTS_DISCONNECTED)
async def async_disconnect(self):
"""Disconnect the client if it is connected."""
if self._connected:
self._connected = False
await self._client.disconnect()
async def async_handle_hass_stop(self, _):

View File

@ -434,7 +434,7 @@ ha-philipsjs==0.0.5
habitipy==0.2.0
# homeassistant.components.hangouts
hangups==0.4.5
hangups==0.4.6
# homeassistant.components.mqtt.server
hbmqtt==0.9.4

View File

@ -78,7 +78,7 @@ georss_client==0.3
ha-ffmpeg==1.9
# homeassistant.components.hangouts
hangups==0.4.5
hangups==0.4.6
# homeassistant.components.mqtt.server
hbmqtt==0.9.4