ESPHome 2025.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 {
5namespace copy {
6
7static const char *const TAG = "copy.text_sensor";
8
10 source_->add_on_state_callback([this](const std::string &value) { this->publish_state(value); });
11 if (source_->has_state())
13}
14
15void CopyTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Copy Sensor", this); }
16
17} // namespace copy
18} // namespace esphome
text_sensor::TextSensor * source_
void add_on_state_callback(std::function< void(std::string)> callback)
void publish_state(const std::string &state)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7