From 68ea0bf8d57c3250e6cfd96d72bc72916ae184ee Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Fri, 13 Feb 2026 14:40:02 +0100 Subject: [PATCH 1/4] Add back reboot button --- CHANGELOG.md | 6 ++++++ airos/base.py | 17 +++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a3b773..e680bef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. +## [0.6.4] - 2026-02-13 + +### Added + +- Re-added reboot functionality + ## [0.6.3] - 2026-01-25 ### Changed diff --git a/airos/base.py b/airos/base.py index 6146fb2..b4bc2a8 100644 --- a/airos/base.py +++ b/airos/base.py @@ -78,6 +78,7 @@ def __init__( # Mostly 8.x API endpoints, login/status are the same in 6.x self._login_url = f"{self.base_url}/api/auth" self._status_cgi_url = f"{self.base_url}/status.cgi" + self._reboot_cgi_url = f"{self.base_url}/reboot.cgi" # Presumed 6.x XM only endpoint self._v6_xm_login_url = f"{self.base_url}/login.cgi" @@ -448,6 +449,22 @@ async def stakick(self, mac_address: str | None = None) -> bool: ) return True + async def reboot(self) -> bool: + """Reboot/restart device.""" + payload = {"reboot": "yes"} + + result = await self._request_json( + "POST", + self._reboot_cgi_url, + form_data=payload, + ct_form=True, + authenticated=True, + ) + + if result.get("ok") == "true": + return True + return False + async def provmode(self, active: bool = False) -> bool: """Set provisioning mode.""" action = "stop" diff --git a/pyproject.toml b/pyproject.toml index 1996629..9906926 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "airos" -version = "0.6.3" +version = "0.6.4" license = "MIT" description = "Ubiquiti airOS module(s) for Python 3." readme = "README.md" From a9bb8a71b8280d57eb1bd8e7bca70833767a2047 Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Fri, 13 Feb 2026 14:46:07 +0100 Subject: [PATCH 2/4] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0947c27..8c9dcf3 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ More details on the integration can be found on the [Ubiquiti UISP airOS](https: - Wireless mode and signal strength. - Connected stations and their statistics. - System information and uptime. -- Device Control: Provides methods to perform actions, such as reconnecting/kicking a connected wireless station. +- Device Control: Provides methods to perform actions, such as reconnecting/kicking a connected wireless station and rebooting the device itself.. - Discovery of airOS devices on your local network (by listening to announcements these devices broadcast). ## Installation @@ -142,6 +142,7 @@ Note: For firmware 6 we only support the login and status calls currently. - `warnings()`: Retrieves warning status dict. - `stakick(mac_address: str)`: Disconnects a specific station by its MAC address. + - `reboot()`: Reboots the device. - `provmode(active: bool = False)`: Enables or disables the provisioning mode. - `update_check(force: bool = False)`: Checks if new firmware has been discovered (or force to force check). From 66ff8ece8c95e213b9f159828f66a60c2d357a45 Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Fri, 13 Feb 2026 14:49:16 +0100 Subject: [PATCH 3/4] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8c9dcf3..8213392 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ More details on the integration can be found on the [Ubiquiti UISP airOS](https: - Wireless mode and signal strength. - Connected stations and their statistics. - System information and uptime. -- Device Control: Provides methods to perform actions, such as reconnecting/kicking a connected wireless station and rebooting the device itself.. +- Device Control: Provides methods to perform actions, such as reconnecting/kicking a connected wireless station and rebooting the device itself. - Discovery of airOS devices on your local network (by listening to announcements these devices broadcast). ## Installation From 56b6bb1e88ab96612fd5844c4f3314f1d25d749e Mon Sep 17 00:00:00 2001 From: Tom Scholten Date: Fri, 13 Feb 2026 14:54:07 +0100 Subject: [PATCH 4/4] Already parsed JSON --- airos/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/airos/base.py b/airos/base.py index b4bc2a8..53800d3 100644 --- a/airos/base.py +++ b/airos/base.py @@ -461,9 +461,8 @@ async def reboot(self) -> bool: authenticated=True, ) - if result.get("ok") == "true": - return True - return False + ok_value = result.get("ok") + return ok_value is True or ok_value == "true" async def provmode(self, active: bool = False) -> bool: """Set provisioning mode."""