probonopd / ESP8266HueEmulator

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

Sync the time via NTP and use then data in the config. #69

Closed ensonic closed 7 years ago

ensonic commented 7 years ago

I've installed the libraries via the library manager in the arduino IDE, but I can can also try to patch the README.md to git clone them like you did for the other libs. Installing them though the library manager has the advantage that one can also update them that way.

probonopd commented 7 years ago

Thanks @ensonic. Please fix the Travis CI build that currently fails with

ESP8266HueEmulator.ino:10:21: fatal error: TimeLib.h: No such file or directory
compilation terminated.
ensonic commented 7 years ago

@probonopd will add the 2 git clone commands to travis.yml + README tonight.

probonopd commented 7 years ago

Thank you for this valuable contribution. How will this behave if the NTP server is unreachable?

ensonic commented 7 years ago

The time on the esp starts counting from 0, so if we have not synced, we send a wrong time. This is not much worse than no time, but I can send another PR to check if we have a time already and only add the fields to the config message in that case.

probonopd commented 7 years ago

That'd be great!

ensonic commented 7 years ago

Done. https://github.com/probonopd/ESP8266HueEmulator/pull/72