From 7964afb968eb5ff183ff92a2e00321ce55812a9c Mon Sep 17 00:00:00 2001 From: alan-mycroft <110559493+alan-mycroft@users.noreply.github.com> Date: Tue, 31 Jan 2023 21:32:14 -0800 Subject: [PATCH] Allow Mark II to start up if Selene pairing fails (#68) * First pass for testing. * Fixing typo in config file. --------- Co-authored-by: Alan Hogue --- services/enclosure/service/connect_check.py | 15 ++++++++++++--- shared/mycroft/configuration/mycroft.conf | 5 ++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/services/enclosure/service/connect_check.py b/services/enclosure/service/connect_check.py index da36a589..fbbeb655 100644 --- a/services/enclosure/service/connect_check.py +++ b/services/enclosure/service/connect_check.py @@ -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 diff --git a/shared/mycroft/configuration/mycroft.conf b/shared/mycroft/configuration/mycroft.conf index 369afeb1..0d6ea695 100644 --- a/shared/mycroft/configuration/mycroft.conf +++ b/shared/mycroft/configuration/mycroft.conf @@ -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"