diff --git a/ovos_gui/homescreen.py b/ovos_gui/homescreen.py index c4863ad..9f08e84 100644 --- a/ovos_gui/homescreen.py +++ b/ovos_gui/homescreen.py @@ -15,6 +15,9 @@ def __init__(self, bus: MessageBusClient, gui: NamespaceManager): self.bus = bus self.gui = gui self.homescreens: List[dict] = [] + self.mycroft_ready = False + # TODO: If service starts after `mycroft_ready`, + # homescreen is never shown self.bus.on('homescreen.manager.add', self.add_homescreen) self.bus.on('homescreen.manager.remove', self.remove_homescreen) self.bus.on('homescreen.manager.list', self.get_homescreens) @@ -127,6 +130,9 @@ def show_homescreen_on_add(self, homescreen_id: str): Check if a homescreen should be displayed immediately upon addition @param homescreen_id: ID of added homescreen """ + if not self.mycroft_ready: + LOG.debug("Not ready yet, don't display homescreen") + return LOG.debug(f"Checking {homescreen_id}") if self.get_active_homescreen() != homescreen_id: # Added homescreen isn't the configured one, do nothing @@ -175,4 +181,5 @@ def set_mycroft_ready(self, message: Message): Handle `mycroft.ready` and show the homescreen @param message: `mycroft.ready` Message """ + self.mycroft_ready = True self.show_homescreen()