Skip to content

Commit 28b4456

Browse files
committed
Add IEEE Auto mode (and less warnings)
1 parent e401a03 commit 28b4456

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

airos/airos8.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(
5252
self._status_cgi_url = f"{self.base_url}/status.cgi" # AirOS 8
5353
self._stakick_cgi_url = f"{self.base_url}/stakick.cgi" # AirOS 8
5454
self.current_csrf_token = None
55+
self.warnings_cache = []
5556

5657
self._use_json_for_login_post = False
5758

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

216-
# Show new enums detected
217+
# Show new enums detected, once after (each) startup
217218
if airos_data.warnings:
218219
for field_name, messages in airos_data.warnings.items():
219220
for msg in messages:
220221
log = f"AirOS data warning for field '{field_name}': {msg}"
221-
logger.warning(log)
222+
if log not in self.warnings_cache:
223+
self.warnings_cache.append(log)
224+
logger.warning(log)
222225

223226
return airos_data
224227
except json.JSONDecodeError:

airos/airos8data.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
class IeeeMode(Enum):
1111
"""Enum definition."""
1212

13+
AUTO = "AUTO"
1314
_11ACVHT80 = "11ACVHT80"
1415
# More to be added when known
1516

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

426427
def add_warning(self, field_name: str, message: str):

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

0 commit comments

Comments
 (0)