ESPHome 2026.5.0
Loading...
Searching...
No Matches
copy_text_sensor.cpp
Go to the documentation of this file.
1#include "copy_text_sensor.h"
2#include "esphome/core/log.h"
3
4namespace esphome::copy {
5
6static const char *const TAG = "copy.text_sensor";
7
9 source_->add_on_state_callback([this](const std::string &value) { this->publish_state(value); });
10 if (source_->has_state())
12}
13
14void CopyTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Copy Sensor", this); }
15
16} // namespace esphome::copy
bool has_state() const
text_sensor::TextSensor * source_
void add_on_state_callback(F &&callback)
Definition text_sensor.h:65
void publish_state(const std::string &state)