7 #include "HeatpumpIRFactory.h" 11 namespace heatpumpir {
13 static const char *
const TAG =
"heatpumpir.climate";
26 {
PROTOCOL_GREE, []() {
return new GreeGenericHeatpumpIR(); }},
72 auto protocol_constructor = PROTOCOL_CONSTRUCTOR_MAP.find(
protocol_);
73 if (protocol_constructor == PROTOCOL_CONSTRUCTOR_MAP.end()) {
74 ESP_LOGE(TAG,
"Invalid protocol");
95 uint8_t power_mode_cmd;
96 uint8_t operating_mode_cmd;
97 uint8_t temperature_cmd;
98 uint8_t fan_speed_cmd;
103 swing_v_cmd = VDIR_AUTO;
106 swing_v_cmd = VDIR_UP;
109 swing_v_cmd = VDIR_MUP;
112 swing_v_cmd = VDIR_MIDDLE;
115 swing_v_cmd = VDIR_MDOWN;
118 swing_v_cmd = VDIR_DOWN;
121 ESP_LOGE(TAG,
"Invalid default vertical direction");
125 swing_v_cmd = VDIR_SWING;
131 swing_h_cmd = HDIR_AUTO;
134 swing_h_cmd = HDIR_MIDDLE;
137 swing_h_cmd = HDIR_LEFT;
140 swing_h_cmd = HDIR_MLEFT;
143 swing_h_cmd = HDIR_MRIGHT;
146 swing_h_cmd = HDIR_RIGHT;
149 ESP_LOGE(TAG,
"Invalid default horizontal direction");
153 swing_h_cmd = HDIR_SWING;
158 fan_speed_cmd = FAN_2;
161 fan_speed_cmd = FAN_3;
164 fan_speed_cmd = FAN_4;
168 fan_speed_cmd = FAN_AUTO;
172 switch (this->
mode) {
174 power_mode_cmd = POWER_ON;
178 power_mode_cmd = POWER_ON;
182 power_mode_cmd = POWER_ON;
183 operating_mode_cmd = MODE_AUTO;
186 power_mode_cmd = POWER_ON;
190 power_mode_cmd = POWER_ON;
196 operating_mode_cmd = MODE_AUTO;
203 heatpump_ir_->send(esp_sender, power_mode_cmd, operating_mode_cmd, fan_speed_cmd, temperature_cmd, swing_v_cmd,
The fan mode is set to Low.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
The fan mode is set to Both.
float target_temperature
The target temperature of the climate device.
The climate device is set to heat to reach the target temperature.
ClimateMode mode
The active mode of the climate device.
float current_temperature
The current temperature of the climate device, as reported from the integration.
void transmit_state() override
Transmit via IR the state of this climate controller.
The climate device is set to dry/humidity mode.
constexpr const T & clamp(const T &v, const T &lo, const T &hi, Compare comp)
BedJet is in Dry mode (high speed, no heat)
HorizontalDirection default_horizontal_direction_
BedJet is in Cool mode (actually "Fan only" mode)
The fan mode is set to Horizontal.
The climate device is set to cool to reach the target temperature.
float state
This member variable stores the last state that has passed through all filters.
The fan mode is set to Auto.
BedJet is in Heat mode (limited to 4 hours)
RemoteTransmitterBase * transmitter_
The climate device is adjusting the temperatre dynamically.
The fan mode is set to Vertical.
VerticalDirection default_vertical_direction_
void publish_state()
Publish the state of the climate device, to be called from integrations.
The fan mode is set to High.
The climate device is off.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
const std::map< Protocol, std::function< HeatpumpIR *()> > PROTOCOL_CONSTRUCTOR_MAP
Implementation of SPI Controller mode.
The fan mode is set to Medium.
HeatpumpIR * heatpump_ir_
The climate device only has the fan enabled, no heating or cooling is taking place.
value_type value_or(U const &v) const