Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:are_you_ready #17

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
# Finished Booting
# Finished Booting Skill

## Summary

Skill to speak when OVOS is ready
The Finished Booting skill provides a notification when OpenVoiceOS (OVOS) has fully started and all core services are ready. This notification can be spoken to the user or simply logged, depending on the user's preferences.

## Description

When OpenVoiceOS is started or restarted, this skill will speak a notification to the
user. This speech can be enabled/disabled by intent.
This skill ensures that users are informed when OVOS has completed booting and all essential services (such as network, GUI, and others) are ready for use. It provides a customizable ready notification that can be enabled or disabled via voice commands. The notification can be delivered either via a spoken message, sound, or visual cues on connected devices.

### Key Features:
- Monitors system readiness by checking core services like network, internet, and GUI.
- Notifies the user when OVOS is fully ready.
- Allows users to enable or disable the ready notification via voice intents.
- Configurable options for spoken readiness notifications and sound effects.

## Voice Commands

- **Enable Ready Notifications**: Activates the spoken notification when OVOS is ready.
- Example: "Enable ready notifications."

- **Disable Ready Notifications**: Deactivates the spoken notification.
- Example: "Disable load speech."

## Examples

- "Enable ready notifications."
- "Disable load speech."
- "Disable ready speech."
- "Is the system ready?"

## Credits
[NeonGeckoCom](https://github.com/NeonGeckoCom/skill-core_ready)
Expand Down
34 changes: 25 additions & 9 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,20 @@ def is_device_ready(self) -> bool:
is_ready = False
# Different setups will have different needs
# eg, a server does not care about audio
# internet -> device is connected to the internet - NOT IMPLEMENTED
# internet -> device is connected to the internet
# network -> device is connected to the internet
# gui_connected -> a gui client connected to the gui socket

# any service using ProcessStatus class can also be added to ready_settings
# skills -> skills reported ready
# speech -> stt reported ready
# audio -> audio playback reported ready
# gui -> gui websocket reported ready - NOT IMPLEMENTED
# enclosure -> enclosure/HAL reported ready - NOT IMPLEMENTED
# gui -> gui websocket reported ready
# PHAL -> enclosure/HAL reported ready

# TODO - allow requiring specific skills to be fully loaded
# skills might be loaded by core or run standalone, we should standardize how this is checked via bus
# perhaps ProcessStatus with skill_id ?
services = {k: False for k in
self.settings.get("ready_settings", ["skills", "speech", "audio"])}
start = monotonic()
Expand All @@ -92,16 +99,15 @@ def check_services_ready(self, services):
if rdy:
# already reported ready
continue
if ser in ["gui", "enclosure"]:
# not implemented
services[ser] = True
continue
elif ser in ["network_skills"]:
if ser in ["network_skills", "network"]:
services[ser] = self._network_event.is_set()
continue
elif ser in ["internet_skills"]:
elif ser in ["internet_skills", "internet"]:
services[ser] = self._connected_event.is_set()
continue
elif ser in ["gui_connected"]:
services[ser] = self._gui_event.is_set()
continue
response = self.bus.wait_for_response(
Message(f'mycroft.{ser}.is_ready',
context={"source": "skills", "destination": ser}))
Expand Down Expand Up @@ -177,6 +183,16 @@ def handle_ready(self, message: Message):
LOG.debug("Ready notification disabled in settings")
self.enclosure.eyes_blink("b")

@intent_handler("are_you_ready.intent")
def handle_enable_notification(self, message: Message):
"""
Handle a request to enable ready announcements
"""
if self.is_device_ready():
self.speak_dialog("confirm_ready")
else:
self.speak_dialog("deny_ready")
JarbasAl marked this conversation as resolved.
Show resolved Hide resolved

@intent_handler("enable_ready_notification.intent")
def handle_enable_notification(self, message: Message):
"""
Expand Down
5 changes: 5 additions & 0 deletions locale/en-us/dialog/confirm_ready.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
My system is fully ready.
All services are up and running.
My system is ready to go.
Everything is up and operational.
My system has finished booting and is ready.
5 changes: 5 additions & 0 deletions locale/en-us/dialog/deny_ready.dialog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
My system is not fully ready yet.
Some services are still starting up.
My system is still booting, please wait.
Not everything is ready yet.
The system isn't fully operational yet, please give me some more time.
10 changes: 10 additions & 0 deletions locale/en-us/intent/are_you_ready.intent
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Is (your|the|Open Voice OS) system ready
Did (you|all services|the system|Open Voice OS|the device) finish booting
Are (you|all services) (ready|fully loaded|still loading|up and running)
(Have you|Has the system) finished (starting|loading|start up|boot sequence)
Is everything (ready|fully loaded|still loading|up and running)
Have you finished (booting|loading|the boot sequence)
Is (the system|Open Voice OS|the device) ready
(Has|did) (the system|you|Open Voice OS) boot successfully
Is the boot (process|sequence) complete
Have (all services|you) started
19 changes: 0 additions & 19 deletions scripts/bump_alpha.py

This file was deleted.

21 changes: 0 additions & 21 deletions scripts/bump_build.py

This file was deleted.

27 changes: 0 additions & 27 deletions scripts/bump_major.py

This file was deleted.

24 changes: 0 additions & 24 deletions scripts/bump_minor.py

This file was deleted.

13 changes: 0 additions & 13 deletions scripts/remove_alpha.py

This file was deleted.

14 changes: 14 additions & 0 deletions translations/en-us/dialogs.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@
"/dialog/ready.dialog": [
"I am ready!"
],
"/dialog/confirm_ready.dialog": [
"My system is fully ready.",
"All services are up and running.",
"My system is ready to go.",
"Everything is up and operational.",
"My system has finished booting and is ready."
],
"/dialog/confirm_speak_ready.dialog": [
"Okay. I will tell you when I am ready after restarts."
],
"/dialog/deny_ready.dialog": [
"My system is not fully ready yet.",
"Some services are still starting up.",
"My system is still booting, please wait.",
"Not everything is ready yet.",
"The system isn't fully operational yet, please give me some more time."
]
}
12 changes: 12 additions & 0 deletions translations/en-us/intents.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"/intent/are_you_ready.intent": [
"Is (your|the|Open Voice OS) system ready",
"Did (you|all services|the system|Open Voice OS|the device) finish booting",
"Are (you|all services) (ready|fully loaded|still loading|up and running)",
"(Have you|Has the system) finished (starting|loading|start up|boot sequence)",
"Is everything (ready|fully loaded|still loading|up and running)",
"Have you finished (booting|loading|the boot sequence)",
"Is (the system|Open Voice OS|the device) ready",
"(Has|did) (the system|you|Open Voice OS) boot successfully",
"Is the boot (process|sequence) complete",
"Have (all services|you) started"
],
"/intent/disable_ready_notification.intent": [
"(disable|turn off|deactivate) (ready|start|startup|start up|boot|load|readiness|started|booted|loaded) (sound|notification|speech|sounds|notifications)"
],
Expand Down
Loading