Skip to content

Commit

Permalink
Check if Skills service is running on GUI service init (#29)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel McKnight <[email protected]>
  • Loading branch information
NeonDaniel and NeonDaniel authored Sep 28, 2023
1 parent 4b012ba commit eb41f35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ovos_gui/namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ def __init__(self, core_bus: MessageBusClient):
self._init_gui_server()
self._define_message_handlers()

resp = self.core_bus.wait_for_response(Message("mycroft.skills.is_ready",
context={"source": "gui", "destination": ["skills"]}))
if resp and resp.data.get("status"):
LOG.debug("Skills service already running")
self.handle_ready()

@property
def _active_homescreen(self) -> str:
return Configuration().get('gui', {}).get('idle_display_skill')
Expand Down Expand Up @@ -495,7 +501,7 @@ def _define_message_handlers(self):
self.core_bus.on("gui.page_gained_focus", self.handle_page_gained_focus)
self.core_bus.on("mycroft.skills.trained", self.handle_ready)

def handle_ready(self, message):
def handle_ready(self, message=None):
self._ready_event.set()
self.core_bus.on("gui.volunteer_page_upload",
self.handle_gui_pages_available)
Expand Down

0 comments on commit eb41f35

Please sign in to comment.