Compare commits

...
Author SHA1 Message Date
J. Nick Koston 8d3386742f [daikin] Keep the IR frame template in flash on ESP8266 2026-11-14 23:48:50 -06:00
+7 -3
View File
@@ -1,6 +1,7 @@
#include "daikin.h"
#include "esphome/components/remote_base/remote_base.h"
#include "esphome/core/application.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
namespace esphome::daikin {
@@ -30,9 +31,12 @@ void DaikinClimate::control(const climate::ClimateCall &call) {
}
void DaikinClimate::transmit_state() {
uint8_t remote_state[35] = {0x11, 0xDA, 0x27, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x11, 0xDA, 0x27, 0x00,
0x42, 0x49, 0x05, 0xA2, 0x11, 0xDA, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00};
// In flash: an initialized local array is copied from a RAM constant on ESP8266
static constexpr uint8_t REMOTE_STATE_TEMPLATE[35] PROGMEM = {
0x11, 0xDA, 0x27, 0x00, 0xC5, 0x00, 0x00, 0x00, 0x11, 0xDA, 0x27, 0x00, 0x42, 0x49, 0x05, 0xA2, 0x11, 0xDA,
0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00};
uint8_t remote_state[sizeof(REMOTE_STATE_TEMPLATE)];
progmem_memcpy(remote_state, REMOTE_STATE_TEMPLATE, sizeof(remote_state));
this->set_presets_(remote_state);
remote_state[21] = this->operation_mode_();