flip around to not drop

pull/36039/head
Shane Smiskol 7 days ago
parent 0872466640
commit 87e169f336
  1. 18
      system/ui/lib/wifi_manager.py

@ -187,15 +187,15 @@ class WifiManager:
conn.send_and_get_reply(message_bus.AddMatch(rule)) conn.send_and_get_reply(message_bus.AddMatch(rule))
try: try:
while not self._exit: with conn.filter(rule, queue=deque(maxlen=10)) as q: # TODO: not sure what to choose for this
# TODO: now that we have a nice poller we can run always? while not self._exit:
# TODO: actually nah since it affects UI currently? or not? # TODO: now that we have a nice poller we can run always?
if not self._active: # TODO: actually nah since it affects UI currently? or not?
time.sleep(1) if not self._active:
continue time.sleep(1)
continue
# Block until a matching signal arrives
with conn.filter(rule, queue=deque(maxlen=1)) as q: # Block until a matching signal arrives
msg = conn.recv_until_filtered(q) msg = conn.recv_until_filtered(q)
print('msg.body', msg.body) print('msg.body', msg.body)
new_state, previous_state, change_reason = msg.body new_state, previous_state, change_reason = msg.body

Loading…
Cancel
Save