ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
mitsubishi_cn105_vane_select_vertical.cpp
Go to the documentation of this file.
2
3#include <array>
4
6
7// NOTE: This order must match VERTICAL_VANE_DIRECTIONS in the hub's __init__.py.
8// MitsubishiCN105VerticalVaneDirectionSelect uses the preferred index-based
9// Select API, so Python option order and this array must stay aligned.
10static constexpr std::array VALUES{
14};
15
17 this->parent_->add_on_status_callback([this]() { this->publish_vane_state(this->parent_->status().vane_mode); });
18 if (this->parent_->is_status_initialized()) {
19 this->publish_vane_state(this->parent_->status().vane_mode);
20 }
21}
22
24 if (index < VALUES.size()) {
25 this->parent_->set_vane_mode(VALUES[index]);
26 this->parent_->publish_status();
27 }
28}
29
31 for (size_t i = 0; i < VALUES.size(); ++i) {
32 if (VALUES[i] == mode) {
33 this->publish_state(i);
34 return;
35 }
36 }
37}
38
39} // namespace esphome::mitsubishi_cn105
BedjetMode mode
BedJet operating mode.
void publish_state(const std::string &state)
Definition select.cpp:11