@@ -103,12 +103,109 @@ switch:
103103 name : Haier hOn Climate quiet mode
104104
105105select :
106- - platform : haier
107- haier_id : haier_ac
108- vertical_airflow :
109- name : Haier hOn Climate airflow vertical
110- horizontal_airflow :
111- name : Haier hOn Climate airflow horizontal
106+ - platform : template
107+ id : haier_ac_vertical_direction
108+ name : Haier hOn Climate airflow vertical
109+ entity_category : config
110+ icon : mdi:arrow-expand-vertical
111+ update_interval : 5s
112+ options :
113+ - Health Up
114+ - Max Up
115+ - Up
116+ - Center
117+ - Down
118+ - Max Down
119+ - Health Down
120+ - Auto
121+ lambda : >-
122+ switch (id(haier_ac).get_vertical_airflow().value_or(esphome::haier::hon_protocol::VerticalSwingMode::CENTER))
123+ {
124+ case esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_UP:
125+ return std::string("Health Up");
126+ case esphome::haier::hon_protocol::VerticalSwingMode::MAX_UP:
127+ return std::string("Max Up");
128+ case esphome::haier::hon_protocol::VerticalSwingMode::UP:
129+ return std::string("Up");
130+ default:
131+ case esphome::haier::hon_protocol::VerticalSwingMode::CENTER:
132+ return std::string("Center");
133+ case esphome::haier::hon_protocol::VerticalSwingMode::DOWN:
134+ return std::string("Down");
135+ case esphome::haier::hon_protocol::VerticalSwingMode::MAX_DOWN:
136+ return std::string("Max Down");
137+ case esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_DOWN:
138+ return std::string("Health Down");
139+ case esphome::haier::hon_protocol::VerticalSwingMode::AUTO:
140+ case esphome::haier::hon_protocol::VerticalSwingMode::AUTO_SPECIAL:
141+ return std::string("Auto");
142+ }
143+ set_action :
144+ - climate.haier.set_vertical_airflow :
145+ id : haier_ac
146+ vertical_airflow : !lambda >-
147+ if (x == "Health Up")
148+ return esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_UP;
149+ else if (x == "Max Up")
150+ return esphome::haier::hon_protocol::VerticalSwingMode::MAX_UP;
151+ else if (x == "Up")
152+ return esphome::haier::hon_protocol::VerticalSwingMode::UP;
153+ else if (x == "Down")
154+ return esphome::haier::hon_protocol::VerticalSwingMode::DOWN;
155+ else if (x == "Max Down")
156+ return esphome::haier::hon_protocol::VerticalSwingMode::MAX_DOWN;
157+ else if (x == "Health Down")
158+ return esphome::haier::hon_protocol::VerticalSwingMode::HEALTH_DOWN;
159+ else if (x == "Auto")
160+ return esphome::haier::hon_protocol::VerticalSwingMode::AUTO;
161+ else
162+ return esphome::haier::hon_protocol::VerticalSwingMode::CENTER;
163+ - platform : template
164+ id : haier_ac_horizontal_direction
165+ name : Haier hOn Climate airflow horizontal
166+ entity_category : config
167+ icon : mdi:arrow-expand-horizontal
168+ update_interval : 5s
169+ options :
170+ - Max Left
171+ - Left
172+ - Center
173+ - Right
174+ - Max Right
175+ - Auto
176+ lambda : >-
177+ switch (id(haier_ac).get_horizontal_airflow().value_or(esphome::haier::hon_protocol::HorizontalSwingMode::CENTER))
178+ {
179+ case esphome::haier::hon_protocol::HorizontalSwingMode::MAX_LEFT:
180+ return std::string("Max Left");
181+ case esphome::haier::hon_protocol::HorizontalSwingMode::LEFT:
182+ return std::string("Left");
183+ default:
184+ case esphome::haier::hon_protocol::HorizontalSwingMode::CENTER:
185+ return std::string("Center");
186+ case esphome::haier::hon_protocol::HorizontalSwingMode::RIGHT:
187+ return std::string("Right");
188+ case esphome::haier::hon_protocol::HorizontalSwingMode::MAX_RIGHT:
189+ return std::string("Max Right");
190+ case esphome::haier::hon_protocol::HorizontalSwingMode::AUTO:
191+ return std::string("Auto");
192+ }
193+ set_action :
194+ - climate.haier.set_horizontal_airflow :
195+ id : haier_ac
196+ horizontal_airflow : !lambda >-
197+ if (x == "Max Left")
198+ return esphome::haier::hon_protocol::HorizontalSwingMode::MAX_LEFT;
199+ else if (x == "Left")
200+ return esphome::haier::hon_protocol::HorizontalSwingMode::LEFT;
201+ else if (x == "Right")
202+ return esphome::haier::hon_protocol::HorizontalSwingMode::RIGHT;
203+ else if (x == "Max Right")
204+ return esphome::haier::hon_protocol::HorizontalSwingMode::MAX_RIGHT;
205+ else if (x == "Auto")
206+ return esphome::haier::hon_protocol::HorizontalSwingMode::AUTO;
207+ else
208+ return esphome::haier::hon_protocol::HorizontalSwingMode::CENTER;
112209
113210sensor :
114211 - platform : haier
0 commit comments