ESPHome
2026.5.1
Loading...
Searching...
No Matches
esphome
components
update
automation.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
update_entity.h
"
4
5
#include "
esphome/core/automation.h
"
6
7
namespace
esphome::update
{
8
9
template
<
typename
... Ts>
class
PerformAction
:
public
Action
<Ts...>,
public
Parented
<UpdateEntity> {
10
TEMPLATABLE_VALUE(
bool
, force)
11
12
public
:
13
void
play
(
const
Ts &...
x
)
override
{ this->
parent_
->perform(this->force_.value(
x
...)); }
14
};
15
16
template
<
typename
... Ts>
class
CheckAction
:
public
Action
<Ts...>,
public
Parented
<UpdateEntity> {
17
public
:
18
void
play
(
const
Ts &...
x
)
override
{ this->
parent_
->check(); }
19
};
20
21
template
<
typename
... Ts>
class
IsAvailableCondition
:
public
Condition
<Ts...>,
public
Parented
<UpdateEntity> {
22
public
:
23
bool
check
(
const
Ts &...
x
)
override
{
return
this->
parent_
->state ==
UPDATE_STATE_AVAILABLE
; }
24
};
25
26
}
// namespace esphome::update
esphome::Action
Definition
automation.h:508
esphome::Action< Ts... >::play
virtual void play(const Ts &...x)=0
esphome::Condition
Base class for all automation conditions.
Definition
automation.h:459
esphome::Parented
Helper class to easily give an object a parent of type T.
Definition
helpers.h:1861
esphome::Parented< UpdateEntity >::parent_
UpdateEntity * parent_
Definition
helpers.h:1872
esphome::update::CheckAction
Definition
automation.h:16
esphome::update::CheckAction::play
void play(const Ts &...x) override
Definition
automation.h:18
esphome::update::IsAvailableCondition
Definition
automation.h:21
esphome::update::IsAvailableCondition::check
bool check(const Ts &...x) override
Definition
automation.h:23
esphome::update::PerformAction
Definition
automation.h:9
automation.h
esphome::update
Definition
automation.h:7
esphome::update::UPDATE_STATE_AVAILABLE
@ UPDATE_STATE_AVAILABLE
Definition
update_entity.h:25
x
uint16_t x
Definition
tt21100.cpp:5
update_entity.h
Generated by
1.12.0