mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-10 11:52:10 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user