[template] Use a user provided default constructor for TemplateButton (#19124)

This commit is contained in:
J. Nick Koston
2026-09-16 20:37:41 +12:00
committed by GitHub
parent da73140c9c
commit cbb6600263
@@ -6,6 +6,9 @@ namespace esphome::template_ {
class TemplateButton final : public button::Button {
public:
// User provided, not "= default": `new(p) TemplateButton()` would zero-fill .bss that is already zero.
TemplateButton() {}
// Implements the abstract `press_action` but the `on_press` trigger already handles the press.
void press_action() override{};
};