diff --git a/car-manual-skill/.gitignore b/car-manual-skill/.gitignore new file mode 100644 index 0000000..4eb3651 --- /dev/null +++ b/car-manual-skill/.gitignore @@ -0,0 +1,4 @@ +__pycache__/ +*.qmlc +settings.json + diff --git a/car-manual-skill/README.md b/car-manual-skill/README.md new file mode 100644 index 0000000..1843976 --- /dev/null +++ b/car-manual-skill/README.md @@ -0,0 +1,17 @@ +# Car Manual +Gives information for your car + +## About +Gives information for your car + +## Examples +* "How to enable child lock" + +## Credits +FireWalkers + +## Category +**Information** + +## Tags + diff --git a/car-manual-skill/__init__.py b/car-manual-skill/__init__.py new file mode 100644 index 0000000..a2bb45b --- /dev/null +++ b/car-manual-skill/__init__.py @@ -0,0 +1,35 @@ +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 CarManual(MycroftSkill): + def __init__(self): + MycroftSkill.__init__(self) + + @intent_file_handler('manual.car.childlock.intent') + def handle_manual_car(self, message): + dialog = self.dialog_renderer.render("manual.car.childlock", {}) + url = self.settings.get("OSD_API", "http://localhost:5050/send") + emission = { + "plugin": "manual", + "data": { + "title": "Child Lock", + "description": dialog + }, + "time": 5000 + } + emit(url, "switchPlugin", emission) + self.speak(dialog) + + +def create_skill(): + return CarManual() + diff --git a/car-manual-skill/locale/en-us/manual.car.childlock.dialog b/car-manual-skill/locale/en-us/manual.car.childlock.dialog new file mode 100644 index 0000000..4ffe54f --- /dev/null +++ b/car-manual-skill/locale/en-us/manual.car.childlock.dialog @@ -0,0 +1 @@ +To enable child lock, slide the lock along the edge of the door. diff --git a/car-manual-skill/locale/en-us/manual.car.childlock.intent b/car-manual-skill/locale/en-us/manual.car.childlock.intent new file mode 100644 index 0000000..4314485 --- /dev/null +++ b/car-manual-skill/locale/en-us/manual.car.childlock.intent @@ -0,0 +1 @@ +How to enable child lock diff --git a/car-manual-skill/manifest.yml b/car-manual-skill/manifest.yml new file mode 100644 index 0000000..31cf59c --- /dev/null +++ b/car-manual-skill/manifest.yml @@ -0,0 +1,29 @@ + +# This file details all external dependencies required by your skill. If your skill does +# not require any dependencies, please delete this file before submitting a pull request. +# +# To use this file, uncomment the lines you need, and fill in the appropriate information. +# +# dependencies: +# # Pip dependencies on PyPI +# python: +# - requests +# - gensim +# +# # Install packages with the system package manager +# # This searches for the provided executable and uses the package names +# system: +# # For simple packages, this is all that is necessary +# all: pianobar piano-dev +# +# # If the package has a certain name on a different platform: +# pkcon: pianobar libpiano-dev # For the mycroft platform +# apt-get: pianobar libpiano-dev # For Ubuntu/Debian +# +# # Require certain executables to be in the PATH for the install to succeed +# exes: +# - pianobar +# +# # Require the installation of other skills before installing this skill +# skill: +# - my-other-skill diff --git a/car-manual-skill/settingsmeta.yaml b/car-manual-skill/settingsmeta.yaml new file mode 100644 index 0000000..c2ba770 --- /dev/null +++ b/car-manual-skill/settingsmeta.yaml @@ -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"