- replaced timeout with constant

This commit is contained in:
Jack Simbach 2021-01-10 22:10:23 -05:00
parent 365de0bc06
commit 30b30ae411
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ class GeKitchenUpdateCoordinator(DataUpdateCoordinator):
raise HaCannotConnect('Unknown connection failure') raise HaCannotConnect('Unknown connection failure')
try: try:
with async_timeout.timeout(30): with async_timeout.timeout(ASYNC_TIMEOUT):
await self.initialization_future await self.initialization_future
except TimeoutError: except TimeoutError:
raise HaCannotConnect('Initialization timed out') raise HaCannotConnect('Initialization timed out')
@ -202,7 +202,7 @@ class GeKitchenUpdateCoordinator(DataUpdateCoordinator):
"""Kill the client. Leaving this in for testing purposes.""" """Kill the client. Leaving this in for testing purposes."""
await asyncio.sleep(30) await asyncio.sleep(30)
_LOGGER.critical('Killing the connection. Popcorn time.') _LOGGER.critical('Killing the connection. Popcorn time.')
await self.client.websocket.close() await self.client.disconnect()
@callback @callback
def reconnect(self, log=False) -> None: def reconnect(self, log=False) -> None: