7 #include "HeatpumpIRFactory.h" 11 namespace heatpumpir {
13 static const char *
const TAG =
"heatpumpir.climate";
26 {
PROTOCOL_GREE, []() {
return new GreeGenericHeatpumpIR(); }},
60 auto protocol_constructor = PROTOCOL_CONSTRUCTOR_MAP.find(
protocol_);
61 if (protocol_constructor == PROTOCOL_CONSTRUCTOR_MAP.end()) {
62 ESP_LOGE(TAG,
"Invalid protocol");
83 uint8_t power_mode_cmd;
84 uint8_t operating_mode_cmd;
85 uint8_t temperature_cmd;
86 uint8_t fan_speed_cmd;
91 swing_v_cmd = VDIR_AUTO;
94 swing_v_cmd = VDIR_UP;
97 swing_v_cmd = VDIR_MUP;
100 swing_v_cmd = VDIR_MIDDLE;
103 swing_v_cmd = VDIR_MDOWN;
106 swing_v_cmd = VDIR_DOWN;
109 ESP_LOGE(TAG,
"Invalid default vertical direction");
113 swing_v_cmd = VDIR_SWING;
119 swing_h_cmd = HDIR_AUTO;
122 swing_h_cmd = HDIR_MIDDLE;
125 swing_h_cmd = HDIR_LEFT;
128 swing_h_cmd = HDIR_MLEFT;
131 swing_h_cmd = HDIR_MRIGHT;
134 swing_h_cmd = HDIR_RIGHT;
137 ESP_LOGE(TAG,
"Invalid default horizontal direction");
141 swing_h_cmd = HDIR_SWING;
146 fan_speed_cmd = FAN_2;
149 fan_speed_cmd = FAN_3;
152 fan_speed_cmd = FAN_4;
156 fan_speed_cmd = FAN_AUTO;
160 switch (this->
mode) {
162 power_mode_cmd = POWER_ON;
166 power_mode_cmd = POWER_ON;
170 power_mode_cmd = POWER_ON;
171 operating_mode_cmd = MODE_AUTO;
174 power_mode_cmd = POWER_ON;
178 power_mode_cmd = POWER_ON;
184 operating_mode_cmd = MODE_AUTO;
191 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)
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
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.
remote_transmitter::RemoteTransmitterComponent * transmitter_
value_type value_or(U const &v) const