diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 631979a..2d6bd83 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,7 +5,7 @@ default_language_version: repos: # Run manually in CI skipping the branch checks - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.2 hooks: - id: ruff name: "Ruff check" diff --git a/airos/base.py b/airos/base.py index 53800d3..2ee8c65 100644 --- a/airos/base.py +++ b/airos/base.py @@ -58,12 +58,8 @@ def __init__( self.api_version: int = 8 parsed_host = urlparse(host) - scheme = ( - parsed_host.scheme - if parsed_host.scheme - else ("https" if use_ssl else "http") - ) - hostname = parsed_host.hostname if parsed_host.hostname else host + scheme = parsed_host.scheme or ("https" if use_ssl else "http") + hostname = parsed_host.hostname or host self.base_url = f"{scheme}://{hostname}" @@ -309,7 +305,7 @@ async def _request_json( ) if err.status in [401, 403]: raise AirOSConnectionAuthenticationError from err - if err.status in [404]: + if err.status == 404: raise AirOSUrlNotFoundError from err raise AirOSConnectionSetupError from err except (TimeoutError, aiohttp.ClientError) as err: