|
|
@ -187,6 +187,7 @@ class WifiManager: |
|
|
|
conn.send_and_get_reply(message_bus.AddMatch(rule)) |
|
|
|
conn.send_and_get_reply(message_bus.AddMatch(rule)) |
|
|
|
|
|
|
|
|
|
|
|
try: |
|
|
|
try: |
|
|
|
|
|
|
|
with conn.filter(rule, queue=deque(maxlen=10)) as q: # TODO: not sure what to choose for this |
|
|
|
while not self._exit: |
|
|
|
while not self._exit: |
|
|
|
# TODO: now that we have a nice poller we can run always? |
|
|
|
# TODO: now that we have a nice poller we can run always? |
|
|
|
# TODO: actually nah since it affects UI currently? or not? |
|
|
|
# TODO: actually nah since it affects UI currently? or not? |
|
|
@ -195,7 +196,6 @@ class WifiManager: |
|
|
|
continue |
|
|
|
continue |
|
|
|
|
|
|
|
|
|
|
|
# Block until a matching signal arrives |
|
|
|
# Block until a matching signal arrives |
|
|
|
with conn.filter(rule, queue=deque(maxlen=1)) as q: |
|
|
|
|
|
|
|
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 |
|
|
|