ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
copy_binary_sensor.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
3
4namespace esphome::copy {
5
6ESPHOME_LOG_TAG(TAG, "copy.binary_sensor");
7
9 this->source_binary_sensor_->add_on_state_callback([this](bool value) { this->publish_state(value); });
10 if (this->source_binary_sensor_->has_state())
11 this->publish_state(this->source_binary_sensor_->state);
12}
13
14void CopyBinarySensor::dump_config() { LOG_BINARY_SENSOR("", "Copy Binary Sensor", this); }
15
16} // namespace esphome::copy
virtual void setup()
Where the component's initialization should happen.
Definition component.cpp:84
void publish_state(bool new_state)
Publish a new state to the front-end.
ESPHOME_LOG_TAG(TAG, "copy.binary_sensor")
uint32_t value
Definition hal.cpp:41