9static const uint8_t DEFAULT_ODD[] PROGMEM = {0x23, 0xCB, 0x26, 0x02, 0x00, 0x40, 0xC0,
10 0x00, 0xC3, 0x00, 0x00, 0x00, 0x00};
11static const uint8_t DEFAULT_EVEN[] PROGMEM = {0x23, 0xCB, 0x26, 0x01, 0x00, 0x24, 0x03,
12 0x0B, 0x05, 0x00, 0x00, 0x00, 0x80};
15static const uint8_t FAN_CODES[][3] PROGMEM = {
16 {0x40, 0x20, 0x00}, {0x60, 0x40, 0x02}, {0x40, 0x60, 0x03}, {0x40, 0xC0, 0x05}};
17static constexpr size_t FAN_CODE_COUNT =
sizeof(FAN_CODES) /
sizeof(FAN_CODES[0]);
25 const int halves =
static_cast<int>(lroundf(temp_c * 4)) / 2;
26 this->
even_[7] =
static_cast<uint8_t
>(31 - halves / 2);
27 this->
even_[12] =
static_cast<uint8_t
>(0x80 | ((halves & 1) ? 0x04 : 0x00));
35 this->
even_[7] = 0x0C;
36 this->
even_[12] = 0x80;
90 const uint8_t code =
even[8] & ~SWING_VERTICAL_EVEN_MASK;
91 for (
size_t idx = 0; idx < FAN_CODE_COUNT; idx++) {
BedjetMode mode
BedJet operating mode.
static constexpr uint8_t MODE_HEAT
static constexpr uint8_t MODE_AUTO
static optional< ClimateMode > get_mode(const PDPioneerData &even)
Empty for a mode byte this remote does not use.
static constexpr uint8_t MODE_DRY
void set_swing_mode(climate::ClimateSwingMode mode)
static ClimateFanMode get_fan_mode(const PDPioneerData &even)
static constexpr uint8_t SWING_VERTICAL_EVEN_MASK
Vertical swing also sets this mask on even frame position 8 (fan sub-code).
void finalize()
Write the fan and swing positions, which share bytes, then the checksums.
void set_mode(ClimateMode mode)
static constexpr uint8_t MODE_FAN_ONLY
static constexpr uint8_t MODE_COOL
uint8_t swing_
Odd-burst position 7: SWING_VERTICAL and SWING_HORIZONTAL flags.
static constexpr uint8_t SWING_VERTICAL
static constexpr uint8_t PWR_OFF
const PDPioneerData & even() const
static constexpr uint8_t PWR_ON
void set_temp(float temp_c)
static climate::ClimateSwingMode get_swing_mode(const PDPioneerData &even, bool horizontal)
static constexpr uint8_t SWING_HORIZONTAL
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_SWING_HORIZONTAL
The fan mode is set to Horizontal.
@ CLIMATE_SWING_VERTICAL
The fan mode is set to Vertical.
@ CLIMATE_SWING_BOTH
The fan mode is set to Both.
ClimateMode
Enum for all modes a climate device can be in.
@ 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.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
@ CLIMATE_FAN_HIGH
The fan mode is set to High.
constexpr uint8_t PDPIONEER_TEMPC_MAX
constexpr uint8_t PDPIONEER_TEMPC_MIN
uint8_t progmem_read_byte(const uint8_t *addr)