From 0f6c798c420abf0ee4523f5789f47d0d2c8be31f Mon Sep 17 00:00:00 2001 From: Samuel Sieb Date: Sat, 23 Nov 2024 22:35:50 -0800 Subject: [PATCH] explicitly initialize state --- esphome/components/binary_sensor/binary_sensor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/binary_sensor/binary_sensor.h b/esphome/components/binary_sensor/binary_sensor.h index 301a472810..57cae9e2f5 100644 --- a/esphome/components/binary_sensor/binary_sensor.h +++ b/esphome/components/binary_sensor/binary_sensor.h @@ -58,7 +58,7 @@ class BinarySensor : public EntityBase, public EntityBase_DeviceClass { void publish_initial_state(bool state); /// The current reported state of the binary sensor. - bool state; + bool state{false}; void add_filter(Filter *filter); void add_filters(const std::vector &filters);