[component] Fix components for compatibility with stricter compilers (#14545)

Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
Diorcet Yann
2026-03-07 18:50:44 +00:00
committed by GitHub
co-authored by Jonathan Swoboda
parent a0cd35c5fc
commit 3f700bac1c
8 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -451,7 +451,7 @@ void ESP32BLE::loop() {
ESP_LOGV(TAG, "gap_event_handler - %d", gap_event);
#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT
{
esp_ble_gap_cb_param_t *param;
esp_ble_gap_cb_param_t *param = NULL;
// clang-format off
switch (gap_event) {
// All three scan complete events have the same structure with just status
@@ -27,7 +27,7 @@
#include "esp_rom_sys.h"
#include "esp_idf_version.h"
#if defined(USE_ARDUINO) || ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2)
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
static const char *TAG = "jl1101";
#define PHY_CHECK(a, str, goto_tag, ...) \
@@ -209,7 +209,7 @@ void EthernetComponent::setup() {
break;
}
#endif
#ifdef USE_ETHERNET_JL1101
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
case ETHERNET_TYPE_JL1101: {
this->phy_ = esp_eth_phy_new_jl1101(&phy_config);
break;
@@ -374,7 +374,7 @@ void EthernetComponent::dump_config() {
eth_type = "IP101";
break;
#endif
#ifdef USE_ETHERNET_JL1101
#if defined(USE_ETHERNET_JL1101) && (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 4, 2) || !defined(PLATFORMIO))
case ETHERNET_TYPE_JL1101:
eth_type = "JL1101";
break;
+1
View File
@@ -125,6 +125,7 @@ async def to_code(config):
cg.add(var.set_vertical_default(config[CONF_VERTICAL_DEFAULT]))
cg.add(var.set_max_temperature(config[CONF_MAX_TEMPERATURE]))
cg.add(var.set_min_temperature(config[CONF_MIN_TEMPERATURE]))
cg.add_build_flag("-Wno-error=overloaded-virtual")
cg.add_library("tonia/HeatpumpIR", "1.0.40")
if CORE.is_libretiny or CORE.is_esp32:
@@ -128,7 +128,8 @@ void HttpRequestUpdate::update_task(void *params) {
this_update->update_info_.title = root[ESPHOME_F("name")].as<std::string>();
this_update->update_info_.latest_version = root[ESPHOME_F("version")].as<std::string>();
for (auto build : root[ESPHOME_F("builds")].as<JsonArray>()) {
auto builds_array = root[ESPHOME_F("builds")].as<JsonArray>();
for (auto build : builds_array) {
if (!build[ESPHOME_F("chipFamily")].is<const char *>()) {
ESP_LOGE(TAG, "Manifest does not contain required fields");
return false;
@@ -160,7 +160,7 @@ bool MLX90393Cls::verify_setting_(MLX90393Setting which) {
uint8_t read_value = 0xFF;
uint8_t expected_value = 0xFF;
uint8_t read_status = -1;
char read_back_str[25] = {0};
char read_back_str[33] = {0};
switch (which) {
case MLX90393_GAIN_SEL: {
@@ -32,6 +32,13 @@ const uint8_t WHIRLPOOL_SWING_MASK = 128;
const uint8_t WHIRLPOOL_POWER = 0x04;
WhirlpoolClimate::WhirlpoolClimate()
: climate_ir::ClimateIR(
WHIRLPOOL_DG11J1_3A_TEMP_MIN, WHIRLPOOL_DG11J1_3A_TEMP_MAX, 1.0f, true, true,
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM, climate::CLIMATE_FAN_HIGH},
{climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_VERTICAL}),
model_(MODEL_DG11J1_3A) {}
void WhirlpoolClimate::transmit_state() {
this->last_transmit_time_ = millis(); // setting the time of the last transmission.
uint8_t remote_state[WHIRLPOOL_STATE_LENGTH] = {0};
+6 -6
View File
@@ -19,11 +19,7 @@ const float WHIRLPOOL_DG11J1_91_TEMP_MIN = 16.0;
class WhirlpoolClimate : public climate_ir::ClimateIR {
public:
WhirlpoolClimate()
: climate_ir::ClimateIR(temperature_min_(), temperature_max_(), 1.0f, true, true,
{climate::CLIMATE_FAN_AUTO, climate::CLIMATE_FAN_LOW, climate::CLIMATE_FAN_MEDIUM,
climate::CLIMATE_FAN_HIGH},
{climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_VERTICAL}) {}
WhirlpoolClimate();
void setup() override {
climate_ir::ClimateIR::setup();
@@ -37,7 +33,11 @@ class WhirlpoolClimate : public climate_ir::ClimateIR {
climate_ir::ClimateIR::control(call);
}
void set_model(Model model) { this->model_ = model; }
void set_model(Model model) {
this->model_ = model;
this->minimum_temperature_ = temperature_min_();
this->maximum_temperature_ = temperature_max_();
}
// used to track when to send the power toggle command
bool powered_on_assumed;