diff --git a/__init__.py b/__init__.py index 87479a8..3d95be0 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,8 @@ from ovos_utils.process_utils import RuntimeRequirements from ovos_workshop.decorators import intent_handler from ovos_workshop.skills import OVOSSkill - +from serial import Serial +import os DEFAULT_SETTINGS = { "log_level": "WARNING" @@ -68,12 +69,18 @@ """ return self.settings.get("log_level", "INFO") - @intent_handler(IntentBuilder("LightsOn.intent") + @intent_handler("LightsOn.intent") def handle_lights_on_intent(self, message): + if os.path.exists('/dev/ttyUSB0'): + with Serial(port='/dev/ttyUSB0', baudrate=115200) as s: + s.write('p0,0,3\nw0\n'.encode()) self.speak_dialog("lights.on") - @intent_handler(IntentBuilder("LightsOff.intent") + @intent_handler("LightsOff.intent") def handle_lights_off_intent(self, message): + if os.path.exists('/dev/ttyUSB0'): + with Serial(port='/dev/ttyUSB0', baudrate=115200) as s: + s.write('z0\n'.encode()) self.speak_dialog("lights.off") #@intent_handler(IntentBuilder("ThankYouIntent").require("ThankYouKeyword")) diff --git a/locale/en-us/intents/LightsOff.intent b/locale/en-us/intents/LightsOff.intent index 496fb55..584e24f 100644 --- a/locale/en-us/intents/LightsOff.intent +++ b/locale/en-us/intents/LightsOff.intent @@ -1,2 +1,4 @@ -turn off the light(s|) +turn off the lights +turn off the light lights off +light off diff --git a/locale/en-us/intents/LightsOn.intent b/locale/en-us/intents/LightsOn.intent index cce4269..d95c405 100644 --- a/locale/en-us/intents/LightsOn.intent +++ b/locale/en-us/intents/LightsOn.intent @@ -1,2 +1,4 @@ -turn on the light(s|) -light(s|) on +turn on the lights +turn on the light +lights on +light on diff --git a/requirements.txt b/requirements.txt index b028255..6c4bcce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ ovos-utils>=0.0.38 ovos-workshop>=0.0.15,<3.0.0 +pyserial>=3.5 diff --git a/setup.py b/setup.py index cc5d1e5..3da4df9 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup from os import walk, path -URL = "https://git.baldurkeep.com/logxen/skill-ovos-flowtoys.git" +URL = "https://github.com/logxen/skill-ovos-flowtoys" SKILL_CLAZZ = "FlowtoysSkill" # needs to match __init__.py class name PYPI_NAME = "ovos-skill-flowtoys" # pip install PYPI_NAME diff --git a/version.py b/version.py index 1f23b29..a43aa3e 100644 --- a/version.py +++ b/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 1 -VERSION_BUILD = 8 +VERSION_BUILD = 9 VERSION_ALPHA = 1 # END_VERSION_BLOCK