1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

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 Fabian Affolter
parent aa176312a5
commit 6b3e4ca7bd
4 changed files with 11 additions and 8 deletions

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, _):