7#include "HeatpumpIRFactory.h"
13static const char *
const TAG =
"heatpumpir.climate";
26 {
PROTOCOL_GREE, []() {
return new GreeGenericHeatpumpIR(); }},
76 ESP_LOGE(TAG,
"Invalid protocol");
98 uint8_t power_mode_cmd;
99 uint8_t operating_mode_cmd;
100 uint8_t temperature_cmd;
101 uint8_t fan_speed_cmd;
106 swing_v_cmd = VDIR_AUTO;
109 swing_v_cmd = VDIR_UP;
112 swing_v_cmd = VDIR_MUP;
115 swing_v_cmd = VDIR_MIDDLE;
118 swing_v_cmd = VDIR_MDOWN;
121 swing_v_cmd = VDIR_DOWN;
124 ESP_LOGE(TAG,
"Invalid default vertical direction");
128 swing_v_cmd = VDIR_SWING;
134 swing_h_cmd = HDIR_AUTO;
137 swing_h_cmd = HDIR_MIDDLE;
140 swing_h_cmd = HDIR_LEFT;
143 swing_h_cmd = HDIR_MLEFT;
146 swing_h_cmd = HDIR_MRIGHT;
149 swing_h_cmd = HDIR_RIGHT;
152 ESP_LOGE(TAG,
"Invalid default horizontal direction");
156 swing_h_cmd = HDIR_SWING;
161 fan_speed_cmd = FAN_2;
164 fan_speed_cmd = FAN_3;
167 fan_speed_cmd = FAN_4;
171 fan_speed_cmd = FAN_AUTO;
175 switch (this->
mode) {
177 power_mode_cmd = POWER_ON;
178 operating_mode_cmd = MODE_COOL;
181 power_mode_cmd = POWER_ON;
182 operating_mode_cmd = MODE_HEAT;
185 power_mode_cmd = POWER_ON;
186 operating_mode_cmd = MODE_AUTO;
189 power_mode_cmd = POWER_ON;
190 operating_mode_cmd = MODE_FAN;
193 power_mode_cmd = POWER_ON;
194 operating_mode_cmd = MODE_DRY;
198 power_mode_cmd = POWER_OFF;
199 operating_mode_cmd = MODE_AUTO;
206 heatpump_ir_->send(esp_sender, power_mode_cmd, operating_mode_cmd, fan_speed_cmd, temperature_cmd, swing_v_cmd,
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float current_temperature
The current temperature of the climate device, as reported from the integration.
void publish_state()
Publish the state of the climate device, to be called from integrations.
VerticalDirection default_vertical_direction_
void transmit_state() override
Transmit via IR the state of this climate controller.
HorizontalDirection default_horizontal_direction_
HeatpumpIR * heatpump_ir_
value_type value_or(U const &v) const
RemoteTransmitterBase * transmitter_
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
float state
This member variable stores the last state that has passed through all filters.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_MODE_AUTO
The climate device is adjusting the temperature dynamically.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
@ VERTICAL_DIRECTION_MIDDLE
@ VERTICAL_DIRECTION_MDOWN
@ VERTICAL_DIRECTION_AUTO
@ VERTICAL_DIRECTION_DOWN
const std::map< Protocol, std::function< HeatpumpIR *()> > PROTOCOL_CONSTRUCTOR_MAP
@ HORIZONTAL_DIRECTION_RIGHT
@ HORIZONTAL_DIRECTION_MIDDLE
@ HORIZONTAL_DIRECTION_MRIGHT
@ HORIZONTAL_DIRECTION_AUTO
@ HORIZONTAL_DIRECTION_MLEFT
@ HORIZONTAL_DIRECTION_LEFT
@ PROTOCOL_MITSUBISHI_HEAVY_ZMP
@ PROTOCOL_MITSUBISHI_HEAVY_ZM
@ PROTOCOL_MITSUBISHI_HEAVY_ZJ
@ PROTOCOL_SAMSUNG_AQV12MSAN
@ PROTOCOL_MITSUBISHI_MSC
@ PROTOCOL_MITSUBISHI_MSY
@ PROTOCOL_MITSUBISHI_HEAVY_FDTC
@ PROTOCOL_MITSUBISHI_SEZ
@ PROTOCOL_TOSHIBA_DAISEIKAI
@ PROTOCOL_PANASONIC_ALTDKE
Providing packet encoding functions for exchanging data with a remote host.