mirror of
https://github.com/esphome/esphome.git
synced 2024-12-02 11:44:13 +01:00
8e75980ebd
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
29 lines
803 B
C++
29 lines
803 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
namespace esphome {
|
|
namespace hdc1080 {
|
|
|
|
class HDC1080Component : public PollingComponent, public i2c::I2CDevice {
|
|
public:
|
|
void set_temperature(sensor::Sensor *temperature) { temperature_ = temperature; }
|
|
void set_humidity(sensor::Sensor *humidity) { humidity_ = humidity; }
|
|
|
|
/// Setup the sensor and check for connection.
|
|
void setup() override;
|
|
void dump_config() override;
|
|
/// Retrieve the latest sensor values. This operation takes approximately 16ms.
|
|
void update() override;
|
|
|
|
float get_setup_priority() const override;
|
|
|
|
protected:
|
|
sensor::Sensor *temperature_;
|
|
sensor::Sensor *humidity_;
|
|
};
|
|
|
|
} // namespace hdc1080
|
|
} // namespace esphome
|