9 static 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_));
Trigger * get_open_trigger() const
LockState state
The current reported state of the lock.
Trigger * unlock_trigger_
const optional< LockState > & get_state() const
void open_latch() override
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.
void set_optimistic(bool optimistic)
Trigger * get_lock_trigger() const
void set_state_lambda(std::function< optional< lock::LockState >()> &&f)
Trigger * get_unlock_trigger() const
float get_setup_priority() const override
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
void dump_config() override
Implementation of SPI Controller mode.
void control(const lock::LockCall &call) override
optional< std::function< optional< lock::LockState >)> > f_
void stop_action()
Stop any action connected to this trigger.
void publish_state(LockState state)
Publish a state to the front-end from the back-end.