ESPHome 2026.3.3
Loading...
Searching...
No Matches
coolix.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cinttypes>
6
7namespace esphome {
8namespace coolix {
9
10// Temperature
11const uint8_t COOLIX_TEMP_MIN = 17; // Celsius
12const uint8_t COOLIX_TEMP_MAX = 30; // Celsius
13
15 public:
21
23 void control(const climate::ClimateCall &call) override {
24 send_swing_cmd_ = call.get_swing_mode().has_value();
25 // swing resets after unit powered off
26 auto mode = call.get_mode();
27 if (mode.has_value() && *mode == climate::CLIMATE_MODE_OFF)
30 }
31
35
36 protected:
38 void transmit_state() override;
40 bool on_receive(remote_base::RemoteReceiveData data) override { return CoolixClimate::on_coolix(this, data); }
41
42 bool send_swing_cmd_{false};
43};
44
45} // namespace coolix
46} // namespace esphome
This class is used to encode all control actions on a climate device.
Definition climate.h:33
ClimateDevice - This is the base class for all climate integrations.
Definition climate.h:186
ClimateMode mode
The active mode of the climate device.
Definition climate.h:266
ClimateSwingMode swing_mode
The active swing mode of the climate device.
Definition climate.h:272
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
ClimateIR(float minimum_temperature, float maximum_temperature, float temperature_step=1.0f, bool supports_dry=false, bool supports_fan_only=false, climate::ClimateFanModeMask fan_modes=climate::ClimateFanModeMask(), climate::ClimateSwingModeMask swing_modes=climate::ClimateSwingModeMask(), climate::ClimatePresetMask presets=climate::ClimatePresetMask())
Definition climate_ir.h:26
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
Definition coolix.h:23
void transmit_state() override
Transmit via IR the state of this climate controller.
Definition coolix.cpp:49
static bool on_coolix(climate::Climate *parent, remote_base::RemoteReceiveData data)
This static method can be used in other climate components that accept the Coolix protocol.
Definition coolix.cpp:108
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
Definition coolix.h:40
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_MODE_OFF
The climate device is off.
@ 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.
const uint8_t COOLIX_TEMP_MAX
Definition coolix.h:12
const uint8_t COOLIX_TEMP_MIN
Definition coolix.h:11
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7