Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Skill to determine when Mycroft AI has finished booting up.

## About
With this skill Mycroft will say when the boot up period has finished and is ready to receive commands.
With this skill Mycroft will say "finished booting" or play a startup sound when the boot up period has finished and is ready to receive commands.

## Examples

Expand All @@ -12,5 +12,11 @@ zelmon64 (@zelmon64), Wally Fort (@fortwally), JarbasAI (@JarbasAI)
## Category
**Configuration**

## Tags
You may optionally add a configuration stanza to mycroft.conf to play an mp3 file instead of speaking:
```
"FinishedBootingSkill": {
"startup_mp3": "/home/pi/chimes-1948.mp3"
}
```

## Tags
17 changes: 14 additions & 3 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,30 @@

from mycroft import MycroftSkill
from mycroft.util.log import LOG
from mycroft.configuration import ConfigurationManager
from mycroft.util import play_mp3

class FinishedBootingSkill(MycroftSkill):

# The constructor of the skill, which calls MycroftSkill's constructor
def __init__(self):
super(FinishedBootingSkill, self).__init__(name="FinishedBootingSkill")

def initialize(self):
self.add_event("mycroft.skills.initialized", self.handle_boot_finished)
LOG.debug('add event handle boot finished')

config = ConfigurationManager.get()
base_conf = config.get('FinishedBootingSkill')
if base_conf:
self.mp3_file = base_conf.get('startup_mp3', None)
else:
self.mp3_file = None

def handle_boot_finished(self):
self.speak_dialog('finished.booting')
if self.mp3_file:
play_mp3(self.mp3_file)
else:
self.speak_dialog('finished.booting')
LOG.debug('finished booting')

# The "create_skill()" method is used to create an instance of the skill.
Expand Down