ESPHome  2024.4.0
automation.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "haier_base.h"
5 #include "hon_climate.h"
6 
7 namespace esphome {
8 namespace haier {
9 
10 template<typename... Ts> class DisplayOnAction : public Action<Ts...> {
11  public:
13  void play(Ts... x) { this->parent_->set_display_state(true); }
14 
15  protected:
17 };
18 
19 template<typename... Ts> class DisplayOffAction : public Action<Ts...> {
20  public:
22  void play(Ts... x) { this->parent_->set_display_state(false); }
23 
24  protected:
26 };
27 
28 template<typename... Ts> class BeeperOnAction : public Action<Ts...> {
29  public:
30  BeeperOnAction(HonClimate *parent) : parent_(parent) {}
31  void play(Ts... x) { this->parent_->set_beeper_state(true); }
32 
33  protected:
35 };
36 
37 template<typename... Ts> class BeeperOffAction : public Action<Ts...> {
38  public:
39  BeeperOffAction(HonClimate *parent) : parent_(parent) {}
40  void play(Ts... x) { this->parent_->set_beeper_state(false); }
41 
42  protected:
44 };
45 
46 template<typename... Ts> class VerticalAirflowAction : public Action<Ts...> {
47  public:
50  void play(Ts... x) { this->parent_->set_vertical_airflow(this->direction_.value(x...)); }
51 
52  protected:
54 };
55 
56 template<typename... Ts> class HorizontalAirflowAction : public Action<Ts...> {
57  public:
60  void play(Ts... x) { this->parent_->set_horizontal_airflow(this->direction_.value(x...)); }
61 
62  protected:
64 };
65 
66 template<typename... Ts> class HealthOnAction : public Action<Ts...> {
67  public:
68  HealthOnAction(HaierClimateBase *parent) : parent_(parent) {}
69  void play(Ts... x) { this->parent_->set_health_mode(true); }
70 
71  protected:
73 };
74 
75 template<typename... Ts> class HealthOffAction : public Action<Ts...> {
76  public:
78  void play(Ts... x) { this->parent_->set_health_mode(false); }
79 
80  protected:
82 };
83 
84 template<typename... Ts> class StartSelfCleaningAction : public Action<Ts...> {
85  public:
87  void play(Ts... x) { this->parent_->start_self_cleaning(); }
88 
89  protected:
91 };
92 
93 template<typename... Ts> class StartSteriCleaningAction : public Action<Ts...> {
94  public:
96  void play(Ts... x) { this->parent_->start_steri_cleaning(); }
97 
98  protected:
100 };
101 
102 template<typename... Ts> class PowerOnAction : public Action<Ts...> {
103  public:
104  PowerOnAction(HaierClimateBase *parent) : parent_(parent) {}
105  void play(Ts... x) { this->parent_->send_power_on_command(); }
106 
107  protected:
109 };
110 
111 template<typename... Ts> class PowerOffAction : public Action<Ts...> {
112  public:
114  void play(Ts... x) { this->parent_->send_power_off_command(); }
115 
116  protected:
118 };
119 
120 template<typename... Ts> class PowerToggleAction : public Action<Ts...> {
121  public:
123  void play(Ts... x) { this->parent_->toggle_power(); }
124 
125  protected:
127 };
128 
129 } // namespace haier
130 } // namespace esphome
StartSelfCleaningAction(HonClimate *parent)
Definition: automation.h:86
HaierClimateBase * parent_
Definition: automation.h:108
PowerOffAction(HaierClimateBase *parent)
Definition: automation.h:113
VerticalAirflowAction(HonClimate *parent)
Definition: automation.h:48
uint16_t x
Definition: tt21100.cpp:17
DisplayOffAction(HaierClimateBase *parent)
Definition: automation.h:21
PowerToggleAction(HaierClimateBase *parent)
Definition: automation.h:122
BeeperOnAction(HonClimate *parent)
Definition: automation.h:30
HealthOffAction(HaierClimateBase *parent)
Definition: automation.h:77
HaierClimateBase * parent_
Definition: automation.h:16
FanDirection direction
Definition: fan.h:37
StartSteriCleaningAction(HonClimate *parent)
Definition: automation.h:95
void set_display_state(bool state)
Definition: haier_base.cpp:132
HaierClimateBase * parent_
Definition: automation.h:25
HealthOnAction(HaierClimateBase *parent)
Definition: automation.h:68
BeeperOffAction(HonClimate *parent)
Definition: automation.h:39
TEMPLATABLE_VALUE(AirflowHorizontalDirection, direction) void play(Ts... x)
Definition: automation.h:59
HaierClimateBase * parent_
Definition: automation.h:81
HaierClimateBase * parent_
Definition: automation.h:72
HaierClimateBase * parent_
Definition: automation.h:117
HorizontalAirflowAction(HonClimate *parent)
Definition: automation.h:58
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
TEMPLATABLE_VALUE(AirflowVerticalDirection, direction) void play(Ts... x)
Definition: automation.h:49
DisplayOnAction(HaierClimateBase *parent)
Definition: automation.h:12
PowerOnAction(HaierClimateBase *parent)
Definition: automation.h:104