From daca597409151a9f44579182682320f92b4089d2 Mon Sep 17 00:00:00 2001 From: Yevhenii Vaskivskyi Date: Sun, 3 Dec 2023 11:26:10 +0100 Subject: [PATCH] Rename wlans when some are missing (#415) --- asusrouter/modules/data_transform.py | 11 +++++++++++ asusrouter/modules/wlan.py | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/asusrouter/modules/data_transform.py b/asusrouter/modules/data_transform.py index cea0be8..c5d0bca 100644 --- a/asusrouter/modules/data_transform.py +++ b/asusrouter/modules/data_transform.py @@ -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 diff --git a/asusrouter/modules/wlan.py b/asusrouter/modules/wlan.py index a1db82f..284c729 100644 --- a/asusrouter/modules/wlan.py +++ b/asusrouter/modules/wlan.py @@ -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,