Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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).
Expand Down
16 changes: 16 additions & 0 deletions airos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading