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:
mikep1998
2026-07-03 14:23:31 +02:00
committed by GitHub
parent d87c17af21
commit a3ac5bab3d
@@ -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