[binary_sensor] Use a user provided default constructor (#19111)

This commit is contained in:
J. Nick Koston
2026-09-16 18:15:51 +12:00
committed by GitHub
parent 11ce3594c0
commit 274bfe7aee
@@ -32,7 +32,8 @@ void log_binary_sensor(const char *tag, const char *prefix, const char *type, Bi
*/
class BinarySensor : public StatefulEntityBase<bool> {
public:
explicit BinarySensor() = default;
// User provided, not "= default": `new(p) BinarySensor()` would zero-fill .bss that is already zero.
explicit BinarySensor() {}
const bool &get_state() const override { return this->state; }
void set_trigger_on_initial_state(bool value) { this->trigger_on_initial_state_ = value; }