Skip to content

Commit c705360

Browse files
committed
Add back rx/tx
1 parent ab562b6 commit c705360

File tree

6 files changed

+30
-9
lines changed

6 files changed

+30
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
99
- Support for v6 firmware XM models using a different login path (XW already was successful)
1010
- Calculated cpuload on v6 if values available (to prevent reporting close to 100%)
1111
- Fix frequency on v6 firmware (if value is cast as a string ending in MHz)
12+
- Added tx/rx rates for v6
1213

1314
## [0.5.6] - 2025-10-11
1415

airos/data.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ class Wireless6(AirOSDataClass):
583583
ack: int
584584
distance: int # In meters
585585
ccq: int
586-
txrate: str
587-
rxrate: str
586+
txrate: int
587+
rxrate: int
588588
security: Security
589589
qos: str
590590
rstatus: int
@@ -593,6 +593,7 @@ class Wireless6(AirOSDataClass):
593593
wds: int
594594
aprepeater: int # Not bool as v8
595595
chanbw: int
596+
throughput: Throughput
596597
mode: Wireless6Mode | None = None
597598

598599
@classmethod
@@ -607,6 +608,13 @@ def __pre_deserialize__(cls, d: dict[str, Any]) -> dict[str, Any]:
607608
if isinstance(freq, str) and "MHz" in freq:
608609
d["frequency"] = int(freq.split()[0])
609610

611+
rxrate = d.get("rxrate")
612+
txrate = d.get("txrate")
613+
d["throughput"] = {
614+
"rx": int(float(rxrate)) if rxrate else 0,
615+
"tx": int(float(txrate)) if txrate else 0,
616+
}
617+
610618
return d
611619

612620

fixtures/airos_NanoStation_M5_sta_v6.3.16.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,15 @@
151151
"qos": "No QoS",
152152
"rssi": 32,
153153
"rstatus": 5,
154-
"rxrate": "216",
154+
"rxrate": 216,
155155
"security": "WPA2",
156156
"signal": -64,
157+
"throughput": {
158+
"rx": 216,
159+
"tx": 270
160+
},
157161
"txpower": 24,
158-
"txrate": "270",
162+
"txrate": 270,
159163
"wds": 1
160164
}
161165
}

fixtures/airos_NanoStation_loco_M5_v6.3.16_XM_ap.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,15 @@
137137
"qos": "No QoS",
138138
"rssi": 51,
139139
"rstatus": 5,
140-
"rxrate": "300",
140+
"rxrate": 300,
141141
"security": "WPA2",
142142
"signal": -45,
143+
"throughput": {
144+
"rx": 300,
145+
"tx": 270
146+
},
143147
"txpower": 2,
144-
"txrate": "270",
148+
"txrate": 270,
145149
"wds": 1
146150
}
147151
}

fixtures/airos_NanoStation_loco_M5_v6.3.16_XM_sta.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,15 @@
137137
"qos": "No QoS",
138138
"rssi": 50,
139139
"rstatus": 5,
140-
"rxrate": "180",
140+
"rxrate": 180,
141141
"security": "WPA2",
142142
"signal": -46,
143+
"throughput": {
144+
"rx": 180,
145+
"tx": 243
146+
},
143147
"txpower": 2,
144-
"txrate": "243",
148+
"txrate": 243,
145149
"wds": 1
146150
}
147151
}

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

0 commit comments

Comments
 (0)