Skip to content

Commit 95aeee5

Browse files
committed
Add unms status and sta_disconnected
1 parent 7b56894 commit 95aeee5

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

airos/data.py

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ class GPSData:
208208
fix: int
209209

210210

211+
@dataclass
212+
class UnmsStatus:
213+
"""Leaf definition."""
214+
215+
status: int
216+
timestamp: str
217+
218+
211219
@dataclass
212220
class Remote:
213221
"""Leaf definition."""
@@ -248,7 +256,7 @@ class Remote:
248256
ip6addr: list[str]
249257
gps: GPSData
250258
oob: bool
251-
unms: dict[str, Any]
259+
unms: UnmsStatus
252260
airview: int
253261
service: ServiceTime
254262

@@ -259,9 +267,23 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
259267
return d
260268

261269

270+
@dataclass
271+
class Disconnected:
272+
"""Leaf definition for disconnected devices."""
273+
274+
mac: str
275+
lastip: str
276+
signal: int
277+
hostname: str
278+
platform: str
279+
reason_code: int
280+
disconnect_duration: int
281+
airos_connected: bool = False # Mock add to determine Disconnected vs Station
282+
283+
262284
@dataclass
263285
class Station:
264-
"""Leaf definition."""
286+
"""Leaf definition for connected/active devices."""
265287

266288
mac: str
267289
lastip: str
@@ -295,6 +317,7 @@ class Station:
295317
airmax: Airmax
296318
last_disc: int
297319
remote: Remote
320+
airos_connected: bool = True # Mock add to determine Disconnected vs Station
298321

299322

300323
@dataclass
@@ -334,7 +357,7 @@ class Wireless:
334357
polling: Polling
335358
count: int
336359
sta: list[Station]
337-
sta_disconnected: list[Any]
360+
sta_disconnected: list[Disconnected]
338361

339362
@classmethod
340363
def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
@@ -395,13 +418,6 @@ class NtpClient:
395418
pass
396419

397420

398-
@dataclass
399-
class UnmsStatus:
400-
"""Leaf definition."""
401-
402-
status: int
403-
404-
405421
@dataclass
406422
class GPSMain:
407423
"""Leaf definition."""

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

0 commit comments

Comments
 (0)