ESPHome 2025.5.0
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 {
8namespace update {
9
10template<typename... Ts> class PerformAction : public Action<Ts...>, public Parented<UpdateEntity> {
11 TEMPLATABLE_VALUE(bool, force)
12
13 public:
14 void play(Ts... x) override { this->parent_->perform(this->force_.value(x...)); }
15};
16
17template<typename... Ts> class IsAvailableCondition : public Condition<Ts...>, public Parented<UpdateEntity> {
18 public:
19 bool check(Ts... x) override { return this->parent_->state == UPDATE_STATE_AVAILABLE; }
20};
21
22} // namespace update
23} // namespace esphome
virtual void play(Ts... x)=0
Base class for all automation conditions.
Definition automation.h:75
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t x
Definition tt21100.cpp:5