39 remote_state[0] = 0x23;
40 remote_state[1] = 0xCB;
41 remote_state[2] = 0x26;
42 remote_state[3] = 0x01;
43 remote_state[5] = 0x24;
44 remote_state[6] = 0x03;
45 remote_state[7] = 0x07;
46 remote_state[8] = 0x40;
51 remote_state[6] &= 0xF0;
55 remote_state[6] &= 0xF0;
59 remote_state[6] &= 0xF0;
63 remote_state[6] &= 0xF0;
67 remote_state[6] &= 0xF0;
72 remote_state[5] &= ~TCL112_POWER_MASK;
81 auto half_degrees =
static_cast<uint8_t
>(safecelsius * 2);
82 if (half_degrees & 1) {
85 remote_state[12] &= ~TCL112_HALF_DEGREE;
87 remote_state[7] &= 0xF0;
106 remote_state[8] |= selected_fan;
121 auto *data = transmit.get_data();
123 data->set_carrier_frequency(38000);
140 ESP_LOGVV(TAG,
"Header fail");
146 ESP_LOGVV(TAG,
"Data fail");
151 ESP_LOGVV(TAG,
"Footer fail");
159 ESP_LOGVV(TAG,
"Checksum fail");
166 if (remote_state[0] != 0x23 || remote_state[1] != 0xCB)
172 auto mode = remote_state[6] & 0x0F;
197 auto fan = remote_state[8] & 0x7;
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
void publish_state()
Publish the state of the climate device, to be called from integrations.
RemoteTransmitterBase * transmitter_
void transmit_state() override
Transmit via IR the state of this climate controller.
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_FAN_MEDIUM
The fan mode is set to Medium.
@ CLIMATE_FAN_ON
The fan mode is set to On.
@ 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 TCL112_AUTO
const float TCL112_TEMP_MAX
const uint16_t TCL112_BIT_MARK
const uint8_t TCL112_HALF_DEGREE
const uint8_t TCL112_VSWING_MASK
const uint16_t TCL112_HEADER_MARK
ESPHOME_LOG_TAG(TAG, "tcl112.climate")
const uint16_t TCL112_HEADER_SPACE
const uint32_t TCL112_GAP
const uint8_t TCL112_FAN_MED
const uint8_t TCL112_FAN_HIGH
const float TCL112_TEMP_MIN
const uint8_t TCL112_FAN_LOW
const uint8_t TCL112_FAN_AUTO
const uint8_t TCL112_COOL
const uint16_t TCL112_BITS
const uint8_t TCL112_POWER_MASK
const uint16_t TCL112_STATE_LENGTH
const uint8_t TCL112_HEAT
constexpr uint8_t sum_bytes(const uint8_t *data, size_t len, uint8_t sum=0)
Add up the bytes of data with size len, truncated to 8 bits: the checksum many serial and IR protocol...
A bit is a mark (one_mark or zero_mark, both bit_mark unless set) and a space (one_space or zero_spac...