Open mx5gr opened 6 days ago
I managed to compile the component by making the following alterations..
Within the climate/daikin_s21_climate.cpp file, find/replace:
void DaikinS21Climate::dump_config() { ESP_LOGCONFIG(TAG, "DaikinS21Climate:"); ESP_LOGCONFIG(TAG, " Update interval: %lx", this->get_update_interval());
(Note: %u becomes %lx)
Within the same file, three more conditions (Disabled/Fan/Dry) are added to the following:
void DaikinS21Climate::save_setpoint(float value) {
auto mode = this->s21->get_climate_mode();
optional
}
}
}
optional
}
return loaded;
}
Furthermore, within the s21.cpp file, find & replace the following:
void DaikinS21::check_uart_settings() { for (auto uart : {this->tx_uart, this->rx_uart}) { if (uart->get_baud_rate() != S21_BAUD_RATE) { ESP_LOGE( TAG, " Invalid baud_rate: Integration requested baud_rate %u but you " "have %lx!", S21_BAUD_RATE, uart->get_baud_rate());
and
void DaikinS21::dump_config() { ESP_LOGCONFIG(TAG, "DaikinS21:"); ESP_LOGCONFIG(TAG, " Update interval: %lx", this->get_update_interval()); this->check_uart_settings(); }
(Note: %u becomes %lx)
As only ESP-IDF framework is supported by ESP32-C6, we defined the following esphome (2024.6.4) config:
` esphome: name: test-ac platformio_options: board_build.f_cpu: 160000000L board_build.f_flash: 80000000L board_build.flash_size: 4MB board_build.mcu: esp32c6 build_flags: "-DBOARD_HAS_PSRAM" board_build.arduino.memory_type: qio_opi
esp32: board: esp32-c6-devkitc-1 variant: ESP32C6 framework: type: esp-idf version: 5.2.2
sdkconfig_options: CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y
platform_version: 6.7.0
external_components: source: github://joshbenner/esphome-daikin-s21@main components: [ daikin_s21 ]
uart: id: s21_uart tx_pin: GPIO16 rx_pin: GPIO17 baud_rate: 2400 data_bits: 8 parity: EVEN stop_bits: 2 debug:
daikin_s21: tx_uart: s21_uart rx_uart: s21_uart
climate: name: Daikin Test platform: daikin_s21 visual: temperature_step: 0.5 `
When we tried to compile it, we get: `In file included from src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:3: src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp: In member function 'virtual void esphome::daikin_s21::DaikinS21Climate::dump_config()':
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:27:22: error: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=] 27 | ESP_LOGCONFIG(TAG, " Update interval: %u", this->get_update_interval()); | ^
~~~~~~src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT' 72 | #define ESPHOME_LOG_FORMAT(format) format | ^
~src/esphome/core/log.h:153:33: note: in expansion of macro 'esph_log_config' 153 | #define ESP_LOGCONFIG(tag, ...) esph_log_config(tag, __VA_ARGS__) | ^
~~~~~~src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:27:3: note: in expansion of macro 'ESP_LOGCONFIG' 27 | ESP_LOGCONFIG(TAG, " Update interval: %u", this->get_update_interval()); | ^
~~~~src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp: In member function 'void esphome::daikin_s21::DaikinS21Climate::save_setpoint(float)':
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:132:12: error: enumeration value 'Disabled' not handled in switch [-Werror=switch] 132 | switch (mode) { | ^
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:132:12: error: enumeration value 'Dry' not handled in switch [-Werror=switch]
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:132:12: error: enumeration value 'Fan' not handled in switch [-Werror=switch]
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp: In member function 'esphome::optional esphome::daikin_s21::DaikinS21Climate::load_setpoint(esphome::daikin_s21::DaikinClimateMode)':
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:156:10: error: enumeration value 'Disabled' not handled in switch [-Werror=switch] 156 | switch (this->s21->get_climate_mode()) { | ^ src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:156:10: error: enumeration value 'Dry' not handled in switch [-Werror=switch]
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:156:10: error: enumeration value 'Fan' not handled in switch [-Werror=switch]
src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp: In member function 'void esphome::daikin_s21::DaikinS21Climate::set_s21_climate()':
~~~ src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT' 72~src/esphome/core/log.h:151:28: note: in expansion of macro 'esph_log_i' 151~~~~~ src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:410:3: note: in expansion of macro 'ESP_LOGI' 410~~~ src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp:410:27: note: format string is defined here 410Compiling .pioenvs/sens-1st-bedroom-ac/src/esphome/components/esp32/core.cpp.o cc1plus: some warnings being treated as errors *** [.pioenvs/sens-1st-bedroom-ac/src/esphome/components/daikin_s21/climate/daikin_s21_climate.cpp.o] Error 1 In file included from src/esphome/components/uart/uart.h:6, from src/esphome/components/daikin_s21/s21.h:3, from src/esphome/components/daikin_s21/s21.cpp:1:
src/esphome/components/daikin_s21/s21.cpp: In member function 'void esphome::daikin_s21::DaikinS21::check_uart_settings()':
~~~~~~~~~~~~~108~~src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT' 72~src/esphome/core/log.h:149:28: note: in expansion of macro 'esph_log_e' 149~~~~~ src/esphome/components/daikin_s21/s21.cpp:105:7: note: in expansion of macro 'ESP_LOGE' 105~~~ src/esphome/components/daikin_s21/s21.cpp:108:18: note: format string is defined here 108src/esphome/components/daikin_s21/s21.cpp: In member function 'virtual void esphome::daikin_s21::DaikinS21::dump_config()':
~~~~~~ src/esphome/core/log.h:72:36: note: in definition of macro 'ESPHOME_LOG_FORMAT' 72~src/esphome/core/log.h:153:33: note: in expansion of macro 'esph_log_config' 153~~~~~~ src/esphome/components/daikin_s21/s21.cpp:136:3: note: in expansion of macro 'ESP_LOGCONFIG' 136~~~~ src/esphome/components/daikin_s21/s21.cpp:136:43: note: format string is defined here 136cc1plus: some warnings being treated as errors *** [.pioenvs/sens-1st-bedroom-ac/src/esphome/components/daikin_s21/s21.cpp.o] Error 1 ========================= [FAILED] Took 161.07 seconds =========================`