initial commit
This commit is contained in:
commit
43b2e35602
|
@ -0,0 +1,3 @@
|
|||
*.pyc
|
||||
settings.json
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
import re
|
||||
import sys
|
||||
from os.path import dirname
|
||||
from adapt.intent import IntentBuilder
|
||||
from mycroft import MycroftSkill, intent_handler
|
||||
|
||||
class MeetingModeSkill(MycroftSkill):
|
||||
"""
|
||||
Skill to show or hide a DO NOT DISTURB message
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super().__init__("MeetingModeSkill")
|
||||
self.html_resources = "file://" + dirname(__file__) + '/res/'
|
||||
|
||||
def initialize(self):
|
||||
self.gui.register_handler('MeetingModeSkill.doNotDisturb',
|
||||
self.handle_do_not_disturb_intent)
|
||||
self.gui.register_handler('MeetingModeSkill.cancelDoNotDisturb',
|
||||
self.handle_cancel_do_not_disturb_intent)
|
||||
|
||||
@intent_handler(IntentBuilder('handle_do_not_disturb_intent').require('do-not-disturb'))
|
||||
def handle_do_not_disturb_intent(self, message):
|
||||
self.gui.clear()
|
||||
self.enclosure.display_manager.remove_active()
|
||||
html = """<!doctype html>
|
||||
<html language='en'>
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<title>DO NOT DISTURB</title>
|
||||
<style>
|
||||
html {
|
||||
background: url('do-not-disturb.png') no-repeat center center fixed;
|
||||
background-size: cover;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
self.gui.show_html(html, resource_url=self.html_resources, override_idle=True)
|
||||
|
||||
@intent_handler(IntentBuilder('handle_cancel_do_not_disturb_intent').require('cancel-do-not-disturb'))
|
||||
def handle_cancel_do_not_disturb_intent(self, message):
|
||||
self.gui.clear()
|
||||
|
||||
def stop(self):
|
||||
pass
|
||||
|
||||
|
||||
def create_skill():
|
||||
return MeetingModeSkill()
|
Binary file not shown.
After Width: | Height: | Size: 34 KiB |
|
@ -0,0 +1,2 @@
|
|||
cancel do not disturb
|
||||
cancel meeting mode
|
|
@ -0,0 +1,2 @@
|
|||
do not disturb
|
||||
meeting mode
|
Loading…
Reference in New Issue