From 1c6575a2640b2a57908d2a969735649dd69e3885 Mon Sep 17 00:00:00 2001 From: Itay Shoshani <5647956+itay-sho@users.noreply.github.com> Date: Sat, 26 Oct 2024 09:46:26 +0300 Subject: [PATCH 1/2] feat: support esp-idf --- components/aux_ac/aux_ac.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/aux_ac/aux_ac.h b/components/aux_ac/aux_ac.h index 68d0912..27f3cc4 100644 --- a/components/aux_ac/aux_ac.h +++ b/components/aux_ac/aux_ac.h @@ -4,8 +4,10 @@ /// немного переработанная версия старого компонента #pragma once -#include #include +#ifndef F +#define F(string_literal) (string_literal) +#endif #include "esphome.h" #include "esphome/components/binary_sensor/binary_sensor.h" @@ -16,6 +18,8 @@ #include "esphome/core/component.h" #include "esphome/core/helpers.h" +using String = std::string; + // весь функционал сохранения пресетов прячу под дефайн // #define PRESETS_SAVING #ifdef PRESETS_SAVING From cf990eb467f2c7d2202ad1f23596e4e795da9c02 Mon Sep 17 00:00:00 2001 From: Itay Shoshani <5647956+itay-sho@users.noreply.github.com> Date: Sat, 26 Oct 2024 09:47:32 +0300 Subject: [PATCH 2/2] fix: using correct int types to reduce compilation warnings / errors required due to the fact that esp32-c6 compiler raises errors due to that --- components/aux_ac/aux_ac.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/aux_ac/aux_ac.h b/components/aux_ac/aux_ac.h index 27f3cc4..3bc30cd 100644 --- a/components/aux_ac/aux_ac.h +++ b/components/aux_ac/aux_ac.h @@ -5,6 +5,7 @@ #pragma once #include +#include #ifndef F #define F(string_literal) (string_literal) #endif @@ -1714,7 +1715,7 @@ namespace esphome // заполняем время получения пакета memset(textBuf, 0, 11); - sprintf(textBuf, "%010u", packet->msec); + sprintf(textBuf, "%010" PRIu32, packet->msec); st = st + textBuf + ": "; // формируем преамбулы @@ -2843,11 +2844,11 @@ namespace esphome { ESP_LOGCONFIG(TAG, "AUX HVAC:"); ESP_LOGCONFIG(TAG, " [x] Firmware version: %s", Constants::AC_FIRMWARE_VERSION.c_str()); - ESP_LOGCONFIG(TAG, " [x] Period: %dms", this->get_period()); + ESP_LOGCONFIG(TAG, " [x] Period: %" PRIu32 "ms", this->get_period()); ESP_LOGCONFIG(TAG, " [x] Show action: %s", TRUEFALSE(this->get_show_action())); ESP_LOGCONFIG(TAG, " [x] Display inverted: %s", TRUEFALSE(this->get_display_inverted())); ESP_LOGCONFIG(TAG, " [x] Optimistic: %s", TRUEFALSE(this->get_optimistic())); - ESP_LOGCONFIG(TAG, " [x] Packet timeout: %dms", this->get_packet_timeout()); + ESP_LOGCONFIG(TAG, " [x] Packet timeout: %" PRIu32 "ms", this->get_packet_timeout()); #if defined(PRESETS_SAVING) ESP_LOGCONFIG(TAG, " [x] Save settings %s", TRUEFALSE(this->get_store_settings()));