75 void setup()
override;
76 void update()
override;
77 void dump_config()
override;
This class simplifies creating components that periodically check a state.
This Class provides the methods to read/write bytes from/to an i2c device.
Temperature, pressure, and humidity sensor.
void request_read_humidity_(float temperature)
start async humidity read
void request_read_temperature_()
Start async temperature read.
bool update_ok_
False once any step of the current update cycle failed.
bool read_adc_(uint32_t &value)
Read a 24-bit converted ADC value, either D1 (pressure) or D2 (temperature)
uint8_t reset_attempts_remaining_
MS8607HumidityDevice * humidity_device_
I2CDevice object to communicate with secondary I2C address for the humidity sensor.
void read_humidity_(float temperature)
process async humidity read
void read_pressure_(uint32_t d2_raw_temperature)
Process async pressure read and publish it.
bool request_read_pressure_(uint32_t d2_raw_temperature)
Start async pressure read; false if the request failed.
bool setup_complete_
Set once the PROM calibration values have been read.
CalibrationValues calibration_values_
This device's pressure & temperature calibration values, read from PROM.
void finalize_update_()
End the update cycle, setting or clearing the warning from update_ok_.
bool read_calibration_values_from_prom_()
Read and CRC-check the PROM calibration values; marks the component failed on error.
void try_reset_()
Attempt to reset both I2C devices, retrying with backoff on failure.
void read_temperature_()
Process async temperature read, publish it and hand off to pressure or humidity.
void finish_update_(float temperature)
Read humidity if it is configured, otherwise end the update cycle.
I2C device for the humidity sensor's own address on the chip. See MS8607Component instead.
float compensated_humidity(float humidity_float, float temperature_float)
convert raw humidity value into correct range & apply temperature compensation calculation
float compensated_pressure(uint32_t d1_raw_pressure, const CalibrationValues &calibration_values, const CompensatedTemperature &temperature_values)
use raw pressure, calibration values, and current temperature to figure out actual pressure Precondit...
CompensatedTemperature compensated_temperature(uint32_t d2_raw_temperature, const CalibrationValues &calibration_values)
use raw temperature and calibration values to figure out actual temperature value return value includ...
Pressure & temperature calibration values, read from the PROM.
uint16_t pressure_offset_temperature_coefficient
Temperature coefficient of pressure offset | TCO. [C4].
uint16_t pressure_sensitivity_temperature_coefficient
Temperature coefficient of pressure sensitivity | TCS. [C3].
uint16_t pressure_sensitivity
Pressure sensitivity | SENS-T1. [C1].
uint16_t temperature_coefficient_of_temperature
Temperature coefficient of the temperature | TEMPSENS. [C6].
uint16_t reference_temperature
Reference temperature | T-REF. [C5].
uint16_t pressure_offset
Pressure offset | OFF-T1. [C2].
int32_t first_order_temperature
temperature as hundredths of degree celsius in range [-4000, 8500], after first order temperature cal...
int32_t d_t
difference between actual and reference temperature
float temperature_float
actual temperature, after 2nd order temperature calculation, in degrees celsius as a float