106 void setup()
override;
107 void dump_config()
override;
108 void update()
override;
109 void loop()
override;
135 INITIAL_SETUP_COMPLETED,
138 COLLECTING_DATA_AUTO,
141 ADJUSTMENT_IN_PROGRESS,
142 READY_TO_APPLY_ADJUSTMENTS,
143 READY_TO_PUBLISH_PART_1,
144 READY_TO_PUBLISH_PART_2,
145 READY_TO_PUBLISH_PART_3
146 } state_{State::NOT_INITIALIZED};
152 uint16_t als_counts{0};
153 uint16_t white_counts{0};
158 float fake_infrared_lux{0};
172 bool are_adjustments_required_(
Readings &data);
173 void apply_lux_calculation_(
Readings &data);
174 void apply_lux_compensation_(
Readings &data);
175 void apply_glass_attenuation_(
Readings &data);
176 void publish_data_part_1_(
Readings &data);
177 void publish_data_part_2_(
Readings &data);
178 void publish_data_part_3_(
Readings &data);
183 bool automatic_mode_enabled_{
true};
184 bool lux_compensation_enabled_{
true};
185 float glass_attenuation_factor_{1.0};
const float DATA
For components that import data from directly connected sensors like DHT.
void set_glass_attenuation_factor(float factor)
float get_setup_priority() const override
const uint8_t INTEGRATION_TIMES_COUNT
This class simplifies creating components that periodically check a state.
void set_white_counts_sensor(sensor::Sensor *sensor)
void set_integration_time(IntegrationTime time)
void set_enable_automatic_mode(bool enable)
void set_ambient_light_sensor(sensor::Sensor *sensor)
No error found during execution of method.
void set_infrared_sensor(sensor::Sensor *sensor)
void set_enable_lux_compensation(bool enable)
void set_ambient_light_counts_sensor(sensor::Sensor *sensor)
const uint8_t GAINS_COUNT
enum esphome::EntityCategory __attribute__
void set_white_sensor(sensor::Sensor *sensor)
void set_actual_gain_sensor(sensor::Sensor *sensor)
void set_actual_integration_time_sensor(sensor::Sensor *sensor)
Implementation of SPI Controller mode.
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
Base-class for all sensors.
This Class provides the methods to read/write bytes from/to an i2c device.
esphome::sensor::Sensor * sensor