7 static const char *
const TAG =
"ntc";
17 if (std::isnan(value)) {
22 double lr = log(
double(value));
23 double v = this->
a_ + this->
b_ * lr + this->
c_ * lr * lr * lr;
24 auto temp = float(1.0 / v - 273.15);
26 ESP_LOGD(TAG,
"'%s' - Temperature: %.1f°C", this->
name_.
c_str(), temp);
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
const float DATA
For components that import data from directly connected sensors like DHT.
float state
This member variable stores the last state that has passed through all filters.
float get_setup_priority() const override
void publish_state(float state)
Publish a new state to the front-end.
void process_(float value)
constexpr const char * c_str() const
Implementation of SPI Controller mode.
bool has_state() const
Return whether this sensor has gotten a full state (that passed through all filters) yet...
void dump_config() override