mirror of
https://github.com/esphome/esphome.git
synced 2024-12-23 22:14:54 +01:00
adb51cf733
* Add MCP9808 temperature sensor * Change from component to sensor; code fixes - Change from component to sensor - Change magic numbers to constants * Fix incorrect logging levels * Add precision to debug log * Fix logging level Co-authored-by: Guillermo Ruffino <glm.net@gmail.com> * Fix bug with comparison to NAN Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
20 lines
461 B
C++
20 lines
461 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/sensor/sensor.h"
|
|
#include "esphome/components/i2c/i2c.h"
|
|
|
|
namespace esphome {
|
|
namespace mcp9808 {
|
|
|
|
class MCP9808Sensor : 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;
|
|
};
|
|
|
|
} // namespace mcp9808
|
|
} // namespace esphome
|