20 void setup()
override;
44 void play(Ts...
x)
override {
45 auto level = this->level_.value(
x...);
47 this->
parent_->set_heater_level(level);
55 void play(Ts...
x)
override {
56 auto status = this->status_.value(
x...);
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
HTU21DComponent * parent_
This class simplifies creating components that periodically check a state.
void set_temperature(sensor::Sensor *temperature)
float get_setup_priority() const override
void set_humidity(sensor::Sensor *humidity)
sensor::Sensor * humidity_
sensor::Sensor * temperature_
void set_sensor_model(HTU21DSensorModels sensor_model)
void set_heater(sensor::Sensor *heater)
void dump_config() override
int8_t get_heater_level()
void update() override
Update the sensor values (temperature+humidity).
HTU21DSensorModels sensor_model_
void setup() override
Setup (reset) the sensor and check connection.
void set_heater_level(uint8_t level)
TEMPLATABLE_VALUE(bool, status) void play(Ts... x) override
TEMPLATABLE_VALUE(uint8_t, level) void play(Ts... x) override
This Class provides the methods to read/write bytes from/to an i2c device.
Base-class for all sensors.
@ HTU21D_SENSOR_MODEL_SI7021
@ HTU21D_SENSOR_MODEL_SHT21
@ HTU21D_SENSOR_MODEL_HTU21D
Providing packet encoding functions for exchanging data with a remote host.