mirror of
https://github.com/arendst/Tasmota.git
synced 2026-07-27 20:05:46 +00:00
Fix default button/switch actions on builds without rules (#24871)
RulesProcessEvent() in xdrv_10_system_events.ino (which owns the Xdrv10 slot when neither USE_RULES nor USE_SCRIPT is compiled) returned true unconditionally. SendKey() interprets true as "event serviced", so the default ButtonN -> ExecuteCommandPower action never executed: the press was logged (BTN: ButtonN multi-press 1) but the relay never toggled. Return false instead, mirroring xdrv_10_rules.ino's 'serviced' semantics where true means a rule actually consumed the event.
This commit is contained in:
@@ -403,7 +403,11 @@ bool RulesProcessEvent(const char *json_event) {
|
||||
// (allocation/toUpperCase) and keeps a documented hook for future consumers.
|
||||
|
||||
SystemEvents.busy = false;
|
||||
return true;
|
||||
// Return false ("not serviced"), mirroring xdrv_10_rules.ino's `serviced` semantics where
|
||||
// true means a rule actually consumed the event. There are no rule sets in this build mode,
|
||||
// so returning true made SendKey() consider every button/switch event handled and the
|
||||
// default ButtonN -> ExecuteCommandPower action never ran (button press logged, no toggle).
|
||||
return false;
|
||||
}
|
||||
|
||||
// Local `RulesProcess` stub — mirrors xdrv_10_rules.ino's `RulesProcess` shape so the
|
||||
|
||||
Reference in New Issue
Block a user