ESPHome 2026.5.0-dev
Loading...
Searching...
No Matches
esphome::ld24xx::SensorWithDedup< T > Class Template Reference

Sensor with deduplication — sensor may be null, null check is internal. More...

#include <ld24xx.h>

Public Member Functions

void set_sensor (sensor::Sensor *sens)
 
void publish_state_if_not_dup (T state)
 
void publish_state_unknown ()
 
bool has_sensor () const
 
sensor::Sensorget_sensor () const
 

Protected Attributes

sensor::Sensorsens_ {nullptr}
 
Deduplicator< T > dedup_
 

Detailed Description

template<typename T>
class esphome::ld24xx::SensorWithDedup< T >

Sensor with deduplication — sensor may be null, null check is internal.

Stored inline, no heap allocation. Does nothing when no sensor is set.

Definition at line 67 of file ld24xx.h.

Member Function Documentation

◆ get_sensor()

template<typename T >
sensor::Sensor * esphome::ld24xx::SensorWithDedup< T >::get_sensor ( ) const
inline

Definition at line 87 of file ld24xx.h.

◆ has_sensor()

template<typename T >
bool esphome::ld24xx::SensorWithDedup< T >::has_sensor ( ) const
inline

Definition at line 86 of file ld24xx.h.

◆ publish_state_if_not_dup()

template<typename T >
void esphome::ld24xx::SensorWithDedup< T >::publish_state_if_not_dup ( T state)
inline

Definition at line 74 of file ld24xx.h.

◆ publish_state_unknown()

template<typename T >
void esphome::ld24xx::SensorWithDedup< T >::publish_state_unknown ( )
inline

Definition at line 80 of file ld24xx.h.

◆ set_sensor()

template<typename T >
void esphome::ld24xx::SensorWithDedup< T >::set_sensor ( sensor::Sensor * sens)
inline

Definition at line 69 of file ld24xx.h.

Field Documentation

◆ dedup_

template<typename T >
Deduplicator<T> esphome::ld24xx::SensorWithDedup< T >::dedup_
protected

Definition at line 91 of file ld24xx.h.

◆ sens_

template<typename T >
sensor::Sensor* esphome::ld24xx::SensorWithDedup< T >::sens_ {nullptr}
protected

Definition at line 90 of file ld24xx.h.


The documentation for this class was generated from the following file: