Add new Lock core component (#2958)

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
Keilin Bickar
2022-02-03 13:24:31 -05:00
committed by GitHub
parent 62b366a5ec
commit 21803607e7
41 changed files with 1558 additions and 3 deletions
@@ -0,0 +1,24 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/lock/lock.h"
#include "esphome/components/output/binary_output.h"
namespace esphome {
namespace output {
class OutputLock : public lock::Lock, public Component {
public:
void set_output(BinaryOutput *output) { output_ = output; }
float get_setup_priority() const override { return setup_priority::HARDWARE - 1.0f; }
void dump_config() override;
protected:
void control(const lock::LockCall &call) override;
output::BinaryOutput *output_;
};
} // namespace output
} // namespace esphome