ESPHome 2025.11.1
Loading...
Searching...
No Matches
template_text_sensor.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
3
4namespace esphome {
5namespace template_ {
6
7static const char *const TAG = "template.text_sensor";
8
10 if (!this->f_.has_value())
11 return;
12
13 auto val = this->f_();
14 if (val.has_value()) {
15 this->publish_state(*val);
16 }
17}
18
20
21void TemplateTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Template Sensor", this); }
22
23} // namespace template_
24} // namespace esphome
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:58
const char *const TAG
Definition spi.cpp:8
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7