Add skill to switch between maps, pet, smart_home

This commit is contained in:
Ceda EI 2021-01-06 11:58:14 +05:30
parent 2a067b62fe
commit 6db947e7ca
10 changed files with 96 additions and 0 deletions

4
car-mode-switches-skill/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
__pycache__/
*.qmlc
settings.json

View File

@ -0,0 +1,22 @@
# <img src="https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/map-signs.svg" card_color="#FD9E66" width="50" height="50" style="vertical-align:bottom"/> Car Mode Switches
Switches to various modes from audio
## About
Switches to various modes from audio
## Examples
* "Enable pet mode"
* "Start pet mode"
* "Turn on pet mode"
* "Enable child mode"
* "Start child mode"
* "Turn on child mode"
## Credits
Firewalkers
## Category
**Productivity**
## Tags

View File

@ -0,0 +1,37 @@
from mycroft import MycroftSkill, intent_file_handler
import requests
def emit(osd_url, event, data):
json = {
"event": event,
"data": data
}
print(json)
return requests.post(osd_url, json=json)
class CarModeSwitches(MycroftSkill):
def __init__(self):
MycroftSkill.__init__(self)
@intent_file_handler('switches.mode.pet.intent')
def handle_switches_mode_car(self, message):
url = self.settings.get("OSD_API", "http://localhost:5050/send")
emit(url, "switchPlugin", {"plugin": "petMode"})
self.speak_dialog('switches.mode.pet')
@intent_file_handler('switches.mode.smart_home.intent')
def handle_switches_mode_car(self, message):
url = self.settings.get("OSD_API", "http://localhost:5050/send")
emit(url, "switchPlugin", {"plugin": "smartHome"})
self.speak_dialog('switches.mode.smart_home')
@intent_file_handler('switches.mode.maps.intent')
def handle_switches_mode_car(self, message):
url = self.settings.get("OSD_API", "http://localhost:5050/send")
emit(url, "switchPlugin", {"plugin": "maps"})
self.speak_dialog('switches.mode.maps')
def create_skill():
return CarModeSwitches()

View File

@ -0,0 +1 @@
Showing maps

View File

@ -0,0 +1,8 @@
Enable maps
Start maps
Turn on maps
Display maps
Enable map
Start map
Turn on map
Display map

View File

@ -0,0 +1 @@
Turning on pet mode

View File

@ -0,0 +1,6 @@
Enable pet mode
Start pet mode
Turn on pet mode
Enable child mode
Start child mode
Turn on child mode

View File

@ -0,0 +1 @@
Showing garage view

View File

@ -0,0 +1,6 @@
Enable smart home
Start smart home
Turn on smart home
Show me my garage
Show me garage
Show me my house

View File

@ -0,0 +1,10 @@
skillMetadata:
sections:
- name: API Paths
fields:
- name: OSD_API
type: text
label: OSD API URL
value: "http://localhost:5050/send"
placeholder: "http://localhost:5050/send"