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