mirror of
https://github.com/esphome/esphome.git
synced 2025-04-13 06:10:30 +01:00
26 lines
609 B
C++
26 lines
609 B
C++
#pragma once
|
|
|
|
#include "esphome/core/component.h"
|
|
#include "esphome/components/switch/switch.h"
|
|
#include "esphome/components/output/binary_output.h"
|
|
|
|
namespace esphome {
|
|
namespace output {
|
|
|
|
class OutputSwitch : public switch_::Switch, public Component {
|
|
public:
|
|
void set_output(BinaryOutput *output) { output_ = output; }
|
|
|
|
void setup() override;
|
|
float get_setup_priority() const override { return setup_priority::HARDWARE - 1.0f; }
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void write_state(bool state) override;
|
|
|
|
output::BinaryOutput *output_;
|
|
};
|
|
|
|
} // namespace output
|
|
} // namespace esphome
|