Skip to content

Commit 8d2d121

Browse files
authored
Berry FUNC_ANY_KEY event calling any_key() (#21708)
1 parent 117eb79 commit 8d2d121

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88
- ESP32 support for power and energy limit checks, like ``MaxEnergy2`` per phase (#21695)
99
- Berry `tasmota.rtc("config_time")` (#21698)
1010
- Berry `math.min()` and `math.max()`
11+
- Berry `FUNC_ANY_KEY` event calling `any_key()`
1112

1213
### Breaking Changed
1314

tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,28 @@ bool Xdrv52(uint32_t function)
946946
case FUNC_SET_DEVICE_POWER:
947947
result = callBerryEventDispatcher(PSTR("set_power_handler"), nullptr, XdrvMailbox.index, nullptr);
948948
break;
949+
case FUNC_ANY_KEY:
950+
// XdrvMailbox.payload = device_save << 24 | key << 16 | state << 8 | device;
951+
// key 0 = KEY_BUTTON = button_topic
952+
// key 1 = KEY_SWITCH = switch_topic
953+
// state 0 = POWER_OFF = off
954+
// state 1 = POWER_ON = on
955+
// state 2 = POWER_TOGGLE = toggle
956+
// state 3 = POWER_HOLD = hold
957+
// state 4 = POWER_INCREMENT = button still pressed
958+
// state 5 = POWER_INV = button released
959+
// state 6 = POWER_CLEAR = button released
960+
// state 7 = POWER_RELEASE = button released
961+
// state 9 = CLEAR_RETAIN = clear retain flag
962+
// state 10 = POWER_DELAYED = button released delayed
963+
// Button Multipress
964+
// state 10 = SINGLE
965+
// state 11 = DOUBLE
966+
// state 12 = TRIPLE
967+
// state 13 = QUAD
968+
// state 14 = PENTA
969+
result = callBerryEventDispatcher("any_key", nullptr, XdrvMailbox.payload, nullptr);
970+
break;
949971
#ifdef USE_WEBSERVER
950972
case FUNC_WEB_ADD_CONSOLE_BUTTON:
951973
if (XdrvMailbox.index) {

0 commit comments

Comments
 (0)