diff --git a/airos/data.py b/airos/data.py index dab8c5d..0dc69a5 100644 --- a/airos/data.py +++ b/airos/data.py @@ -208,6 +208,14 @@ class GPSData: fix: int +@dataclass +class UnmsStatus: + """Leaf definition.""" + + status: int + timestamp: str | None = None + + @dataclass class Remote: """Leaf definition.""" @@ -248,7 +256,7 @@ class Remote: ip6addr: list[str] gps: GPSData oob: bool - unms: dict[str, Any] + unms: UnmsStatus airview: int service: ServiceTime @@ -259,9 +267,23 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]: return d +@dataclass +class Disconnected: + """Leaf definition for disconnected devices.""" + + mac: str + lastip: str + signal: int + hostname: str + platform: str + reason_code: int + disconnect_duration: int + airos_connected: bool = False # Mock add to determine Disconnected vs Station + + @dataclass class Station: - """Leaf definition.""" + """Leaf definition for connected/active devices.""" mac: str lastip: str @@ -295,6 +317,7 @@ class Station: airmax: Airmax last_disc: int remote: Remote + airos_connected: bool = True # Mock add to determine Disconnected vs Station @dataclass @@ -334,7 +357,7 @@ class Wireless: polling: Polling count: int sta: list[Station] - sta_disconnected: list[Any] + sta_disconnected: list[Disconnected] @classmethod def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]: @@ -395,13 +418,6 @@ class NtpClient: pass -@dataclass -class UnmsStatus: - """Leaf definition.""" - - status: int - - @dataclass class GPSMain: """Leaf definition.""" diff --git a/pyproject.toml b/pyproject.toml index 4dbd227..e8b92d1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "airos" -version = "0.1.7" +version = "0.1.8" license = "MIT" description = "Ubiquity airOS module(s) for Python 3." readme = "README.md"