ESPHome 2026.5.0
Loading...
Searching...
No Matches
copy_switch.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome::copy {
7
8class CopySwitch : public switch_::Switch, public Component {
9 public:
10 void set_source(switch_::Switch *source) { source_ = source; }
11 void setup() override;
12 void dump_config() override;
13
14 protected:
15 void write_state(bool state) override;
16
18};
19
20} // namespace esphome::copy
switch_::Switch * source_
Definition copy_switch.h:17
void dump_config() override
void set_source(switch_::Switch *source)
Definition copy_switch.h:10
void write_state(bool state) override
Base class for all switches.
Definition switch.h:38
bool state
The current reported state of the binary sensor.
Definition switch.h:55