Skip to content

Commit 85bddd3

Browse files
committed
Send as form, not just form_encoded
1 parent 265a842 commit 85bddd3

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
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.7] - 2025-10-13
6+
7+
### Changed
8+
9+
- Modified login for v6
10+
511
## [0.5.6] - 2025-10-11
612

713
### Added

airos/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async def _request_json(
227227
url: str,
228228
headers: dict[str, Any] | None = None,
229229
json_data: dict[str, Any] | None = None,
230-
form_data: dict[str, Any] | None = None,
230+
form_data: dict[str, Any] | aiohttp.FormData | None = None,
231231
authenticated: bool = False,
232232
ct_json: bool = False,
233233
ct_form: bool = False,
@@ -298,11 +298,14 @@ async def login(self) -> None:
298298
return
299299

300300
try: # Alternative URL
301+
formdata = aiohttp.FormData()
302+
formdata.add_field("uri", "/")
303+
formdata.add_field("username", self.username)
304+
formdata.add_field("password", self.password)
301305
await self._request_json(
302306
"POST",
303307
self._login_urls["v6_alternative"],
304-
form_data=payload,
305-
ct_form=True,
308+
form_data=formdata,
306309
)
307310
except AirOSConnectionSetupError as err:
308311
raise AirOSConnectionSetupError(

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

0 commit comments

Comments
 (0)