finally a working modularized version

This commit is contained in:
2016-04-10 00:20:50 +02:00
parent 73395170ac
commit 52c4648c02
3 changed files with 5 additions and 8 deletions

View File

@ -88,9 +88,8 @@ bool DeviceLed::ledColorHandler(String message) {
}
void DeviceLed::homieRegister() {
// TODO this doesn't work :-(
//ledNode.subscribe("on", &DeviceLed::ledOnHandler());
//ledNode.subscribe("color", &DeviceLed::ledColorHandler());
ledNode.subscribe("on", [this](String value) { return ledOnHandler(value); });
ledNode.subscribe("color", std::bind(&DeviceLed::ledColorHandler, this, std::placeholders::_1));
Homie.registerNode(ledNode);
}