mirror of https://github.com/arendst/Tasmota.git
Adapt action for state 10
Adapt action to execute switch#state=10 as needed.
This commit is contained in:
parent
dbeb82c93e
commit
d24221da00
|
@ -37,7 +37,7 @@ const uint8_t AC_PERIOD = (20 + SWITCH_FAST_PROBE_INTERVAL - 1) / SWITCH_FAST_PR
|
|||
#define POWER_NONE 99
|
||||
|
||||
const char kSwitchPressStates[] PROGMEM =
|
||||
"||||POWER_INCREMENT|POWER_INV|POWER_CLEAR|POWER_RELEASE|POWER_100|POWER_DELAYED";
|
||||
"||||POWER_INCREMENT|POWER_INV|POWER_CLEAR|POWER_RELEASE|POWER_100||POWER_DELAYED";
|
||||
|
||||
#include <Ticker.h>
|
||||
|
||||
|
@ -245,7 +245,8 @@ void SwitchHandler(uint32_t mode) {
|
|||
SendKey(KEY_SWITCH, i +1, POWER_INCREMENT); // Execute command via MQTT
|
||||
}
|
||||
else if ((Switch.hold_timer[i] & ~SM_TIMER_MASK) == SM_FIRST_PRESS) {
|
||||
switchflag = POWER_DELAYED; // Toggle with pushbutton
|
||||
SendKey(KEY_SWITCH, i +1, POWER_DELAYED); // Execute command via MQTT
|
||||
mqtt_action = POWER_DELAYED;
|
||||
Switch.hold_timer[i] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -293,7 +293,8 @@ enum UploadTypes { UPL_TASMOTA = 1, UPL_SETTINGS, UPL_EFM8BB1, UPL_TASMOTACLIENT
|
|||
enum ExecuteCommandPowerOptions { POWER_OFF, POWER_ON, POWER_TOGGLE, POWER_BLINK, POWER_BLINK_STOP,
|
||||
POWER_OFF_NO_STATE = 8, POWER_ON_NO_STATE, POWER_TOGGLE_NO_STATE,
|
||||
POWER_SHOW_STATE = 16 };
|
||||
enum SendKeyPowerOptions { POWER_HOLD = 3, POWER_INCREMENT = 4, POWER_INV = 5, POWER_CLEAR = 6, POWER_RELEASE = 7, POWER_100 = 8, CLEAR_RETAIN = 9, POWER_DELAYED = 10};
|
||||
enum SendKeyPowerOptions { POWER_HOLD = 3, POWER_INCREMENT = 4, POWER_INV = 5, POWER_CLEAR = 6, POWER_RELEASE = 7,
|
||||
POWER_100 = 8, CLEAR_RETAIN = 9, POWER_DELAYED = 10 };
|
||||
enum SendKeyOptions { KEY_BUTTON, KEY_SWITCH };
|
||||
enum SendKeyMultiClick { SINGLE = 10, DOUBLE = 11, TRIPLE = 12, QUAD = 13, PENTA = 14};
|
||||
|
||||
|
|
Loading…
Reference in New Issue