Skip to content

Commit 0d60727

Browse files
authored
Merge pull request #69 from CoMPaTech/upd
## New Features Added firmware update workflow: check (with optional force), download, progress, and install. Added device warnings retrieval and provisioning-mode toggle. ## Documentation Expanded README with new API calls and example payloads for Update, Progress, Install, and Warnings. ## Tests Unified tests to use a single HTTP request path and adjusted mocks and response handling.
2 parents a41436e + d510d14 commit 0d60727

File tree

9 files changed

+393
-336
lines changed

9 files changed

+393
-336
lines changed

CHANGELOG.md

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

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

5+
## [0.4.0] - 2025-08-16
6+
7+
### Added
8+
9+
- Refactoring of the code (DRY-ing up)
10+
- Documentation on available class functions
11+
- Added the additional firmware update related functions
12+
513
## [0.3.0] - 2025-08-15
614

715
### Added

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,67 @@ if __name__ == "__main__":
121121
### Calls
122122

123123
- `airos.airos8`: initializes with `host: str, username: str, password: str, session: aiohttp.ClientSession`
124+
124125
- `login()`: Authenticates with the device.
125126
- `status()`: Fetches a comprehensive dictionary of the device's status and statistics.
127+
- `warnings()`: Retrieves warning status dict.
128+
126129
- `stakick(mac_address: str)`: Disconnects a specific station by its MAC address.
130+
- `provmode(active: bool = False)`: Enables or disables the provisioning mode.
131+
132+
- `update_check(force: bool = False)`: Checks if new firmware has been discovered (or force to force check).
133+
134+
- `download()`: Starts downloading (not installing) new firmware.
135+
- `progress()`: Fetches the firmware download (not install!) progress.
136+
- `install()`: Installs the new firmware.
137+
127138
- `airos.discovery`
128139
- `async_discover_devices(timeout: int)` mainly for consumption by HA's `config_flow` returning a dict mapping mac-addresses to discovered info.
129140

130-
More features and API calls are planned for future releases.
141+
#### Information
142+
143+
##### Update
144+
145+
Will return either ```{"update": False}``` or the full information regarding the available update:
146+
147+
```json
148+
{"checksum": "b1bea879a9f518f714ce638172e3a860", "version": "v8.7.19", "security": "", "date": "250811", "url": "https://dl.ubnt.com/firmwares/XC-fw/v8.7.19/WA.v8.7.19.48279.250811.0636.bin", "update": True, "changelog": "https://dl.ubnt.com/firmwares/XC-fw/v8.7.19/changelog.txt"}
149+
```
150+
151+
##### Progress
152+
153+
If no progress to report ```{"progress": -1}``` otherwise a positive value between 0 and 100.
154+
155+
##### Install
156+
157+
Only a positive outcome is expected from the user experience; the call should return:
158+
159+
```json
160+
{
161+
"ok": true,
162+
"code": 0
163+
}
164+
```
165+
166+
#### Warnings
167+
168+
Will respond with something like:
169+
170+
```json
171+
{
172+
"isDefaultPasswd": false,
173+
"customScripts": false,
174+
"isWatchdogReset": 0,
175+
"label": 0,
176+
"chAvailable": false,
177+
"emergReasonCode": -1,
178+
"firmware": {
179+
"isThirdParty": false,
180+
"version": "",
181+
"uploaded": false
182+
}
183+
}
184+
```
131185

132186
## Contributing
133187

airos/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"""Ubiquity AirOS python module."""
1+
"""Ubiquiti airOS."""

0 commit comments

Comments
 (0)