WifiManager: fix all networks showing as connected when no active connection (#37252)

* WifiManager: fix all networks showing as connected when no active connection

When there's no active WiFi connection, _get_active_wifi_connection()
returns None. This caused `self._connections.get(ssid) == None` to be
True for all unsaved networks, marking them all as connected.

Co-authored-by: Cursor <cursoragent@cursor.com>

* ltl

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Shane Smiskol
2026-02-18 05:52:59 -08:00
committed by GitHub
parent 489afc3842
commit c6db0cd4b6
+1
View File
@@ -737,6 +737,7 @@ class WifiManager:
active_wifi_connection, _ = self._get_active_wifi_connection()
networks = [Network.from_dbus(ssid, ap_list, ssid in self._connections,
active_wifi_connection is not None and
self._connections.get(ssid) == active_wifi_connection) for ssid, ap_list in aps.items()]
networks.sort(key=lambda n: (-n.is_connected, -n.is_saved, -n.strength, n.ssid.lower()))
self._networks = networks