9static const char *
const TAG =
"template.lock";
15 if (!this->
f_.has_value())
17 auto val = (*this->
f_)();
54 LOG_LOCK(
"",
"Template Lock",
this);
55 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
void stop_action()
Stop any action connected to this trigger.
void trigger(Ts... x)
Inform the parent automation that the event has triggered.
This class is used to encode all control actions on a lock device.
const optional< LockState > & get_state() const
void publish_state(LockState state)
Publish a state to the front-end from the back-end.
LockState state
The current reported state of the lock.
Trigger * get_lock_trigger() const
float get_setup_priority() const override
Trigger * get_open_trigger() const
void dump_config() override
Trigger * unlock_trigger_
void set_optimistic(bool optimistic)
void control(const lock::LockCall &call) override
void set_state_lambda(std::function< optional< lock::LockState >()> &&f)
optional< std::function< optional< lock::LockState >()> > f_
void open_latch() override
Trigger * get_unlock_trigger() const
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
Providing packet encoding functions for exchanging data with a remote host.