probonopd / ESP8266HueEmulator

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

Rework HTTP callbacks to be cleaner #54

Closed opticron closed 7 years ago

opticron commented 7 years ago

To make this more maintainable, I have reworked the the HTTP callbacks to be based on a WildcardRequestHandler instead of being all stuck inside the 404 handler. I have also added the option to be able to pass the HTTP server into the library so that this library can play nicely with other interfaces on the same server. Externally to the library nothing has changed except for a new optional constructor. This will help keep modifications to the API a bit cleaner in the future.

Side note: The friend with a Hue bridge and iOS isn't setup for packet capture, but I am and I'm borrowing the bridge and a light this weekend to see if I can knock things out. As a workaround, create the first group with no lights, then edit the group to deselect "add default scenes" and add all the lights you want. This appears to avoid the hang for now.

probonopd commented 7 years ago

Great work, but for some reason it is not building anymore on Travis CI. Possibly due to other versions of the dependency being needed now.

Please have a look at the build log and feel free to adjust the .travis.yml file as needed.

opticron commented 7 years ago

Apparently some of the old scene code didn't get removed and just wasn't causing compilation issues on my end. This next check should pass.