probonopd / ESP8266HueEmulator

Emulate a Philips Hue bridge running on an ESP8266 using the Arduino IDE.
MIT License
411 stars 93 forks source link

Fix for JSON response to /light/n/state commands #88

Closed Quanghoster closed 6 years ago

Quanghoster commented 6 years ago

addSingleLightJson added with correct structure for response. Also see comments in https://github.com/probonopd/ESP8266HueEmulator/issues/62

dtila commented 6 years ago

Correct me if I am wrong, but from the merge result https://github.com/probonopd/ESP8266HueEmulator/commit/b072276373b47e2936086263f0346785f0c3d6da I see just you added a new function AddSingleLightJson, where it's a copy paste of the existing addLightJson. The functionality is the same, even less, since it does not respect the DIMMABLE_LIGHT functionality which I have added in a previous commit.

Am I mistaken ?

Quanghoster commented 6 years ago

No, their is a difference in the way that the Json is built. Previously the echo was reporting an error to in the response On 30 Oct 2017 08:06, Daniel notifications@github.com wrote:Correct me if I am wrong, but from the merge result b072276 I see just you added a new function AddSingleLightJson, where it's a copy paste of the existing addLightJson. The functionality is the same, even less, since it does not respect the DIMMABLE_LIGHT functionality which I have added in a previous commit. Am I mistaken ?

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.

dtila commented 6 years ago

Do you have an example of the built JSON ? I am curios how is it different (except the color arguments which they were expected).

Just looking at the code, I could deduce that Alexa does not have support for Dimmable Light, so it thinks that the JSON is invalid. I don't have an Alexa to check, but it looks strange ...

Quanghoster commented 6 years ago

Probably easiest for you to print both to  the serial port to see the difference . I used Wireshark to see what was sent by a different emulator that the echo accepted to figure it out. Works perfectly now for on off and dimOn 30 Oct 2017 08:30, Daniel notifications@github.com wrote:Do you have an example of the built JSON ? I am curios how is it different (except the color arguments which they were expected). Just looking at the code, I could deduce that Alexa does not have support for Dimmable Light, so it thinks that the JSON is invalid. I don't have an Alexa to check, but it looks strange ...

—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.