mirror of
https://github.com/home-assistant/core.git
synced 2025-12-25 05:26:47 +00:00
This commit is contained in:
committed by
Fabian Affolter
parent
aa176312a5
commit
6b3e4ca7bd
@@ -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, _):
|
||||
|
||||
Reference in New Issue
Block a user