ESPHome 2026.1.0-dev
Loading...
Searching...
No Matches
template_text_sensor.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
3
4namespace esphome::template_ {
5
6static const char *const TAG = "template.text_sensor";
7
9 if (!this->f_.has_value())
10 return;
11
12 auto val = this->f_();
13 if (val.has_value()) {
14 this->publish_state(*val);
15 }
16}
17
19
20void TemplateTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Template Sensor", this); }
21
22} // namespace esphome::template_
bool has_value() const
Check if a lambda is set.
void publish_state(const std::string &state)
mopeka_std_values val[4]
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.cpp:80
const char *const TAG
Definition spi.cpp:7