mirror of
https://github.com/esphome/esphome.git
synced 2026-09-18 02:28:42 +00:00
[template] Use a user provided default constructor for TemplateBinarySensor (#19128)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user