9 this->source_switch_->add_on_state_callback([
this](
float value) { this->
publish_state(value); });
14void CopySwitch::dump_config() { LOG_SWITCH(
"",
"Copy Switch",
this); }
virtual void setup()
Where the component's initialization should happen.
void write_state(bool state) override
bool state
The current reported state of the binary sensor.
void publish_state(bool state)
Publish a state to the front-end from the back-end.
ESPHOME_LOG_TAG(TAG, "copy.binary_sensor")