ESPHome  2024.10.2
output_switch.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace output {
9 
10 class 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
Base class for all switches.
Definition: switch.h:39
output::BinaryOutput * output_
Definition: output_switch.h:21
void write_state(bool state) override
void set_output(BinaryOutput *output)
Definition: output_switch.h:12
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Definition: component.cpp:18
float get_setup_priority() const override
Definition: output_switch.h:15
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool state
The current reported state of the binary sensor.
Definition: switch.h:53