ChristopherRogers1991/mycroft-hue

Execution error

Closed this issue · 3 comments

Hello

With the latest core commit, after i try to do some actions, i see that the command gets routed to the Philips Hue skill but then a error appears and the execution off the command ends in error.

2016-12-28 21:10:07,364 - Skills - DEBUG - {"type": "recognizer_loop:wakeword", "data": {"session": "d67897f5-3e02-4a85-837e-257b7bf063d5", "utterance": "hey mycroft"}, "context": null}
2016-12-28 21:10:09,530 - Skills - DEBUG - {"type": "recognizer_loop:utterance", "data": {"session": "d67897f5-3e02-4a85-837e-257b7bf063d5", "utterances": ["turn on my lights"]}, "context": null}
2016-12-28 21:10:09,563 - Skills - DEBUG - {"type": "ToggleIntent", "data": {"LightsKeyword": "lights", "confidence": 0.39215686274509803, "target": null, "intent_type": "ToggleIntent", "OnKeyword": "on", "utterance": "turn on my lights"}, "context": {"target": null}}
2016-12-28 21:10:09,566 - mycroft.skills.core - ERROR - An error occurred while processing a request in PhillipsHueSkill
Traceback (most recent call last):
  File "/home/leonari/mycroft-core/mycroft/skills/core.py", line 200, in receive_handler
    handler(message)
  File "/home/leonari/.mycroft/skills/PhillipsHueSkill/__init__.py", line 65, in handler
    if message.message_type == 'ConnectLightsIntent' \
AttributeError: 'Message' object has no attribute 'message_type'
2016-12-28 21:10:09,571 - Skills - DEBUG - {"type": "speak", "data": {"utterance": "An error occurred while processing a request in PhillipsHueSkill"}, "context": null}

Config:

"PhillipsHueSkill": {            
  "ip": "192.168.1.121",         
  "username": "testeteste",      
  "verbose": true,               
  "brightness_step": 50,         
  "color_temperature_step": 1000,
  "default_group": 0             
}                        

With or without username, the result is the same.

Best regards.

Sorry, about that. It looks like there were some API changes in this commit as well as this one (changed message.metadata to message.data and message.message_type to message.type respectively).

As I mentioned on the other issue, I'm limited in what I can test at the moment (won't have access to my lights until January), but I pushed up some code to issues/issue-3 which should account for those changes. With that branch, I was able to at least try the 'Connect my lights' phrase, which resulted in the correct behavior (attempted to find a bridge on my network - as far as I can go at the moment).

If you want to cd into the mycroft-hue directory, and run:

git fetch && git checkout issues/issue-3

That should resolve this one (that branch also has the fixes from issue-2).

Thanks for flagging this! Let me know if it works, and please continue to flag any other issues. I'll keep doing what I can from here, and will do some proper testing/get all of these fixes merged to master when I get back home next week.

Best,

Chris

It works!! Thanks again!! :) so far i have only tested the on/off function with the default group and a another specific group and everything is working fine! Thanks a lot for your effort :)

Best regards.

Changes merged to master with #4.