Skip to content

Commit a94693b

Browse files
committed
Explicit timeout and version bump
1 parent 5ad1754 commit a94693b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

airos/airos8.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@ async def login(self) -> bool:
186186
log = f"Login failed with status {response.status}. Full Response: {response.text}"
187187
_LOGGER.error(log)
188188
raise AirOSConnectionAuthenticationError from None
189-
except (TimeoutError, aiohttp.ClientError) as err:
190-
_LOGGER.exception("Error during login")
191-
raise AirOSDeviceConnectionError from err
192189
except asyncio.CancelledError:
193190
_LOGGER.info("Login task was cancelled")
194191
raise
192+
except (TimeoutError, aiohttp.ClientError) as err:
193+
_LOGGER.exception("Error during login")
194+
raise AirOSDeviceConnectionError from err
195195

196196
def derived_data(
197197
self, response: dict[str, Any] | None = None
@@ -302,12 +302,12 @@ async def status(self) -> AirOSData:
302302
response_text,
303303
)
304304
raise AirOSDeviceConnectionError
305-
except (TimeoutError, aiohttp.ClientError) as err:
306-
_LOGGER.exception("Status API call failed: %s", err)
307-
raise AirOSDeviceConnectionError from err
308305
except asyncio.CancelledError:
309306
_LOGGER.info("API status retrieval task was cancelled")
310307
raise
308+
except (TimeoutError, aiohttp.ClientError) as err:
309+
_LOGGER.exception("Status API call failed: %s", err)
310+
raise AirOSDeviceConnectionError from err
311311

312312
async def stakick(self, mac_address: str = None) -> bool:
313313
"""Reconnect client station."""
@@ -340,12 +340,12 @@ async def stakick(self, mac_address: str = None) -> bool:
340340
log = f"Unable to restart connection response status {response.status} with {response_text}"
341341
_LOGGER.error(log)
342342
return False
343-
except (TimeoutError, aiohttp.ClientError) as err:
344-
_LOGGER.exception("Error during call to reconnect remote: %s", err)
345-
raise AirOSDeviceConnectionError from err
346343
except asyncio.CancelledError:
347344
_LOGGER.info("Reconnect task was cancelled")
348345
raise
346+
except (TimeoutError, aiohttp.ClientError) as err:
347+
_LOGGER.exception("Error during call to reconnect remote: %s", err)
348+
raise AirOSDeviceConnectionError from err
349349

350350
async def provmode(self, active: bool = False) -> bool:
351351
"""Set provisioning mode."""
@@ -379,9 +379,9 @@ async def provmode(self, active: bool = False) -> bool:
379379
log = f"Unable to change provisioning mode response status {response.status} with {response_text}"
380380
_LOGGER.error(log)
381381
return False
382-
except (TimeoutError, aiohttp.ClientError) as err:
383-
_LOGGER.exception("Error during call to change provisioning mode: %s", err)
384-
raise AirOSDeviceConnectionError from err
385382
except asyncio.CancelledError:
386383
_LOGGER.info("Provisioning mode change task was cancelled")
387384
raise
385+
except (TimeoutError, aiohttp.ClientError) as err:
386+
_LOGGER.exception("Error during call to change provisioning mode: %s", err)
387+
raise AirOSDeviceConnectionError from err

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "airos"
7-
version = "0.2.8a0"
7+
version = "0.2.8a3"
88
license = "MIT"
99
description = "Ubiquity airOS module(s) for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)