Skip to content

Commit 1cddc84

Browse files
committed
Add userdata/fixtures and improve helpers
1 parent 0f52445 commit 1cddc84

10 files changed

+553
-6
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.5.7] - 2025-10-20
6+
7+
### Added
8+
9+
- Support for v6 firmware XM models using a different login path (XW already was successful)
10+
511
## [0.5.6] - 2025-10-11
612

713
### Added

airos/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def _derived_data_helper(
135135
sku = UispAirOSProductMapper().get_sku_by_devmodel(devmodel)
136136
except KeyError:
137137
_LOGGER.warning(
138-
"Unknown SKU/Model ID for %s. Please report at "
138+
"Unknown SKU/Model ID for '%s'. Please report at "
139139
"https://github.com/CoMPaTech/python-airos/issues so we can add support.",
140140
devmodel,
141141
)

airos/model_map.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
from .exceptions import AirOSMultipleMatchesFoundException
44

5-
MODELS: dict[str, str] = {
6-
# Generated list from https://store.ui.com/us/en/category/wireless
5+
# Generated list from https://store.ui.com/us/en/category/wireless
6+
SITE_MODELS: dict[str, str] = {
77
"Wave MLO5": "Wave-MLO5",
88
"airMAX Rocket Prism 5AC": "RP-5AC-Gen2",
99
"airFiber 5XHD": "AF-5XHD",
@@ -76,10 +76,16 @@
7676
"airMAX 5 GHz, 19/20 dBi Sector": "AM-5G2",
7777
"airMAX 2.4 GHz, 10 dBi Omni": "AMO-2G10",
7878
"airMAX 2.4 GHz, 15 dBi, 120º Sector": "AM-2G15-120",
79-
# Manually added entries for common unofficial names
79+
}
80+
81+
# Manually added entries for common unofficial names
82+
MANUAL_MODELS: dict[str, str] = {
8083
"LiteAP GPS": "LAP-GPS", # Shortened name for airMAX Lite Access Point GPS
84+
"NanoStation loco M5": "LocoM5", # XM firmware version 6 - note the reversed names
8185
}
8286

87+
MODELS: dict[str, str] = {**SITE_MODELS, **MANUAL_MODELS}
88+
8389

8490
class UispAirOSProductMapper:
8591
"""Utility class to map product model names to SKUs and vice versa."""
@@ -90,6 +96,7 @@ def __init__(self) -> None:
9096

9197
def get_sku_by_devmodel(self, devmodel: str) -> str:
9298
"""Retrieves the SKU for a given device model name."""
99+
devmodel = devmodel.strip()
93100
if devmodel in MODELS:
94101
return MODELS[devmodel]
95102

fixtures/airos_NanoStation_M5_sta_v6.3.16.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ptmp": false,
1111
"ptp": true,
1212
"role": "station",
13-
"sku": "LocoM5",
13+
"sku": "NSM5",
1414
"station": true
1515
},
1616
"firewall": {
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"airview": {
3+
"enabled": 0
4+
},
5+
"derived": {
6+
"access_point": true,
7+
"mac": "XX:XX:XX:XX:XX:XX",
8+
"mac_interface": "br0",
9+
"mode": "point_to_point",
10+
"ptmp": false,
11+
"ptp": true,
12+
"role": "access_point",
13+
"sku": "LocoM5",
14+
"station": false
15+
},
16+
"firewall": {
17+
"eb6tables": false,
18+
"ebtables": true,
19+
"ip6tables": false,
20+
"iptables": false
21+
},
22+
"genuine": "/images/genuine.png",
23+
"host": {
24+
"cpuload": 100.0,
25+
"devmodel": "NanoStation loco M5 ",
26+
"freeram": 8429568,
27+
"fwprefix": "XM",
28+
"fwversion": "v6.3.16",
29+
"hostname": "NanoStation loco M5 AP",
30+
"netrole": "bridge",
31+
"totalram": 30220288,
32+
"uptime": 1953224
33+
},
34+
"interfaces": [
35+
{
36+
"enabled": true,
37+
"hwaddr": "00:00:00:00:00:00",
38+
"ifname": "lo",
39+
"mtu": null,
40+
"status": {
41+
"cable_len": null,
42+
"duplex": true,
43+
"ip6addr": null,
44+
"plugged": true,
45+
"snr": null,
46+
"speed": 0
47+
}
48+
},
49+
{
50+
"enabled": true,
51+
"hwaddr": "XX:XX:XX:XX:XX:XX",
52+
"ifname": "eth0",
53+
"mtu": null,
54+
"status": {
55+
"cable_len": null,
56+
"duplex": true,
57+
"ip6addr": null,
58+
"plugged": true,
59+
"snr": null,
60+
"speed": 100
61+
}
62+
},
63+
{
64+
"enabled": true,
65+
"hwaddr": "XX:XX:XX:XX:XX:XX",
66+
"ifname": "wifi0",
67+
"mtu": null,
68+
"status": {
69+
"cable_len": null,
70+
"duplex": true,
71+
"ip6addr": null,
72+
"plugged": true,
73+
"snr": null,
74+
"speed": 0
75+
}
76+
},
77+
{
78+
"enabled": true,
79+
"hwaddr": "XX:XX:XX:XX:XX:XX",
80+
"ifname": "ath0",
81+
"mtu": null,
82+
"status": {
83+
"cable_len": null,
84+
"duplex": true,
85+
"ip6addr": null,
86+
"plugged": true,
87+
"snr": null,
88+
"speed": 300
89+
}
90+
},
91+
{
92+
"enabled": true,
93+
"hwaddr": "XX:XX:XX:XX:XX:XX",
94+
"ifname": "br0",
95+
"mtu": null,
96+
"status": {
97+
"cable_len": null,
98+
"duplex": true,
99+
"ip6addr": null,
100+
"plugged": true,
101+
"snr": null,
102+
"speed": 0
103+
}
104+
}
105+
],
106+
"services": {
107+
"dhcpc": false,
108+
"dhcpd": false,
109+
"pppoe": false
110+
},
111+
"unms": {
112+
"status": 0,
113+
"timestamp": ""
114+
},
115+
"wireless": {
116+
"ack": 28,
117+
"antenna": "Built in - 13 dBi",
118+
"apmac": "XX:XX:XX:XX:XX:XX",
119+
"aprepeater": 0,
120+
"cac_nol": 0,
121+
"ccq": 870,
122+
"chains": "2X2",
123+
"chanbw": 40,
124+
"channel": 140,
125+
"countrycode": 616,
126+
"dfs": 1,
127+
"distance": 600,
128+
"essid": "SOMETHING",
129+
"frequency": "5700 MHz",
130+
"hide_essid": 1,
131+
"mode": "ap",
132+
"noisef": -91,
133+
"nol_chans": 0,
134+
"opmode": "11naht40minus",
135+
"qos": "No QoS",
136+
"rssi": 51,
137+
"rstatus": 5,
138+
"rxrate": "300",
139+
"security": "WPA2",
140+
"signal": -45,
141+
"txpower": 2,
142+
"txrate": "270",
143+
"wds": 1
144+
}
145+
}
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"airview": {
3+
"enabled": 0
4+
},
5+
"derived": {
6+
"access_point": false,
7+
"mac": "YY:YY:YY:YY:YY:YY",
8+
"mac_interface": "br0",
9+
"mode": "point_to_point",
10+
"ptmp": false,
11+
"ptp": true,
12+
"role": "station",
13+
"sku": "LocoM5",
14+
"station": true
15+
},
16+
"firewall": {
17+
"eb6tables": false,
18+
"ebtables": true,
19+
"ip6tables": false,
20+
"iptables": false
21+
},
22+
"genuine": "/images/genuine.png",
23+
"host": {
24+
"cpuload": 100.0,
25+
"devmodel": "NanoStation loco M5 ",
26+
"freeram": 8753152,
27+
"fwprefix": "XM",
28+
"fwversion": "v6.3.16",
29+
"hostname": "NanoStation loco M5 Client",
30+
"netrole": "bridge",
31+
"totalram": 30220288,
32+
"uptime": 1974859
33+
},
34+
"interfaces": [
35+
{
36+
"enabled": true,
37+
"hwaddr": "00:00:00:00:00:00",
38+
"ifname": "lo",
39+
"mtu": null,
40+
"status": {
41+
"cable_len": null,
42+
"duplex": true,
43+
"ip6addr": null,
44+
"plugged": true,
45+
"snr": null,
46+
"speed": 0
47+
}
48+
},
49+
{
50+
"enabled": true,
51+
"hwaddr": "YY:YY:YY:YY:YY:YY",
52+
"ifname": "eth0",
53+
"mtu": null,
54+
"status": {
55+
"cable_len": null,
56+
"duplex": false,
57+
"ip6addr": null,
58+
"plugged": false,
59+
"snr": null,
60+
"speed": 0
61+
}
62+
},
63+
{
64+
"enabled": true,
65+
"hwaddr": "YY:YY:YY:YY:YY:YY",
66+
"ifname": "wifi0",
67+
"mtu": null,
68+
"status": {
69+
"cable_len": null,
70+
"duplex": true,
71+
"ip6addr": null,
72+
"plugged": true,
73+
"snr": null,
74+
"speed": 0
75+
}
76+
},
77+
{
78+
"enabled": true,
79+
"hwaddr": "YY:YY:YY:YY:YY:YY",
80+
"ifname": "ath0",
81+
"mtu": null,
82+
"status": {
83+
"cable_len": null,
84+
"duplex": true,
85+
"ip6addr": null,
86+
"plugged": true,
87+
"snr": null,
88+
"speed": 300
89+
}
90+
},
91+
{
92+
"enabled": true,
93+
"hwaddr": "YY:YY:YY:YY:YY:YY",
94+
"ifname": "br0",
95+
"mtu": null,
96+
"status": {
97+
"cable_len": null,
98+
"duplex": true,
99+
"ip6addr": null,
100+
"plugged": true,
101+
"snr": null,
102+
"speed": 0
103+
}
104+
}
105+
],
106+
"services": {
107+
"dhcpc": false,
108+
"dhcpd": false,
109+
"pppoe": false
110+
},
111+
"unms": {
112+
"status": 0,
113+
"timestamp": ""
114+
},
115+
"wireless": {
116+
"ack": 28,
117+
"antenna": "Built in - 13 dBi",
118+
"apmac": "XX:XX:XX:XX:XX:XX",
119+
"aprepeater": 0,
120+
"cac_nol": 0,
121+
"ccq": 738,
122+
"chains": "2X2",
123+
"chanbw": 40,
124+
"channel": 140,
125+
"countrycode": 616,
126+
"dfs": 0,
127+
"distance": 600,
128+
"essid": "SOMETHING",
129+
"frequency": "5700 MHz",
130+
"hide_essid": 0,
131+
"mode": "sta",
132+
"noisef": -89,
133+
"nol_chans": 0,
134+
"opmode": "11naht40minus",
135+
"qos": "No QoS",
136+
"rssi": 50,
137+
"rstatus": 5,
138+
"rxrate": "180",
139+
"security": "WPA2",
140+
"signal": -46,
141+
"txpower": 2,
142+
"txrate": "243",
143+
"wds": 1
144+
}
145+
}

0 commit comments

Comments
 (0)