Skip to content

Commit

Permalink
Allow Mark II to start up if Selene pairing fails (#68)
Browse files Browse the repository at this point in the history
* First pass for testing.

* Fixing typo in config file.

---------

Co-authored-by: Alan Hogue <[email protected]>
  • Loading branch information
alan-mycroft and Alan Hogue authored Feb 1, 2023
1 parent 2f9c12b commit 7964afb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
15 changes: 12 additions & 3 deletions services/enclosure/service/connect_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,18 @@ def _check_pairing(self, _message: Message):
)
)
elif server_state == Authentication.SERVER_UNAVAILABLE:
# Show failure page and retry
self.log.warning("Server was unavailable. Retrying...")
self._fail_and_restart()
if self.config["enclosure"]["insist_on_selene_pair"]:
# Show failure page and retry
self.log.warning("Server was unavailable. Retrying...")
self._fail_and_restart()
else:
# Since we are preparing for a post-selene future, we will want
# instead to allow Mycroft to skip the rest of the pairing setup
# in cases where the selene server is not available.
# Call it done.
self._state = State.DONE
self.bus.emit(Message("server-connect.startup-finished"))
self.bus.emit(self.end_session(gui_clear=GuiClear.NEVER))
else:
# Paired already, continue with pantacor sync
self._state = State.SYNC_PANTACOR
Expand Down
5 changes: 4 additions & 1 deletion shared/mycroft/configuration/mycroft.conf
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@
],

// Path to Unix domain socket for awconnect (hotspot) server
"awconnect_socket_path": "/awconnect/tmp/mycroft_socket"
"awconnect_socket_path": "/awconnect/tmp/mycroft_socket",

// Whether to insist on pairing to Selene. If False, will give up on failure
"insist_on_selene_pair": false
},

// Level of logs to store, one of "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG"
Expand Down

0 comments on commit 7964afb

Please sign in to comment.