okay not for now

pull/36063/head
Shane Smiskol 1 day ago
parent 4fdfa2f0dc
commit 8929f37d49
  1. 13
      system/ui/lib/wifi_manager.py

@ -169,7 +169,6 @@ class WifiManager:
def process_callbacks(self): def process_callbacks(self):
# Call from UI thread to run any pending callbacks # Call from UI thread to run any pending callbacks
to_run, self._callback_queue = self._callback_queue, [] to_run, self._callback_queue = self._callback_queue, []
print('processing', len(to_run), 'callbacks', to_run)
for cb in to_run: for cb in to_run:
cb() cb()
@ -197,15 +196,19 @@ class WifiManager:
with self._conn_monitor.filter(rule, bufsize=SIGNAL_QUEUE_SIZE) as q: with self._conn_monitor.filter(rule, bufsize=SIGNAL_QUEUE_SIZE) as q:
while not self._exit: while not self._exit:
if not self._active:
time.sleep(1)
continue
# Block until a matching signal arrives # Block until a matching signal arrives
try: try:
msg = self._conn_monitor.recv_until_filtered(q, timeout=1) msg = self._conn_monitor.recv_until_filtered(q, timeout=1)
new_state, previous_state, change_reason = msg.body
except TimeoutError: except TimeoutError:
continue continue
new_state, previous_state, change_reason = msg.body
# BAD PASSWORD # BAD PASSWORD
print('new_state', new_state, 'prev', previous_state, 'reason', change_reason)
if new_state == NMDeviceState.NEED_AUTH and change_reason == NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT and len(self._connecting_to_ssid): if new_state == NMDeviceState.NEED_AUTH and change_reason == NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT and len(self._connecting_to_ssid):
self.forget_connection(self._connecting_to_ssid, block=True) self.forget_connection(self._connecting_to_ssid, block=True)
if self._need_auth is not None: if self._need_auth is not None:
@ -369,10 +372,6 @@ class WifiManager:
cloudlog.warning("No WiFi device found") cloudlog.warning("No WiFi device found")
return return
if not self._active:
cloudlog.debug("Skipping network update, not active")
return
# returns '/' if no active AP # returns '/' if no active AP
wifi_addr = DBusAddress(self._wifi_device, NM, interface=NM_WIRELESS_IFACE) wifi_addr = DBusAddress(self._wifi_device, NM, interface=NM_WIRELESS_IFACE)
active_ap_path = self._router_main.send_and_get_reply(Properties(wifi_addr).get('ActiveAccessPoint')).body[0][1] active_ap_path = self._router_main.send_and_get_reply(Properties(wifi_addr).get('ActiveAccessPoint')).body[0][1]

Loading…
Cancel
Save