diff --git a/car-smart-home-lights-skill/.gitignore b/car-smart-home-lights-skill/.gitignore new file mode 100644 index 0000000..4eb3651 --- /dev/null +++ b/car-smart-home-lights-skill/.gitignore @@ -0,0 +1,4 @@ +__pycache__/ +*.qmlc +settings.json + diff --git a/car-smart-home-lights-skill/README.md b/car-smart-home-lights-skill/README.md new file mode 100644 index 0000000..8f304fd --- /dev/null +++ b/car-smart-home-lights-skill/README.md @@ -0,0 +1,22 @@ +# 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 + diff --git a/car-smart-home-lights-skill/__init__.py b/car-smart-home-lights-skill/__init__.py new file mode 100644 index 0000000..b83cf9c --- /dev/null +++ b/car-smart-home-lights-skill/__init__.py @@ -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() + diff --git a/car-smart-home-lights-skill/locale/en-us/lights.off.dialog b/car-smart-home-lights-skill/locale/en-us/lights.off.dialog new file mode 100644 index 0000000..81cb80f --- /dev/null +++ b/car-smart-home-lights-skill/locale/en-us/lights.off.dialog @@ -0,0 +1 @@ +Turning off the lights diff --git a/car-smart-home-lights-skill/locale/en-us/lights.off.intent b/car-smart-home-lights-skill/locale/en-us/lights.off.intent new file mode 100644 index 0000000..03dcd69 --- /dev/null +++ b/car-smart-home-lights-skill/locale/en-us/lights.off.intent @@ -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 diff --git a/car-smart-home-lights-skill/locale/en-us/lights.on.dialog b/car-smart-home-lights-skill/locale/en-us/lights.on.dialog new file mode 100644 index 0000000..2c1d54d --- /dev/null +++ b/car-smart-home-lights-skill/locale/en-us/lights.on.dialog @@ -0,0 +1 @@ +Turning on the lights diff --git a/car-smart-home-lights-skill/locale/en-us/lights.on.intent b/car-smart-home-lights-skill/locale/en-us/lights.on.intent new file mode 100644 index 0000000..220cbfc --- /dev/null +++ b/car-smart-home-lights-skill/locale/en-us/lights.on.intent @@ -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 diff --git a/car-smart-home-lights-skill/settingsmeta.yaml b/car-smart-home-lights-skill/settingsmeta.yaml new file mode 100644 index 0000000..082d527 --- /dev/null +++ b/car-smart-home-lights-skill/settingsmeta.yaml @@ -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/"