Intergated changes of original projects

This commit is contained in:
BPoH_Voodoo
2018-03-03 10:13:58 +01:00
parent e1857746f8
commit 23ddc2e86f
4 changed files with 54 additions and 7 deletions
+14
View File
@@ -611,9 +611,15 @@ void shortKeyPress() {
if (buttonState == false) {
setModeByStateString(BTN_MODE_SHORT);
buttonState = true;
#ifdef ENABLE_MQTT
mqtt_client.publish(mqtt_outtopic, String("OK =static white").c_str());
#endif
} else {
mode = OFF;
buttonState = false;
#ifdef ENABLE_MQTT
mqtt_client.publish(mqtt_outtopic, String("OK =off").c_str());
#endif
}
}
@@ -621,12 +627,20 @@ void shortKeyPress() {
void mediumKeyPress() {
DBG_OUTPUT_PORT.printf("Medium button press\n");
setModeByStateString(BTN_MODE_MEDIUM);
buttonState = true;
#ifdef ENABLE_MQTT
mqtt_client.publish(mqtt_outtopic, String("OK =fire flicker").c_str());
#endif
}
// called when button is kept pressed for 2 seconds or more
void longKeyPress() {
DBG_OUTPUT_PORT.printf("Long button press\n");
setModeByStateString(BTN_MODE_LONG);
buttonState = true;
#ifdef ENABLE_MQTT
mqtt_client.publish(mqtt_outtopic, String("OK =fireworks random").c_str());
#endif
}
void button() {