ESPHome 2026.5.0
Loading...
Searching...
No Matches
output_switch.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome::output {
8
9class OutputSwitch : public switch_::Switch, public Component {
10 public:
11 void set_output(BinaryOutput *output) { output_ = output; }
12
13 void setup() override;
14 float get_setup_priority() const override { return setup_priority::HARDWARE - 1.0f; }
15 void dump_config() override;
16
17 protected:
18 void write_state(bool state) override;
19
21};
22
23} // namespace esphome::output
void write_state(bool state) override
output::BinaryOutput * output_
float get_setup_priority() const override
void set_output(BinaryOutput *output)
Base class for all switches.
Definition switch.h:38
bool state
The current reported state of the binary sensor.
Definition switch.h:55
constexpr float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.h:41