Create car-smart-home-lights-skill

This commit is contained in:
Ceda EI 2021-01-06 12:31:52 +05:30
parent 6db947e7ca
commit cde98cc95a
8 changed files with 74 additions and 0 deletions

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/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

View File

@ -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()

View File

@ -0,0 +1 @@
Turning off the lights

View File

@ -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

View File

@ -0,0 +1 @@
Turning on the lights

View File

@ -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

View File

@ -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/"