Skip to content

Commit cc87045

Browse files
committed
Fix ruff upgrade
1 parent 9b23494 commit cc87045

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ default_language_version:
55
repos:
66
# Run manually in CI skipping the branch checks
77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: v0.14.14
8+
rev: v0.15.2
99
hooks:
1010
- id: ruff
1111
name: "Ruff check"

airos/base.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,8 @@ def __init__(
5858
self.api_version: int = 8
5959

6060
parsed_host = urlparse(host)
61-
scheme = (
62-
parsed_host.scheme
63-
if parsed_host.scheme
64-
else ("https" if use_ssl else "http")
65-
)
66-
hostname = parsed_host.hostname if parsed_host.hostname else host
61+
scheme = parsed_host.scheme or ("https" if use_ssl else "http")
62+
hostname = parsed_host.hostname or host
6763

6864
self.base_url = f"{scheme}://{hostname}"
6965

@@ -309,7 +305,7 @@ async def _request_json(
309305
)
310306
if err.status in [401, 403]:
311307
raise AirOSConnectionAuthenticationError from err
312-
if err.status in [404]:
308+
if err.status == 404:
313309
raise AirOSUrlNotFoundError from err
314310
raise AirOSConnectionSetupError from err
315311
except (TimeoutError, aiohttp.ClientError) as err:

0 commit comments

Comments
 (0)