[template] Use a user provided default constructor for TemplateBinarySensor (#19128)

This commit is contained in:
J. Nick Koston
2026-09-16 20:32:27 +12:00
committed by GitHub
parent 9a76f1be4f
commit 0c1cf6d0a9
@@ -8,6 +8,8 @@ namespace esphome::template_ {
class TemplateBinarySensor final : public Component, public binary_sensor::BinarySensor {
public:
// User provided, not "= default": `new(p) TemplateBinarySensor()` would zero-fill .bss that is already zero.
TemplateBinarySensor() {}
template<typename F> void set_template(F &&f) { this->f_.set(std::forward<F>(f)); }
void setup() override;