ESPHome 2025.6.3
Loading...
Searching...
No Matches
demo_lock.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace esphome {
6namespace demo {
7
8class DemoLock : public lock::Lock {
9 protected:
10 void control(const lock::LockCall &call) override {
11 auto state = *call.get_state();
12 this->publish_state(state);
13 }
14};
15
16} // namespace demo
17} // namespace esphome
void control(const lock::LockCall &call) override
Definition demo_lock.h:10
This class is used to encode all control actions on a lock device.
Definition lock.h:71
const optional< LockState > & get_state() const
Definition lock.cpp:104
Base class for all locks.
Definition lock.h:103
void publish_state(LockState state)
Publish a state to the front-end from the back-end.
Definition lock.cpp:48
LockState state
The current reported state of the lock.
Definition lock.h:122
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7