From 5c9aefa3dd9d444348f5c54764fda3013db0548c Mon Sep 17 00:00:00 2001 From: David Steele Date: Sat, 23 Mar 2019 10:44:33 -0400 Subject: [PATCH] Tell 1st HOTSPOT state to CONNECT early, only once The way it worked before, timeout was always being called every 5 seconds, if the first HOTSPOT attempt worked, but CONNECT didn't. --- comitup/states.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/comitup/states.py b/comitup/states.py index 8886a671..6e552daf 100644 --- a/comitup/states.py +++ b/comitup/states.py @@ -340,7 +340,9 @@ def init_states(hosts, callbacks, hotspot_pw): hotspot_name = dns_to_conn(hosts[0]) assure_hotspot(hotspot_name, modemgr.get_ap_device()) - set_state('HOTSPOT', timeout=5) + # Set an early kick to set CONNECTING mode + set_state('HOTSPOT') + timeout_add(5*1000, hotspot_timeout, state_id) def add_state_callback(callback):