7static const char *
const TAG =
"climate.whynter";
9const 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);
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) {
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.
void publish_state()
Publish the state of the climate device, to be called from integrations.
value_type const & value() const
bool expect_item(uint32_t mark, uint32_t space)
void set_carrier_frequency(uint32_t carrier_frequency)
RemoteTransmitterBase * transmitter_
RemoteTransmitData * get_data()
void transmit_(uint32_t value)
bool on_receive(remote_base::RemoteReceiveData data) override
Handle received IR Buffer.
climate::ClimateMode mode_before_
void transmit_state() override
Transmit via IR the state of this climate controller.
@ 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_LOW
The fan mode is set to Low.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
const uint32_t COMMAND_CODE
const uint32_t UNIT_SHIFT
const uint32_t POWER_MASK
const uint32_t COMMAND_MASK
const uint32_t TEMP_OFFSET_C
const uint32_t MODE_SHIFT
const uint32_t POWER_SHIFT
Providing packet encoding functions for exchanging data with a remote host.
constexpr float celsius_to_fahrenheit(float value)
Convert degrees Celsius to degrees Fahrenheit.
constexpr float fahrenheit_to_celsius(float value)
Convert degrees Fahrenheit to degrees Celsius.
uint8_t reverse_bits(uint8_t x)
Reverse the order of 8 bits.