mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-06 21:09:53 +02:00
Add support for STS3x Temperature sensors (#669)
* 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
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user