ESPHome  2024.12.2
automation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "update_entity.h"
4 
6 
7 namespace esphome {
8 namespace update {
9 
10 template<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 
17 template<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
uint16_t x
Definition: tt21100.cpp:17
bool check(Ts... x) override
Definition: automation.h:19
Base class for all automation conditions.
Definition: automation.h:74
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
virtual void play(Ts... x)=0
Helper class to easily give an object a parent of type T.
Definition: helpers.h:530