28 void setup()
override;
113 template<
size_t N> uint8_t
calc_crc8_(std::array<uint8_t, N> dat, uint8_t num);
120 void play(Ts...
x)
override { this->parent_->new_i2c_address(this->new_address_.value(
x...)); }
134 TEMPLATABLE_VALUE(uint16_t, value)
137 void play(Ts...
x)
override {
138 switch (this->mode_.value(x...)) {
140 this->parent_->set_zero_point_with_factory_defaults();
143 this->parent_->set_zero_point_with_current_resistance();
146 this->parent_->set_zero_point_with(this->value_.value(x...));
optional< uint32_t > read_resistance_()
Reads and returns the resistance of AGS10.
TEMPLATABLE_VALUE(uint8_t, new_address) void play(Ts... x) override
const float DATA
For components that import data from directly connected sensors like DHT.
optional< uint32_t > read_tvoc_()
Reads and returns value of TVOC.
bool new_i2c_address(uint8_t newaddress)
Modifies target address of AGS10.
optional< uint8_t > read_version_()
Reads and returns a firmware version of AGS10.
bool set_zero_point_with_factory_defaults()
Sets zero-point with factory defaults.
This class simplifies creating components that periodically check a state.
void dump_config() override
bool set_zero_point_with_current_resistance()
Sets zero-point with current sensor resistance.
BedjetMode mode
BedJet operating mode.
uint8_t calc_crc8_(std::array< uint8_t, N > dat, uint8_t num)
Calculates CRC8 value.
void set_tvoc(sensor::Sensor *tvoc)
Sets TVOC sensor.
sensor::Sensor * version_
Firmvare version.
sensor::Sensor * tvoc_
TVOC.
ErrorCode
Last operation error code.
float get_setup_priority() const override
sensor::Sensor * resistance_
Resistance.
bool set_zero_point_with(uint16_t value)
Sets zero-point with the value.
Implementation of SPI Controller mode.
void set_resistance(sensor::Sensor *resistance)
Sets resistance info sensor.
void set_version(sensor::Sensor *version)
Sets version info sensor.
AGS10SetZeroPointActionMode
Base-class for all sensors.
This Class provides the methods to read/write bytes from/to an i2c device.
Helper class to easily give an object a parent of type T.
optional< std::array< uint8_t, N > > read_and_check_(uint8_t a_register)
Read, checks and returns data from the sensor.
enum esphome::ags10::AGS10Component::ErrorCode NONE