|
|
@ -162,16 +162,6 @@ class WifiManager: |
|
|
|
print('SETTING ACTIVE', active) |
|
|
|
print('SETTING ACTIVE', active) |
|
|
|
self._active = active |
|
|
|
self._active = active |
|
|
|
|
|
|
|
|
|
|
|
def _wait_for_wifi_device(self) -> dbus.ObjectPath: |
|
|
|
|
|
|
|
with self._lock: |
|
|
|
|
|
|
|
device_path: dbus.ObjectPath | None = None |
|
|
|
|
|
|
|
while not self._exit: |
|
|
|
|
|
|
|
device_path = self._get_wifi_device() |
|
|
|
|
|
|
|
if device_path is not None: |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
time.sleep(1) |
|
|
|
|
|
|
|
return device_path |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _monitor_state(self): |
|
|
|
def _monitor_state(self): |
|
|
|
device_path: dbus.ObjectPath = self._wait_for_wifi_device() |
|
|
|
device_path: dbus.ObjectPath = self._wait_for_wifi_device() |
|
|
|
props_dev = dbus.Interface(self._monitor_bus.get_object(NM, device_path), NM_PROPERTIES_IFACE) |
|
|
|
props_dev = dbus.Interface(self._monitor_bus.get_object(NM, device_path), NM_PROPERTIES_IFACE) |
|
|
@ -226,6 +216,16 @@ class WifiManager: |
|
|
|
|
|
|
|
|
|
|
|
time.sleep(5) |
|
|
|
time.sleep(5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _wait_for_wifi_device(self) -> dbus.ObjectPath: |
|
|
|
|
|
|
|
with self._lock: |
|
|
|
|
|
|
|
device_path: dbus.ObjectPath | None = None |
|
|
|
|
|
|
|
while not self._exit: |
|
|
|
|
|
|
|
device_path = self._get_wifi_device() |
|
|
|
|
|
|
|
if device_path is not None: |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
time.sleep(1) |
|
|
|
|
|
|
|
return device_path |
|
|
|
|
|
|
|
|
|
|
|
def _get_wifi_device(self) -> dbus.ObjectPath | None: |
|
|
|
def _get_wifi_device(self) -> dbus.ObjectPath | None: |
|
|
|
if self._wifi_device is not None: |
|
|
|
if self._wifi_device is not None: |
|
|
|
return self._wifi_device |
|
|
|
return self._wifi_device |
|
|
|