Skip to content

Commit

Permalink
Rename wlans when some are missing (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaskivskyi authored Dec 3, 2023
1 parent 652c2d7 commit 8d84c3a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions asusrouter/modules/data_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ def transform_network(
"rx_speed": 0.0,
"tx_speed": 0.0,
}

# Check if we have 5GHz2 available in the network data
if "5ghz2" in network:
# Check interfaces for 5Ghz2/6Ghz
support_5ghz2 = "5G-2" in services
support_6ghz = "wifi6e" in services

if support_5ghz2 is False and support_6ghz is True:
# Rename 5Ghz2 to 6Ghz
network["6ghz"] = network.pop("5ghz2")

return network


Expand Down
2 changes: 1 addition & 1 deletion asusrouter/modules/wlan.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Wlan(str, Enum):
"2.4G": Wlan.FREQ_2G,
"5G": Wlan.FREQ_5G,
"5G-2": Wlan.FREQ_5G2,
"6G": Wlan.FREQ_6G,
"wifi6e": Wlan.FREQ_6G,
"wlc_0": Wlan.FREQ_2G,
"wlc_1": Wlan.FREQ_5G,
"wlc_2": Wlan.FREQ_5G2,
Expand Down

0 comments on commit 8d84c3a

Please sign in to comment.