mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-01 18:48:28 +02:00
Implement output button (#3109)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/components/button/button.h"
|
||||
#include "esphome/components/output/binary_output.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace output {
|
||||
|
||||
class OutputButton : public button::Button, public Component {
|
||||
public:
|
||||
void dump_config() override;
|
||||
|
||||
void set_output(BinaryOutput *output) { output_ = output; }
|
||||
void set_duration(uint32_t duration) { duration_ = duration; }
|
||||
|
||||
protected:
|
||||
void press_action() override;
|
||||
|
||||
output::BinaryOutput *output_;
|
||||
uint32_t duration_;
|
||||
};
|
||||
|
||||
} // namespace output
|
||||
} // namespace esphome
|
||||
Reference in New Issue
Block a user