├── .gitignore ├── locale └── en-us │ ├── control.light.on.intent │ ├── control.light.off.intent │ ├── control.light.party.intent │ ├── control.light.on.dialog │ ├── control.light.party.dialog │ ├── control.light.off.dialog │ ├── control.light.color.dialog │ └── control.light.color.intent ├── README.md ├── settingsmeta.yaml ├── LICENSE.md └── __init__.py /.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__/ 2 | *.qmlc 3 | settings.json 4 | 5 | -------------------------------------------------------------------------------- /locale/en-us/control.light.on.intent: -------------------------------------------------------------------------------- 1 | (turn the | ) (light | lights) on 2 | (go | ) bright -------------------------------------------------------------------------------- /locale/en-us/control.light.off.intent: -------------------------------------------------------------------------------- 1 | (turn the | ) (light | lights) off 2 | (go | ) dark 3 | -------------------------------------------------------------------------------- /locale/en-us/control.light.party.intent: -------------------------------------------------------------------------------- 1 | (turn the | ) party (on | up | ) 2 | (lets | ) rock -------------------------------------------------------------------------------- /locale/en-us/control.light.on.dialog: -------------------------------------------------------------------------------- 1 | Lights are on! 2 | You have been illuminated. 3 | Sunshine, baby! -------------------------------------------------------------------------------- /locale/en-us/control.light.party.dialog: -------------------------------------------------------------------------------- 1 | Get the party started! 2 | Let's rock, baby! 3 | Now we are talking! -------------------------------------------------------------------------------- /locale/en-us/control.light.off.dialog: -------------------------------------------------------------------------------- 1 | Lights are off! 2 | You are in the dark now. 3 | Shutdown initiated. 4 | -------------------------------------------------------------------------------- /locale/en-us/control.light.color.dialog: -------------------------------------------------------------------------------- 1 | Lights will change color. 2 | Initiating color change. 3 | Color change under way. 4 | -------------------------------------------------------------------------------- /locale/en-us/control.light.color.intent: -------------------------------------------------------------------------------- 1 | color change 2 | (new | change | different | other | next) (light | lights | ) color 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Light Control 2 | Controls lights in the floor. 3 | 4 | ## About 5 | Issues http requests to our esp32 microcontroller who sends ir commands to the floor lights. 6 | 7 | ## Examples 8 | * "Lights on" 9 | * "Lights off" 10 | * "Lights color" 11 | 12 | ## Credits 13 | Silvan Buedenbender 14 | 15 | ## Category 16 | **IoT** 17 | Daily 18 | 19 | ## Tags 20 | #Light 21 | #Remote 22 | #Control 23 | 24 | -------------------------------------------------------------------------------- /settingsmeta.yaml: -------------------------------------------------------------------------------- 1 | 2 | skillMetadata: 3 | sections: 4 | - name: Options << Name of section 5 | fields: 6 | - name: internal_python_variable_name 7 | type: text 8 | label: Setting Friendly Display Name 9 | value: "" 10 | placeholder: demo prompt in the input box 11 | - name: Login << Name of another section 12 | fields: 13 | - type: label 14 | label: Just a little bit of extra info for the user to understand following settings 15 | - name: username 16 | type: text 17 | label: Username 18 | value: "" 19 | - name: password 20 | type: password 21 | label: Password 22 | value: "" 23 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 Yoshimasa Niwa 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from mycroft import MycroftSkill, intent_handler 2 | import urllib.request 3 | 4 | ESP_HOST = 'http://esp32.local' 5 | 6 | POWER_ROUTE = '/power' 7 | COLOR_ROUTE = '/color' 8 | COLOR_ROUTE = '/party' 9 | 10 | POWER_REQUEST = urllib.request.Request(url=f'{ESP_HOST}{POWER_ROUTE}', method='POST') 11 | COLOR_REQUEST = urllib.request.Request(url=f'{ESP_HOST}{COLOR_ROUTE}', method='POST') 12 | PARTY_REQUEST = urllib.request.Request(url=f'{ESP_HOST}{PARTY_ROUTE}', method='POST') 13 | 14 | def toggle_power(): 15 | urllib.request.urlopen(POWER_REQUEST) 16 | 17 | def toggle_color(): 18 | urllib.request.urlopen(COLOR_REQUEST) 19 | 20 | def toggle_party(): 21 | urllib.request.urlopen(PARTY_REQUEST) 22 | 23 | 24 | class LightControl(MycroftSkill): 25 | def __init__(self): 26 | MycroftSkill.__init__(self) 27 | 28 | @intent_handler('control.light.on.intent') 29 | def handle_light_on(self, message): 30 | self.speak_dialog('control.light.on') 31 | toggle_power() 32 | 33 | @intent_handler('control.light.off.intent') 34 | def handle_light_off(self, message): 35 | self.speak_dialog('control.light.off') 36 | toggle_power() 37 | 38 | @intent_handler('control.light.color.intent') 39 | def handle_light_color(self, message): 40 | self.speak_dialog('control.light.color') 41 | toggle_color() 42 | 43 | @intent_handler('control.light.party.intent') 44 | def handle_light_color(self, message): 45 | self.speak_dialog('control.light.party') 46 | toggle_party() 47 | 48 | def create_skill(): 49 | return LightControl() 50 | --------------------------------------------------------------------------------