Skip to content

Commit 68ea0bf

Browse files
committed
Add back reboot button
1 parent 8c38230 commit 68ea0bf

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
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.6.4] - 2026-02-13
6+
7+
### Added
8+
9+
- Re-added reboot functionality
10+
511
## [0.6.3] - 2026-01-25
612

713
### Changed

airos/base.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(
7878
# Mostly 8.x API endpoints, login/status are the same in 6.x
7979
self._login_url = f"{self.base_url}/api/auth"
8080
self._status_cgi_url = f"{self.base_url}/status.cgi"
81+
self._reboot_cgi_url = f"{self.base_url}/reboot.cgi"
8182

8283
# Presumed 6.x XM only endpoint
8384
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:
448449
)
449450
return True
450451

452+
async def reboot(self) -> bool:
453+
"""Reboot/restart device."""
454+
payload = {"reboot": "yes"}
455+
456+
result = await self._request_json(
457+
"POST",
458+
self._reboot_cgi_url,
459+
form_data=payload,
460+
ct_form=True,
461+
authenticated=True,
462+
)
463+
464+
if result.get("ok") == "true":
465+
return True
466+
return False
467+
451468
async def provmode(self, active: bool = False) -> bool:
452469
"""Set provisioning mode."""
453470
action = "stop"

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

0 commit comments

Comments
 (0)