8static const char *
const TAG =
"template.lock";
18 auto val = this->
f_();
19 if (
val.has_value()) {
50 LOG_LOCK(
"",
"Template Lock",
this);
51 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
void disable_loop()
Disable this component's loop.
bool has_value() const
Check if a lambda is set.
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
void stop_action()
Stop any action connected to this trigger.
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.
float get_setup_priority() const override
void dump_config() override
void set_optimistic(bool optimistic)
void control(const lock::LockCall &call) override
TemplateLambda< lock::LockState > f_
void open_latch() override
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.