13 void setup()
override;
This class simplifies creating components that periodically check a state.
void update() override
Setup (reset) the sensor and check connection.
uint32_t read_serial_num_()
Reads the serial number from the device and checks the CRC.
sensor::Sensor * temperature_
void setup() override
Resets the sensor and ensures that the devices serial number can be read over I2C.
float get_setup_priority() const override
Sets the startup priority for this component.
sensor::Sensor * humidity_
void set_temperature(sensor::Sensor *temperature)
Dumps the configuration values.
void set_humidity(sensor::Sensor *humidity)
bool is_heater_enabled()
Checks the diagnostics register to determine if the heater is currently enabled.
void set_heater_state(bool desired)
Sets the heater state on or off.
bool reset_()
Sends a 'reset' request to the HTU31D, followed by a 15ms delay.
void dump_config() override
Update the sensor values (temperature+humidity).
This Class provides the methods to read/write bytes from/to an i2c device.
Base-class for all sensors.
Providing packet encoding functions for exchanging data with a remote host.