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/README.md b/README.md index 0947c27..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. +- 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). diff --git a/airos/base.py b/airos/base.py index 6146fb2..53800d3 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,21 @@ 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, + ) + + 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.""" 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"