Skip to content

Commit 9c66e4f

Browse files
committed
Form encode on login.cgi
1 parent d86d348 commit 9c66e4f

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.5] - 2025-10-05
6+
7+
### Changed
8+
9+
- Change login from json_data to form_data for v6 login
10+
511
## [0.5.4] - 2025-10-01
612

713
### Added

airos/base.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -268,16 +268,20 @@ async def login(self) -> None:
268268
"POST", self._login_urls["default"], json_data=payload
269269
)
270270
except AirOSUrlNotFoundError:
271-
try:
272-
await self._request_json(
273-
"POST", self._login_urls["v6_alternative"], json_data=payload
274-
)
275-
except AirOSConnectionSetupError as err:
276-
raise AirOSConnectionSetupError(
277-
"Failed to login to default and alternate AirOS device urls"
278-
) from err
271+
pass # Try next URL
279272
except AirOSConnectionSetupError as err:
280273
raise AirOSConnectionSetupError("Failed to login to AirOS device") from err
274+
else:
275+
return
276+
277+
try: # Alternative URL
278+
await self._request_json(
279+
"POST", self._login_urls["v6_alternative"], form_data=payload
280+
)
281+
except AirOSConnectionSetupError as err:
282+
raise AirOSConnectionSetupError(
283+
"Failed to login to default and alternate AirOS device urls"
284+
) from err
281285

282286
async def status(self) -> AirOSDataModel:
283287
"""Retrieve status from the device."""

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.5.4"
7+
version = "0.5.5"
88
license = "MIT"
99
description = "Ubiquiti airOS module(s) for Python 3."
1010
readme = "README.md"

0 commit comments

Comments
 (0)