ESPHome 2025.5.0
Loading...
Searching...
No Matches
output_switch.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace output {
9
10class OutputSwitch : public switch_::Switch, public Component {
11 public:
12 void set_output(BinaryOutput *output) { output_ = output; }
13
14 void setup() override;
15 float get_setup_priority() const override { return setup_priority::HARDWARE - 1.0f; }
16 void dump_config() override;
17
18 protected:
19 void write_state(bool state) override;
20
22};
23
24} // namespace output
25} // namespace esphome
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:39
bool state
The current reported state of the binary sensor.
Definition switch.h:53
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition component.cpp:18
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7