19static constexpr size_t MAX_BODY_SIZE = 32;
20static constexpr size_t TX_QUEUE_SIZE = 4;
24 void setup()
override;
45 const uint8_t *body,
size_t len);
65 std::array<uint8_t, MAX_BODY_SIZE>
body;
Fixed-size circular buffer with FIFO semantics and iteration support.
This class is used to encode all control actions on a climate device.
ClimateDevice - This is the base class for all climate integrations.
virtual ClimateTraits traits()=0
Get the default traits of this climate device.
void dump_config() override
void write_frame_(uint8_t flags, uint8_t type, uint8_t seq, uint8_t ack, uint8_t class_1, uint8_t class_2, const uint8_t *body, size_t len)
StaticRingBuffer< PendingCommand, TX_QUEUE_SIZE > queue_
void send_setting_(uint16_t attr, bool on)
Queues a command that sets one on/off attribute.
static constexpr int8_t POWER_UNCHANGED
void set_beeper_on(bool on)
Turns the beep that confirms each command on or off.
SUB_SWITCH(display) SUB_SWITCH(beeper) protected void control(const climate::ClimateCall &call) override
void handle_status_(const uint8_t *body, size_t len)
void handle_frame_(const uint8_t *frame, size_t len)
bool wanted_power_(bool skip_head) const
Power once the queued commands are applied; skip_head leaves out a head about to be dropped.
void set_display_on(bool on)
Turns the indoor unit's front display on or off.
void pop_command_()
Removes the command at the head of the queue.
void queue_command_(uint8_t msg_class, const uint8_t *body, size_t len, int8_t power=POWER_UNCHANGED)
Queues a data frame that the AC must acknowledge; it is resent until it is.
std::array< uint8_t, MAX_BODY_SIZE > body