diff --git a/esphome/components/ld2410/ld2410.h b/esphome/components/ld2410/ld2410.h index e419278fa1b..31186b135f2 100644 --- a/esphome/components/ld2410/ld2410.h +++ b/esphome/components/ld2410/ld2410.h @@ -129,8 +129,8 @@ class LD2410Component : public Component, public uart::UARTDevice { std::array gate_still_threshold_numbers_{}; #endif #ifdef USE_SENSOR - std::array, TOTAL_GATES> gate_move_sensors_{}; - std::array, TOTAL_GATES> gate_still_sensors_{}; + std::array, TOTAL_GATES> gate_move_sensors_{}; + std::array, TOTAL_GATES> gate_still_sensors_{}; #endif }; diff --git a/esphome/components/ld2412/ld2412.h b/esphome/components/ld2412/ld2412.h index f69fce93f00..306e7ae31d2 100644 --- a/esphome/components/ld2412/ld2412.h +++ b/esphome/components/ld2412/ld2412.h @@ -133,8 +133,8 @@ class LD2412Component : public Component, public uart::UARTDevice { std::array gate_still_threshold_numbers_{}; #endif #ifdef USE_SENSOR - std::array, TOTAL_GATES> gate_move_sensors_{}; - std::array, TOTAL_GATES> gate_still_sensors_{}; + std::array, TOTAL_GATES> gate_move_sensors_{}; + std::array, TOTAL_GATES> gate_still_sensors_{}; #endif }; diff --git a/esphome/components/ld2450/ld2450.h b/esphome/components/ld2450/ld2450.h index 0e2be529e8f..10f9bb874a4 100644 --- a/esphome/components/ld2450/ld2450.h +++ b/esphome/components/ld2450/ld2450.h @@ -182,15 +182,15 @@ class LD2450Component : public Component, public uart::UARTDevice { ZoneOfNumbers zone_numbers_[MAX_ZONES]; #endif #ifdef USE_SENSOR - std::array, MAX_TARGETS> move_x_sensors_{}; - std::array, MAX_TARGETS> move_y_sensors_{}; - std::array, MAX_TARGETS> move_speed_sensors_{}; - std::array, MAX_TARGETS> move_angle_sensors_{}; - std::array, MAX_TARGETS> move_distance_sensors_{}; - std::array, MAX_TARGETS> move_resolution_sensors_{}; - std::array, MAX_ZONES> zone_target_count_sensors_{}; - std::array, MAX_ZONES> zone_still_target_count_sensors_{}; - std::array, MAX_ZONES> zone_moving_target_count_sensors_{}; + std::array, MAX_TARGETS> move_x_sensors_{}; + std::array, MAX_TARGETS> move_y_sensors_{}; + std::array, MAX_TARGETS> move_speed_sensors_{}; + std::array, MAX_TARGETS> move_angle_sensors_{}; + std::array, MAX_TARGETS> move_distance_sensors_{}; + std::array, MAX_TARGETS> move_resolution_sensors_{}; + std::array, MAX_ZONES> zone_target_count_sensors_{}; + std::array, MAX_ZONES> zone_still_target_count_sensors_{}; + std::array, MAX_ZONES> zone_moving_target_count_sensors_{}; #endif #ifdef USE_TEXT_SENSOR std::array direction_text_sensors_{}; diff --git a/esphome/components/ld24xx/ld24xx.h b/esphome/components/ld24xx/ld24xx.h index 6dbebb4e1bb..f919bd1c33d 100644 --- a/esphome/components/ld24xx/ld24xx.h +++ b/esphome/components/ld24xx/ld24xx.h @@ -11,7 +11,7 @@ #define SUB_SENSOR_WITH_DEDUP(name, dedup_type) \ protected: \ - ld24xx::LazySensorWithDedup name##_sensor_{}; \ + ld24xx::SensorWithDedup name##_sensor_{}; \ \ public: \ void set_##name##_sensor(sensor::Sensor *sensor) { this->name##_sensor_.set_sensor(sensor); } @@ -69,9 +69,8 @@ inline void format_version_str(const uint8_t *version, std::span buffe #ifdef USE_SENSOR /// Sensor with deduplication — sensor may be null, null check is internal. -/// Analogous to LazyCallbackManager: does nothing when no sensor is set, -/// avoids heap allocation by storing everything inline. -template class LazySensorWithDedup { +/// Stored inline, no heap allocation. Does nothing when no sensor is set. +template class SensorWithDedup { public: void set_sensor(sensor::Sensor *sens) { this->sens_ = sens; }