ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
climate_ir_lg.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <cinttypes>
6
8
9// Temperature
10const uint8_t TEMP_MIN = 18; // Celsius
11const uint8_t TEMP_MAX = 30; // Celsius
12
14 public:
20
22 void control(const climate::ClimateCall &call) override {
23 this->send_swing_cmd_ = call.get_swing_mode().has_value();
24 // swing resets after unit powered off
25 auto mode = call.get_mode();
26 if (mode.has_value() && *mode == climate::CLIMATE_MODE_OFF)
29 }
30 void set_header_high(uint32_t header_high) { this->header_high_ = header_high; }
31 void set_header_low(uint32_t header_low) { this->header_low_ = header_low; }
32 void set_bit_high(uint32_t bit_high) { this->bit_high_ = bit_high; }
33 void set_bit_one_low(uint32_t bit_one_low) { this->bit_one_low_ = bit_one_low; }
34 void set_bit_zero_low(uint32_t bit_zero_low) { this->bit_zero_low_ = bit_zero_low; }
35
36 protected:
38 void transmit_state() override;
41
42 bool send_swing_cmd_{false};
43
44 void calc_checksum_(uint32_t &value);
45 void transmit_(uint32_t value);
46
52
54};
55
56} // namespace esphome::climate_ir_lg
This class is used to encode all control actions on a climate device.
Definition climate.h:34
const optional< ClimateSwingMode > & get_swing_mode() const
Definition climate.cpp:314
ClimateMode mode
The active mode of the climate device.
Definition climate.h:293
ClimateSwingMode swing_mode
The active swing mode of the climate device.
Definition climate.h:299
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:25
void set_bit_high(uint32_t bit_high)
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
void set_header_high(uint32_t header_high)
void transmit_state() override
Transmit via IR the state of this climate controller.
void set_bit_zero_low(uint32_t bit_zero_low)
void set_header_low(uint32_t header_low)
void set_bit_one_low(uint32_t bit_one_low)
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
ClimateMode
Enum for all modes a climate device can be in.
@ 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.
static void uint32_t