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");
96 uint8_t power_mode_cmd;
97 uint8_t operating_mode_cmd;
98 uint8_t temperature_cmd;
99 uint8_t fan_speed_cmd;
104 swing_v_cmd = VDIR_AUTO;
107 swing_v_cmd = VDIR_UP;
110 swing_v_cmd = VDIR_MUP;
113 swing_v_cmd = VDIR_MIDDLE;
116 swing_v_cmd = VDIR_MDOWN;
119 swing_v_cmd = VDIR_DOWN;
122 ESP_LOGE(TAG,
"Invalid default vertical direction");
126 swing_v_cmd = VDIR_SWING;
132 swing_h_cmd = HDIR_AUTO;
135 swing_h_cmd = HDIR_MIDDLE;
138 swing_h_cmd = HDIR_LEFT;
141 swing_h_cmd = HDIR_MLEFT;
144 swing_h_cmd = HDIR_MRIGHT;
147 swing_h_cmd = HDIR_RIGHT;
150 ESP_LOGE(TAG,
"Invalid default horizontal direction");
154 swing_h_cmd = HDIR_SWING;
159 fan_speed_cmd = FAN_2;
162 fan_speed_cmd = FAN_3;
165 fan_speed_cmd = FAN_4;
169 fan_speed_cmd = FAN_AUTO;
173 switch (this->
mode) {
175 power_mode_cmd = POWER_ON;
179 power_mode_cmd = POWER_ON;
183 power_mode_cmd = POWER_ON;
184 operating_mode_cmd = MODE_AUTO;
187 power_mode_cmd = POWER_ON;
191 power_mode_cmd = POWER_ON;
197 operating_mode_cmd = MODE_AUTO;
204 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