103 void setup()
override;
106 void loop()
override;
117 SUB_SENSOR(ambient_light)
118 SUB_SENSOR(ambient_light_counts)
120 SUB_SENSOR(white_counts)
122 SUB_SENSOR(actual_gain)
123 SUB_SENSOR(actual_integration_time)
130 enum class State : uint8_t {
132 INITIAL_SETUP_COMPLETED,
135 COLLECTING_DATA_AUTO,
138 ADJUSTMENT_IN_PROGRESS,
139 READY_TO_APPLY_ADJUSTMENTS,
140 READY_TO_PUBLISH_PART_1,
141 READY_TO_PUBLISH_PART_2,
142 READY_TO_PUBLISH_PART_3
143 } state_{State::NOT_INITIALIZED};
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_1_(Readings &data)
void set_enable_automatic_mode(bool enable)
void set_enable_lux_compensation(bool enable)
bool lux_compensation_enabled_
float glass_attenuation_factor_
void dump_config() override
void publish_data_part_2_(Readings &data)
void publish_data_part_3_(Readings &data)
IntegrationTime integration_time_
void apply_glass_attenuation_(Readings &data)
bool are_adjustments_required_(Readings &data)
SUB_SENSOR(ambient_light) SUB_SENSOR(ambient_light_counts) SUB_SENSOR(white) SUB_SENSOR(white_counts) SUB_SENSOR(infrared) SUB_SENSOR(actual_gain) SUB_SENSOR(actual_integration_time) protected struct esphome::veml7700::VEML7700Component::Readings readings_
ErrorCode reconfigure_time_and_gain_(IntegrationTime time, Gain gain, bool shutdown)
void set_integration_time(IntegrationTime time)
void apply_lux_calculation_(Readings &data)
bool automatic_mode_enabled_
void set_glass_attenuation_factor(float factor)
void apply_lux_compensation_(Readings &data)
ErrorCode read_sensor_output_(Readings &data)
struct @66::@67 __attribute__
Wake the main loop task from an ISR. ISR-safe.
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
@ ERROR_OK
No error found during execution of method.
const uint8_t INTEGRATION_TIMES_COUNT
const uint8_t GAINS_COUNT
IntegrationTime actual_time