27 void setup()
override;
52 this->on_ps_high_trigger_callback_.add(std::forward<F>(callback));
135 SUB_SENSOR(ambient_light)
136 SUB_SENSOR(full_spectrum_counts)
137 SUB_SENSOR(infrared_counts)
138 SUB_SENSOR(actual_gain)
139 SUB_SENSOR(actual_integration_time)
140 SUB_SENSOR(proximity_counts)
143 bool is_any_als_sensor_enabled_()
const {
144 return this->ambient_light_sensor_ !=
nullptr || this->full_spectrum_counts_sensor_ !=
nullptr ||
145 this->infrared_counts_sensor_ !=
nullptr || this->actual_gain_sensor_ !=
nullptr ||
146 this->actual_integration_time_sensor_ !=
nullptr;
148 bool is_any_ps_sensor_enabled_()
const {
return this->proximity_counts_sensor_ !=
nullptr; }
150 CallbackManager<void()> on_ps_high_trigger_callback_;
This class simplifies creating components that periodically check a state.
This Class provides the methods to read/write bytes from/to an i2c device.
void publish_data_part_2_(AlsReadings &data)
void set_ltr_type(LtrType type)
void configure_integration_time_(IntegrationTime time)
IntegrationTime integration_time_
enum esphome::ltr_als_ps::LTRAlsPsComponent::State NOT_INITIALIZED
bool check_part_number_()
LtrDataAvail is_als_data_ready_(AlsReadings &data)
SUB_SENSOR(ambient_light) SUB_SENSOR(full_spectrum_counts) SUB_SENSOR(infrared_counts) SUB_SENSOR(actual_gain) SUB_SENSOR(actual_integration_time) SUB_SENSOR(proximity_counts) protected CallbackManager< void()> on_ps_low_trigger_callback_
uint16_t ps_threshold_low_
void set_als_meas_repeat_rate(MeasurementRepeatRate rate)
void read_sensor_data_(AlsReadings &data)
void set_als_auto_mode(bool enable)
float glass_attenuation_factor_
void add_on_ps_high_trigger_callback(F &&callback)
void set_ps_gain(PsGain gain)
MeasurementRepeatRate repeat_rate_
bool automatic_mode_enabled_
void set_als_gain(AlsGain gain)
void dump_config() override
uint32_t last_ps_low_trigger_time_
void configure_gain_(AlsGain gain)
void set_ps_cooldown_time_s(uint16_t time)
uint16_t ps_threshold_high_
void set_ps_low_threshold(uint16_t threshold)
void add_on_ps_low_trigger_callback(F &&callback)
uint16_t ps_cooldown_time_s_
void set_ps_high_threshold(uint16_t threshold)
void publish_data_part_1_(AlsReadings &data)
bool are_adjustments_required_(AlsReadings &data)
void check_and_trigger_ps_()
struct esphome::ltr_als_ps::LTRAlsPsComponent::AlsReadings als_readings_
void set_als_glass_attenuation_factor(float factor)
uint32_t last_ps_high_trigger_time_
void apply_lux_calculation_(AlsReadings &data)
void set_als_integration_time(IntegrationTime time)
IntegrationTime integration_time
uint8_t number_of_adjustments