diff --git a/car-mode-switches-skill/.gitignore b/car-mode-switches-skill/.gitignore new file mode 100644 index 0000000..4eb3651 --- /dev/null +++ b/car-mode-switches-skill/.gitignore @@ -0,0 +1,4 @@ +__pycache__/ +*.qmlc +settings.json + diff --git a/car-mode-switches-skill/README.md b/car-mode-switches-skill/README.md new file mode 100644 index 0000000..7b59c72 --- /dev/null +++ b/car-mode-switches-skill/README.md @@ -0,0 +1,22 @@ +# Car Mode Switches +Switches to various modes from audio + +## About +Switches to various modes from audio + +## Examples +* "Enable pet mode" +* "Start pet mode" +* "Turn on pet mode" +* "Enable child mode" +* "Start child mode" +* "Turn on child mode" + +## Credits +Firewalkers + +## Category +**Productivity** + +## Tags + diff --git a/car-mode-switches-skill/__init__.py b/car-mode-switches-skill/__init__.py new file mode 100644 index 0000000..49b56af --- /dev/null +++ b/car-mode-switches-skill/__init__.py @@ -0,0 +1,37 @@ +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 CarModeSwitches(MycroftSkill): + def __init__(self): + MycroftSkill.__init__(self) + + @intent_file_handler('switches.mode.pet.intent') + def handle_switches_mode_car(self, message): + url = self.settings.get("OSD_API", "http://localhost:5050/send") + emit(url, "switchPlugin", {"plugin": "petMode"}) + self.speak_dialog('switches.mode.pet') + + @intent_file_handler('switches.mode.smart_home.intent') + def handle_switches_mode_car(self, message): + url = self.settings.get("OSD_API", "http://localhost:5050/send") + emit(url, "switchPlugin", {"plugin": "smartHome"}) + self.speak_dialog('switches.mode.smart_home') + + @intent_file_handler('switches.mode.maps.intent') + def handle_switches_mode_car(self, message): + url = self.settings.get("OSD_API", "http://localhost:5050/send") + emit(url, "switchPlugin", {"plugin": "maps"}) + self.speak_dialog('switches.mode.maps') + + +def create_skill(): + return CarModeSwitches() diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.maps.dialog b/car-mode-switches-skill/locale/en-us/switches.mode.maps.dialog new file mode 100644 index 0000000..6e697c6 --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.maps.dialog @@ -0,0 +1 @@ +Showing maps diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.maps.intent b/car-mode-switches-skill/locale/en-us/switches.mode.maps.intent new file mode 100644 index 0000000..ff37cdb --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.maps.intent @@ -0,0 +1,8 @@ +Enable maps +Start maps +Turn on maps +Display maps +Enable map +Start map +Turn on map +Display map diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.pet.dialog b/car-mode-switches-skill/locale/en-us/switches.mode.pet.dialog new file mode 100644 index 0000000..ae3d548 --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.pet.dialog @@ -0,0 +1 @@ +Turning on pet mode diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.pet.intent b/car-mode-switches-skill/locale/en-us/switches.mode.pet.intent new file mode 100644 index 0000000..4d45b10 --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.pet.intent @@ -0,0 +1,6 @@ +Enable pet mode +Start pet mode +Turn on pet mode +Enable child mode +Start child mode +Turn on child mode diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.dialog b/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.dialog new file mode 100644 index 0000000..9ca4db0 --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.dialog @@ -0,0 +1 @@ +Showing garage view diff --git a/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.intent b/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.intent new file mode 100644 index 0000000..88df783 --- /dev/null +++ b/car-mode-switches-skill/locale/en-us/switches.mode.smart_home.intent @@ -0,0 +1,6 @@ +Enable smart home +Start smart home +Turn on smart home +Show me my garage +Show me garage +Show me my house diff --git a/car-mode-switches-skill/settingsmeta.yaml b/car-mode-switches-skill/settingsmeta.yaml new file mode 100644 index 0000000..c2ba770 --- /dev/null +++ b/car-mode-switches-skill/settingsmeta.yaml @@ -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"