ESPHome 2026.5.1
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
3#include "update_entity.h"
4
6
7namespace esphome::update {
8
9template<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
16template<typename... Ts> class CheckAction : public Action<Ts...>, public Parented<UpdateEntity> {
17 public:
18 void play(const Ts &...x) override { this->parent_->check(); }
19};
20
21template<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
virtual void play(const Ts &...x)=0
Base class for all automation conditions.
Definition automation.h:459
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
void play(const Ts &...x) override
Definition automation.h:18
bool check(const Ts &...x) override
Definition automation.h:23
uint16_t x
Definition tt21100.cpp:5