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...);
58 this->parent_->set_heater(
status);
TEMPLATABLE_VALUE(bool, status) void play(Ts... x) override
sensor::Sensor * humidity_
This class simplifies creating components that periodically check a state.
void setup() override
Setup (reset) the sensor and check connection.
void update() override
Update the sensor values (temperature+humidity).
float get_setup_priority() const override
void set_sensor_model(HTU21DSensorModels sensor_model)
sensor::Sensor * temperature_
void dump_config() override
void set_heater(sensor::Sensor *heater)
int8_t get_heater_level()
void set_heater_level(uint8_t level)
Implementation of SPI Controller mode.
void set_temperature(sensor::Sensor *temperature)
Base-class for all sensors.
void set_humidity(sensor::Sensor *humidity)
This Class provides the methods to read/write bytes from/to an i2c device.
HTU21DSensorModels sensor_model_
TEMPLATABLE_VALUE(uint8_t, level) void play(Ts... x) override
Helper class to easily give an object a parent of type T.