esphome/esphome/components/ntc/ntc.h
Otto Winter 61ba2e0f35
Add NTC and resistance sensor (#560)
* Add NTC and resistance sensor

Fixes https://github.com/esphome/feature-requests/issues/248

* Fix

* Fix platformio4 moved get_project_dir
2019-05-28 16:00:00 +02:00

29 lines
611 B
C++

#pragma once
#include "esphome/core/component.h"
#include "esphome/components/sensor/sensor.h"
namespace esphome {
namespace ntc {
class NTC : public Component, public sensor::Sensor {
public:
void set_sensor(Sensor *sensor) { sensor_ = sensor; }
void set_a(float a) { a_ = a; }
void set_b(float b) { b_ = b; }
void set_c(float c) { c_ = c; }
void setup() override;
void dump_config() override;
float get_setup_priority() const override;
protected:
void process_(float value);
sensor::Sensor *sensor_;
float a_;
float b_;
float c_;
};
} // namespace ntc
} // namespace esphome