ESPHome  2024.11.1
ee895.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace ee895 {
9 
12  public:
14  void set_temperature_sensor(sensor::Sensor *temperature_sensor) { temperature_sensor_ = temperature_sensor; }
15  void set_pressure_sensor(sensor::Sensor *pressure_sensor) { pressure_sensor_ = pressure_sensor; }
16 
17  float get_setup_priority() const override;
18  void setup() override;
19  void dump_config() override;
20  void update() override;
21 
22  protected:
23  void write_command_(uint16_t addr, uint16_t reg_cnt);
24  float read_float_();
25  uint16_t calc_crc16_(const uint8_t buf[], uint8_t len);
29 
31 };
32 
33 } // namespace ee895
34 } // namespace esphome
sensor::Sensor * temperature_sensor_
Definition: ee895.h:27
void set_co2_sensor(sensor::Sensor *co2)
Definition: ee895.h:13
float get_setup_priority() const override
Definition: ee895.cpp:53
void set_temperature_sensor(sensor::Sensor *temperature_sensor)
Definition: ee895.h:14
This class implements support for the ee895 of temperature i2c sensors.
Definition: ee895.h:11
sensor::Sensor * co2_sensor_
Definition: ee895.h:26
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void dump_config() override
Definition: ee895.cpp:33
enum esphome::ee895::EE895Component::ErrorCode NONE
void update() override
Definition: ee895.cpp:55
void setup() override
Definition: ee895.cpp:17
uint16_t calc_crc16_(const uint8_t buf[], uint8_t len)
Definition: ee895.cpp:106
sensor::Sensor * pressure_sensor_
Definition: ee895.h:28
std::string size_t len
Definition: helpers.h:293
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void write_command_(uint16_t addr, uint16_t reg_cnt)
Definition: ee895.cpp:76
Base-class for all sensors.
Definition: sensor.h:57
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
void set_pressure_sensor(sensor::Sensor *pressure_sensor)
Definition: ee895.h:15