Create car-smart-home-lights-skill
This commit is contained in:
parent
6db947e7ca
commit
cde98cc95a
|
@ -0,0 +1,4 @@
|
||||||
|
__pycache__/
|
||||||
|
*.qmlc
|
||||||
|
settings.json
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
# <img src="https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/lightbulb.svg" card_color="#FEE255" width="50" height="50" style="vertical-align:bottom"/> Car Smart Home Lights
|
||||||
|
Turns on/off the lights
|
||||||
|
|
||||||
|
## About
|
||||||
|
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
* "Turn on lights"
|
||||||
|
* "Open the lights"
|
||||||
|
* "Turn the lights on"
|
||||||
|
* "Open garage lights"
|
||||||
|
* "Turn the garage lights on"
|
||||||
|
* "Turn on the garage lights"
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
Firewalkers
|
||||||
|
|
||||||
|
## Category
|
||||||
|
**IoT**
|
||||||
|
|
||||||
|
## Tags
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
from mycroft import MycroftSkill, intent_file_handler
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
class CarSmartHomeLights(MycroftSkill):
|
||||||
|
def __init__(self):
|
||||||
|
MycroftSkill.__init__(self)
|
||||||
|
|
||||||
|
@intent_file_handler('lights.on.intent')
|
||||||
|
def turn_on_lights(self, message):
|
||||||
|
lights = self.settings.get("LIGHTS_API", "http://192.168.1.51:5000/")
|
||||||
|
requests.get(f"{lights}/on")
|
||||||
|
self.speak_dialog('lights.on')
|
||||||
|
|
||||||
|
@intent_file_handler('lights.off.intent')
|
||||||
|
def turn_off_lights(self, message):
|
||||||
|
lights = self.settings.get("LIGHTS_API", "http://192.168.1.51:5000/")
|
||||||
|
requests.get(f"{lights}/off")
|
||||||
|
self.speak_dialog('lights.off')
|
||||||
|
|
||||||
|
|
||||||
|
def create_skill():
|
||||||
|
return CarSmartHomeLights()
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Turning off the lights
|
|
@ -0,0 +1,6 @@
|
||||||
|
Turn off lights
|
||||||
|
Open the lights
|
||||||
|
Turn the lights off
|
||||||
|
Open garage lights
|
||||||
|
Turn the garage lights off
|
||||||
|
Turn off the garage lights
|
|
@ -0,0 +1 @@
|
||||||
|
Turning on the lights
|
|
@ -0,0 +1,6 @@
|
||||||
|
Turn on lights
|
||||||
|
Open the lights
|
||||||
|
Turn the lights on
|
||||||
|
Open garage lights
|
||||||
|
Turn the garage lights on
|
||||||
|
Turn on the garage lights
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
skillMetadata:
|
||||||
|
sections:
|
||||||
|
- name: API Paths
|
||||||
|
fields:
|
||||||
|
- name: LIGHTS_API
|
||||||
|
type: text
|
||||||
|
label: Lights API Base Path
|
||||||
|
value: "http://192.168.1.51:5000/"
|
||||||
|
placeholder: "http://192.168.1.51:5000/"
|
Loading…
Reference in New Issue