7 static const char *
const TAG =
"climate.whynter";
9 const uint16_t
BITS = 32;
104 uint32_t remote_state = 0;
106 if (!data.
expect_item(this->header_high_, this->header_low_))
109 for (nbits = 0; nbits < 32; nbits++) {
110 if (data.
expect_item(this->bit_high_, this->bit_one_low_)) {
111 remote_state = (remote_state << 1) | 1;
112 }
else if (data.
expect_item(this->bit_high_, this->bit_zero_low_)) {
113 remote_state = (remote_state << 1) | 0;
114 }
else if (nbits == BITS) {
121 ESP_LOGD(TAG,
"Decoded 0x%02" PRIX32, remote_state);
122 if ((remote_state & COMMAND_MASK) != COMMAND_CODE)
124 if ((remote_state & POWER_MASK) != POWER_MASK) {
127 if ((remote_state & MODE_MASK) == MODE_FAN) {
129 }
else if ((remote_state & MODE_MASK) == MODE_DRY) {
131 }
else if ((remote_state & MODE_MASK) == MODE_HEAT) {
133 }
else if ((remote_state & MODE_MASK) == MODE_COOL) {
138 if ((remote_state & UNIT_MASK) == UNIT_MASK) {
145 if ((remote_state & FAN_MASK) ==
FAN_LOW) {
147 }
else if ((remote_state & FAN_MASK) ==
FAN_MED) {
149 }
else if ((remote_state & FAN_MASK) ==
FAN_HIGH) {
159 ESP_LOGD(TAG,
"Sending Whynter code: 0x%02" PRIX32, value);
165 data->reserve(2 + BITS * 2u);
169 for (uint32_t mask = 1UL << (BITS - 1); mask != 0; mask >>= 1) {
The fan mode is set to Low.
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
value_type const & value() const
void transmit_(uint32_t value)
float target_temperature
The target temperature of the climate device.
void set_carrier_frequency(uint32_t carrier_frequency)
const uint32_t COMMAND_MASK
const uint32_t UNIT_SHIFT
The climate device is set to heat to reach the target temperature.
ClimateMode mode
The active mode of the climate device.
The climate device is set to dry/humidity mode.
climate::ClimateMode mode_before_
const uint32_t POWER_SHIFT
const uint32_t TEMP_OFFSET_C
uint8_t reverse_bits(uint8_t x)
Reverse the order of 8 bits.
The climate device is set to cool to reach the target temperature.
constexpr float celsius_to_fahrenheit(float value)
Convert degrees Celsius to degrees Fahrenheit.
void transmit_state() override
Transmit via IR the state of this climate controller.
RemoteTransmitterBase * transmitter_
The climate device is set to heat/cool to reach the target temperature.
void publish_state()
Publish the state of the climate device, to be called from integrations.
The fan mode is set to High.
RemoteTransmitData * get_data()
The climate device is off.
const uint32_t COMMAND_CODE
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
const uint32_t MODE_SHIFT
Implementation of SPI Controller mode.
The fan mode is set to Medium.
constexpr float fahrenheit_to_celsius(float value)
Convert degrees Fahrenheit to degrees Celsius.
bool expect_item(uint32_t mark, uint32_t space)
The climate device only has the fan enabled, no heating or cooling is taking place.
const uint32_t POWER_MASK