Add car manual voice skill
This commit is contained in:
		
							
								
								
									
										4
									
								
								car-manual-skill/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								car-manual-skill/.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
__pycache__/
 | 
			
		||||
*.qmlc
 | 
			
		||||
settings.json
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								car-manual-skill/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								car-manual-skill/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
# <img src="https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/info.svg" card_color="#8CE0FE" width="50" height="50" style="vertical-align:bottom"/> Car Manual
 | 
			
		||||
Gives information for your car
 | 
			
		||||
 | 
			
		||||
## About
 | 
			
		||||
Gives information for your car
 | 
			
		||||
 | 
			
		||||
## Examples
 | 
			
		||||
* "How to enable child lock"
 | 
			
		||||
 | 
			
		||||
## Credits
 | 
			
		||||
FireWalkers
 | 
			
		||||
 | 
			
		||||
## Category
 | 
			
		||||
**Information**
 | 
			
		||||
 | 
			
		||||
## Tags
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										35
									
								
								car-manual-skill/__init__.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								car-manual-skill/__init__.py
									
									
									
									
									
										Normal file
									
								
							@@ -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()
 | 
			
		||||
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
To enable child lock, slide the lock along the edge of the door.
 | 
			
		||||
@@ -0,0 +1 @@
 | 
			
		||||
How to enable child lock
 | 
			
		||||
							
								
								
									
										29
									
								
								car-manual-skill/manifest.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								car-manual-skill/manifest.yml
									
									
									
									
									
										Normal file
									
								
							@@ -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
 | 
			
		||||
							
								
								
									
										10
									
								
								car-manual-skill/settingsmeta.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								car-manual-skill/settingsmeta.yaml
									
									
									
									
									
										Normal 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"
 | 
			
		||||
		Reference in New Issue
	
	Block a user