diff --git a/sense_energy/asyncsenseable.py b/sense_energy/asyncsenseable.py index c0bc6eb..279051f 100644 --- a/sense_energy/asyncsenseable.py +++ b/sense_energy/asyncsenseable.py @@ -18,6 +18,7 @@ async def authenticate(self, username, password): try: async with aiohttp.ClientSession() as session: async with session.post(API_URL+'authenticate', + timeout=self.api_timeout, data=auth_data) as resp: # check for 200 return @@ -29,7 +30,7 @@ async def authenticate(self, username, password): # Build out some common variables self.set_auth_data(await resp.json()) except Exception as e: - raise Exception('Connection failure: %s' % e) + raise SenseAPITimeoutException('Connection failure: %s' % e) # Update the realtime data for asyncio async def update_realtime(self):