mycroft-skills
mycroft-skills copied to clipboard
Add skill-iot-control
Info
This PR adds the new skill, skill-iot-control, to the skills repo.
Description
This Skill doesn't do anything by itself, but it provides an important common language for controlling Internet of Things (IoT) or Smart Home devices. By handling simple phrases like 'turn on', this one Skill can unify multiple other Skills that act as the interface into specific IoT devices or control ecosystems. This creates uniform and seamless interactions for the user!
Created with mycroft-skills-kit v0.3.13
https://github.com/MycroftAI/mycroft-core/pull/2150 on core will need to go in before this (to get the State
enum).
run test
I'm not familiar with this syntax and it's throwing a syntax error on my machine, preventing the skill from loading at all:
self.speech_requests: DefaultDict[str, List[SpeechRequest]] = defaultdict(list)
I'm assuming this is also why Jenkins can't run.
@krisgesling,
Those are type hints. I have used them in some places in mycroft core, but this may be the first time I've submitted a skill that had them. Assuming this runs against the same versions of Python as Mycroft core (from the trace below, it looks like it's 3.6, which should support them), I wouldn't expect that to be the issue here.
Looking at the test output, I see:
ATTEMPTING TO LOAD SKILL: skill-iot-control.mycroftai with ID test-skill-iot-control.mycroftai
Failed to load skill: skill-iot-control.mycroftai
Traceback (most recent call last):
File "/app/mycroft-core/mycroft/skills/core.py", line 128, in load_skill
imp.PY_SOURCE))
File "/usr/lib/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/usr/lib/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/mycroft/skills/skill-iot-control.mycroftai/__init__.py", line 26, in <module>
from mycroft.skills.common_iot_skill import \
ImportError: cannot import name 'Attribute'
So it looks like the issue here is actually that this is running against 19.02, but it needs features from dev
. I expected this to run against dev
(hence the comment about https://github.com/MycroftAI/mycroft-core/pull/2150 needing to be merged first), but am realizing now I was forgetting how this process is intended to work.
I suppose this has to sit until testing for the release begins?
-Christopher
Run test
:champagne: :tada:
Worth noting, the Mark-1 is still on python 3.4 and could possibly have issues with the type hints. So would be best to check that platform explicitly. Though if it's the same that are used in core they should be supported.
If I'm not mistaken this will require Python 3.6, it seems to be a variable annotation defined in PEP 526
It looks like the only place in core that I also put type hints is https://github.com/MycroftAI/mycroft-core/blob/dev/mycroft/skills/common_iot_skill.py, which isn't used/won't be used until this skill goes in, which is probably how it's managed to slide in without impacting anything yet. For the 3.4 support, we'll probably have to pull the hints out from that file, as well as from this skill.