diff --git a/tasmota/support_switch.ino b/tasmota/support_switch.ino index 0c8d1e15a..485f932d9 100644 --- a/tasmota/support_switch.ino +++ b/tasmota/support_switch.ino @@ -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 @@ -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; } } diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 294384522..6adc7ffb3 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -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};