mirror of
https://github.com/esphome/esphome.git
synced 2025-04-11 05:10:34 +01:00
* Cleanup dashboard JS * Add vscode * Save start_mark/end_mark * Updates * Updates * Remove need for cv.nameable It's a bit hacky but removes so much bloat from integrations * Add enum helper * Document APIs, and Improvements * Fixes * Fixes * Update PULL_REQUEST_TEMPLATE.md * Updates * Updates * Updates
26 lines
602 B
C++
26 lines
602 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; }
|
|
void dump_config() override;
|
|
|
|
protected:
|
|
void write_state(bool state) override;
|
|
|
|
output::BinaryOutput *output_;
|
|
};
|
|
|
|
} // namespace output
|
|
} // namespace esphome
|