add actuator

Possibility to command a pin HIGH/LOW by MQTT #192
This commit is contained in:
Florian committed 2018-04-10 22:18:35 +02:00
1 parent c40bcfeda9
commit bdac0e1713
6 files changed
+109 -3

No files matched your search

+10
View File
@@ -295,6 +295,9 @@ void setup()
#ifdef ZsensorTSL2561
setupZsensorTSL2561();
#endif
#ifdef ZactuatorONOFF
setupONOFF();
#endif
#ifdef ZgatewayIR
setupIR();
#endif
@@ -681,6 +684,9 @@ digitalWrite(led_send, LOW);
#ifdef ZgatewayRFM69
MQTTtoRFM69(topicOri, datacallback);
#endif
#ifdef ZactuatorONOFF
MQTTtoONOFF(topicOri, datacallback);
#endif
//YELLOW OFF
digitalWrite(led_send, HIGH);
}
@@ -715,6 +721,10 @@ void revert_hex_data(char * in, char * out, int l){
out[l-1] = '\0';
}
bool to_bool(String const& s) { // thanks Chris Jester-Young from stackoverflow
return s != "0";
}
//trace
void trc(String msg){
if (TRACE) {