works better for long pressed
This commit is contained in:
parent
6dfe9e363a
commit
52e4ea6dce
@ -8,7 +8,7 @@
|
||||
#ifndef DEFINES_H_
|
||||
#define DEFINES_H_
|
||||
|
||||
#define DEBUG
|
||||
// #define DEBUG
|
||||
// #define SLEEP
|
||||
|
||||
#define EEPROM_ADDR 0
|
||||
|
@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
|
||||
typedef enum { NOT_PRESSED, PRESSED, LONG_PRESSED } tPressedState;
|
||||
typedef enum { NOT_PRESSED, PRESSED, LONG_PRESSED_PREPARE, LONG_PRESSED } tPressedState;
|
||||
|
||||
|
||||
WiFiClientSecure espClient;
|
||||
@ -158,6 +158,9 @@ void loopProduction() {
|
||||
state = PRESSED;
|
||||
break;
|
||||
case PRESSED:
|
||||
state = LONG_PRESSED_PREPARE;
|
||||
break;
|
||||
case LONG_PRESSED_PREPARE:
|
||||
state = LONG_PRESSED;
|
||||
client.publish(configBlock.mqttTopic, "LONG_BEGIN");
|
||||
break;
|
||||
@ -171,6 +174,7 @@ void loopProduction() {
|
||||
case NOT_PRESSED:
|
||||
break;
|
||||
case PRESSED:
|
||||
case LONG_PRESSED_PREPARE:
|
||||
client.publish(configBlock.mqttTopic, "SHORT");
|
||||
break;
|
||||
case LONG_PRESSED:
|
||||
|
Loading…
x
Reference in New Issue
Block a user