Skip to content

Commit a933cdf

Browse files
committed
Move throughput to capacity for v6
1 parent 2e56fc8 commit a933cdf

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

airos/data.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,14 @@ class Polling(AirOSDataClass):
334334
flex_mode: int | None = None # Not present in all devices
335335

336336

337+
@dataclass
338+
class Polling6(AirOSDataClass):
339+
"""Leaf definition."""
340+
341+
dl_capacity: int | None = None # New
342+
ul_capacity: int | None = None # New
343+
344+
337345
@dataclass
338346
class Stats(AirOSDataClass):
339347
"""Leaf definition."""
@@ -600,7 +608,7 @@ class Wireless6(AirOSDataClass):
600608
wds: int
601609
aprepeater: int # Not bool as v8
602610
chanbw: int
603-
throughput: Throughput
611+
polling: Polling6
604612
ieeemode: IeeeMode # Virtual to match base/v8
605613
mode: Wireless6Mode | None = None
606614
antenna_gain: int | None = None # Virtual to match base/v8
@@ -619,9 +627,9 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
619627

620628
rxrate = d.get("rxrate")
621629
txrate = d.get("txrate")
622-
d["throughput"] = {
623-
"rx": int(float(rxrate)) if rxrate else 0,
624-
"tx": int(float(txrate)) if txrate else 0,
630+
d["polling"] = { # Map to Polling6 as MBPS strings to int kbps
631+
"dl_capacity": int(float(rxrate) * 1000) if rxrate else 0,
632+
"ul_capacity": int(float(txrate) * 1000) if txrate else 0,
625633
}
626634

627635
d["ieeemode"] = d["opmode"].upper() or None

fixtures/airos_NanoStation_M5_sta_v6.3.16.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,16 +151,16 @@
151151
"noisef": -99,
152152
"nol_chans": 0,
153153
"opmode": "11NAHT40PLUS",
154+
"polling": {
155+
"dl_capacity": 216000,
156+
"ul_capacity": 270000
157+
},
154158
"qos": "No QoS",
155159
"rssi": 32,
156160
"rstatus": 5,
157161
"rxrate": "216",
158162
"security": "WPA2",
159163
"signal": -64,
160-
"throughput": {
161-
"rx": 216,
162-
"tx": 270
163-
},
164164
"txpower": 24,
165165
"txrate": "270",
166166
"wds": 1

fixtures/airos_NanoStation_loco_M5_v6.3.16_XM_ap.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@
137137
"noisef": -91,
138138
"nol_chans": 0,
139139
"opmode": "11naht40minus",
140+
"polling": {
141+
"dl_capacity": 300000,
142+
"ul_capacity": 270000
143+
},
140144
"qos": "No QoS",
141145
"rssi": 51,
142146
"rstatus": 5,
143147
"rxrate": "300",
144148
"security": "WPA2",
145149
"signal": -45,
146-
"throughput": {
147-
"rx": 300,
148-
"tx": 270
149-
},
150150
"txpower": 2,
151151
"txrate": "270",
152152
"wds": 1

fixtures/airos_NanoStation_loco_M5_v6.3.16_XM_sta.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@
137137
"noisef": -89,
138138
"nol_chans": 0,
139139
"opmode": "11naht40minus",
140+
"polling": {
141+
"dl_capacity": 180000,
142+
"ul_capacity": 243000
143+
},
140144
"qos": "No QoS",
141145
"rssi": 50,
142146
"rstatus": 5,
143147
"rxrate": "180",
144148
"security": "WPA2",
145149
"signal": -46,
146-
"throughput": {
147-
"rx": 180,
148-
"tx": 243
149-
},
150150
"txpower": 2,
151151
"txrate": "243",
152152
"wds": 1

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

0 commit comments

Comments
 (0)