ESPHome
2025.12.3
Loading...
Searching...
No Matches
esphome
components
template
lock
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
template_lock.h
"
4
5
#include "
esphome/core/automation.h
"
6
7
namespace
esphome::template_
{
8
9
template
<
typename
... Ts>
class
TemplateLockPublishAction
:
public
Action
<Ts...>,
public
Parented
<TemplateLock> {
10
public
:
11
TEMPLATABLE_VALUE
(
lock::LockState
,
state
)
12
13
void
play
(
const
Ts &...
x
)
override
{ this->
parent_
->publish_state(this->state_.value(
x
...)); }
14
};
15
16
}
// namespace esphome::template_
esphome::Action
Definition
automation.h:230
esphome::Action< Ts... >::play
virtual void play(const Ts &...x)=0
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:932
esphome::Parented< TemplateLock >::parent_
TemplateLock * parent_
Definition
helpers.h:943
esphome::template_::TemplateLockPublishAction
Definition
automation.h:9
esphome::template_::TemplateLockPublishAction::TEMPLATABLE_VALUE
TEMPLATABLE_VALUE(lock::LockState, state) void play(const Ts &...x) override
Definition
automation.h:11
automation.h
state
bool state
Definition
fan.h:0
esphome::lock::LockState
LockState
Enum for all states a lock can be in.
Definition
lock.h:25
esphome::template_
Definition
template_alarm_control_panel.cpp:9
template_lock.h
x
uint16_t x
Definition
tt21100.cpp:5
Generated by
1.12.0