Skip to content
Merged
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
7 changes: 5 additions & 2 deletions airos/airos8.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(
self._status_cgi_url = f"{self.base_url}/status.cgi" # AirOS 8
self._stakick_cgi_url = f"{self.base_url}/stakick.cgi" # AirOS 8
self.current_csrf_token = None
self.warnings_cache = []

self._use_json_for_login_post = False

Expand Down Expand Up @@ -213,12 +214,14 @@ async def status(self) -> AirOSData:
logger.exception("Failed to deserialize AirOS data")
raise KeyDataMissingError from err

# Show new enums detected
# Show new enums detected, once after (each) startup
if airos_data.warnings:
for field_name, messages in airos_data.warnings.items():
for msg in messages:
log = f"AirOS data warning for field '{field_name}': {msg}"
logger.warning(log)
if log not in self.warnings_cache:
self.warnings_cache.append(log)
logger.warning(log)

return airos_data
except json.JSONDecodeError:
Expand Down
3 changes: 2 additions & 1 deletion airos/airos8data.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class IeeeMode(Enum):
"""Enum definition."""

AUTO = "AUTO"
_11ACVHT80 = "11ACVHT80"
# More to be added when known

Expand Down Expand Up @@ -420,7 +421,7 @@ def check_for_warnings(self):
if hasattr(station.remote, "mode") and isinstance(station.remote.mode, str):
self.add_warning(
f"wireless.sta[{i}].remote",
f"Unknown (new) remote mode: '{station.remote.mode}'",
f"Unknown (new) remote mode: '{station.remote.mode}', please report to the CODEOWNERS for inclusion",
)

def add_warning(self, field_name: str, message: str):
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.1.3"
version = "0.1.4"
license = "MIT"
description = "Ubiquity airOS module(s) for Python 3."
readme = "README.md"
Expand Down