diff --git a/esphome/components/sensor/sensor.h b/esphome/components/sensor/sensor.h index 4308eafb12..efcada1411 100644 --- a/esphome/components/sensor/sensor.h +++ b/esphome/components/sensor/sensor.h @@ -161,7 +161,6 @@ class Sensor : public EntityBase { CallbackManager raw_callback_; ///< Storage for raw state callbacks. CallbackManager callback_; ///< Storage for filtered state callbacks. - bool has_state_{false}; Filter *filter_list_{nullptr}; ///< Store all active filters. optional unit_of_measurement_; ///< Unit of measurement override @@ -169,6 +168,7 @@ class Sensor : public EntityBase { optional device_class_; ///< Device class override optional state_class_{STATE_CLASS_NONE}; ///< State class override bool force_update_{false}; ///< Force update mode + bool has_state_{false}; }; } // namespace sensor