mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 19:54:14 +01:00
18426b71e4
* Add support for Sensirion STS3x Temperature sensors * Removed humidty reading from STS3x sensor * Fixed line error and operand error * Fixed syntax * Add test snippet for STS3x sensor * Clean up * #550 Proactive fix for STS3x component reporting WARNING status and reinitialzing similar to SHT3xd * Flattened config. * Fixed missing temperature unit * Code formatting * Added marking for future commands * Cleanup * Removed whitespace * Cleanup * Cleanup
24 lines
645 B
C++
24 lines
645 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
namespace esphome {
|
|
namespace sts3x {
|
|
|
|
/// This class implements support for the ST3x-DIS family of temperature i2c sensors.
|
|
class STS3XComponent : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
|
|
public:
|
|
void setup() override;
|
|
void dump_config() override;
|
|
float get_setup_priority() const override;
|
|
void update() override;
|
|
|
|
protected:
|
|
bool write_command_(uint16_t command);
|
|
bool read_data_(uint16_t *data, uint8_t len);
|
|
};
|
|
|
|
} // namespace sts3x
|
|
} // namespace esphome
|