ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
automation.h
Go to the documentation of this file.
1#pragma once
2
4
6
7#include <type_traits>
8
10
11template<typename... Ts>
12class SetRemoteTemperatureAction : public Action<Ts...>, public Parented<MitsubishiCN105Component> {
13 public:
15
16 void play(const Ts &...x) override { this->parent_->set_remote_temperature(this->temperature_.value(x...)); }
17};
18
19template<typename... Ts>
20class ClearRemoteTemperatureAction : public Action<Ts...>, public Parented<MitsubishiCN105Component> {
21 public:
22 void play(const Ts &...x) override { this->parent_->clear_remote_temperature(); }
23};
24
25template<typename... Ts> class VaneControlAction : public Action<Ts...> {
26 public:
27 using ApplyFn = void (*)(VaneCall &, const std::remove_cvref_t<Ts> &...);
28
30
31 void play(const Ts &...x) override {
32 auto call = this->parent_->make_vane_call();
33 this->apply_(call, x...);
34 call.perform();
35 }
36
37 protected:
40};
41
42} // namespace esphome::mitsubishi_cn105
virtual void play(const Ts &...x)=0
Helper class to easily give an object a parent of type T.
Definition helpers.h:1907
TEMPLATABLE_VALUE(float, temperature) void play(const Ts &...x) override
Definition automation.h:14
void play(const Ts &...x) override
Definition automation.h:31
void(*)(VaneCall &, const std::remove_cvref_t< Ts > &...) ApplyFn
Definition automation.h:27
VaneControlAction(MitsubishiCN105Component *parent, ApplyFn apply)
Definition automation.h:29
void apply(Climate *climate)
Apply these settings to the climate device.
uint16_t temperature
Definition sun_gtil2.cpp:12
uint16_t x
Definition tt21100.cpp:5