WLAN Verbindung angepasst

This commit is contained in:
2026-05-28 08:00:56 +02:00
parent cb33bbf06c
commit a42b87507b
6 changed files with 103 additions and 64 deletions
+7
View File
@@ -222,6 +222,13 @@ def get_wifi_status():
device, state, connection = parts
if device == 'wlan0':
if state == 'connected':
ssid_stdout, _, ssid_returncode = run_command(['nmcli', '-t', '-f', 'ACTIVE,SSID', 'device', 'wifi', 'list', 'ifname', 'wlan0'])
if ssid_returncode == 0 and ssid_stdout:
for ssid_line in ssid_stdout.splitlines():
if ssid_line.startswith('yes:'):
active_ssid = ssid_line.split(':', 1)[1].strip()
if active_ssid:
return f'verbunden: {active_ssid}'
return f'verbunden: {connection}'
return state