esphome/esphome/components/xgzp68xx/xgzp68xx.h
Greg Cormier 972c18a7ca
Add differential pressure sensor support for CFSensor XGZP68xxD devices (#5562)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-11-07 12:46:30 +13:00

28 lines
688 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/i2c/i2c.h"
namespace esphome {
namespace xgzp68xx {
class XGZP68XXComponent : public PollingComponent, public sensor::Sensor, public i2c::I2CDevice {
public:
SUB_SENSOR(temperature)
SUB_SENSOR(pressure)
void set_k_value(uint16_t k_value) { this->k_value_ = k_value; }
void update() override;
void setup() override;
void dump_config() override;
protected:
/// Internal method to read the pressure from the component after it has been scheduled.
void read_pressure_();
uint16_t k_value_;
};
} // namespace xgzp68xx
} // namespace esphome