7 #include "HeatpumpIRFactory.h" 11 namespace heatpumpir {
13 static const char *
const TAG =
"heatpumpir.climate";
26 {
PROTOCOL_GREE, []() {
return new GreeGenericHeatpumpIR(); }},
61 auto protocol_constructor = PROTOCOL_CONSTRUCTOR_MAP.find(
protocol_);
62 if (protocol_constructor == PROTOCOL_CONSTRUCTOR_MAP.end()) {
63 ESP_LOGE(TAG,
"Invalid protocol");
84 uint8_t power_mode_cmd;
85 uint8_t operating_mode_cmd;
86 uint8_t temperature_cmd;
87 uint8_t fan_speed_cmd;
92 swing_v_cmd = VDIR_AUTO;
95 swing_v_cmd = VDIR_UP;
98 swing_v_cmd = VDIR_MUP;
101 swing_v_cmd = VDIR_MIDDLE;
104 swing_v_cmd = VDIR_MDOWN;
107 swing_v_cmd = VDIR_DOWN;
110 ESP_LOGE(TAG,
"Invalid default vertical direction");
114 swing_v_cmd = VDIR_SWING;
120 swing_h_cmd = HDIR_AUTO;
123 swing_h_cmd = HDIR_MIDDLE;
126 swing_h_cmd = HDIR_LEFT;
129 swing_h_cmd = HDIR_MLEFT;
132 swing_h_cmd = HDIR_MRIGHT;
135 swing_h_cmd = HDIR_RIGHT;
138 ESP_LOGE(TAG,
"Invalid default horizontal direction");
142 swing_h_cmd = HDIR_SWING;
147 fan_speed_cmd = FAN_2;
150 fan_speed_cmd = FAN_3;
153 fan_speed_cmd = FAN_4;
157 fan_speed_cmd = FAN_AUTO;
161 switch (this->
mode) {
163 power_mode_cmd = POWER_ON;
167 power_mode_cmd = POWER_ON;
171 power_mode_cmd = POWER_ON;
172 operating_mode_cmd = MODE_AUTO;
175 power_mode_cmd = POWER_ON;
179 power_mode_cmd = POWER_ON;
185 operating_mode_cmd = MODE_AUTO;
192 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
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.
remote_transmitter::RemoteTransmitterComponent * transmitter_
value_type value_or(U const &v) const