Skip to content

Compilation errors on esphome 2026.1.0 #177

@atax112

Description

@atax112

Hello, encountered following compilation issues with latest esphome version.

Compiling .pioenvs/bedroomac/src/esphome/components/select/select.cpp.o
src/esphome/components/panasonic_ac/esppac_cnt.cpp: In member function 'virtual void esphome::panasonic_ac::CNT::PanasonicACCNT::control(const esphome::climate::ClimateCall&)':
src/esphome/components/panasonic_ac/esppac_cnt.cpp:251:39: error: cannot convert 'esphome::StringRef' to 'const char*'
  251 |     if (strcmp(this->get_custom_preset(), "Normal") != 0) {
      |                ~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                       |
      |                                       esphome::StringRef
In file included from /data/cache/platformio/packages/toolchain-xtensa-esp-elf/xtensa-esp-elf/include/c++/14.2.0/cstring:43,
                 from src/esphome/core/helpers.h:6,
                 from src/esphome/core/component.h:8,
                 from src/esphome/components/climate/climate.h:3,
                 from src/esphome/components/panasonic_ac/esppac_cnt.h:1,
                 from src/esphome/components/panasonic_ac/esppac_cnt.cpp:1:
/data/cache/platformio/packages/toolchain-xtensa-esp-elf/xtensa-esp-elf/include/string.h:36:18: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
   36 | int      strcmp (const char *, const char *);
      |                  ^~~~~~~~~~~~
src/esphome/components/panasonic_ac/esppac_cnt.cpp:256:51: error: cannot convert 'esphome::StringRef' to 'const char*' in initialization
  256 |     const char *fanMode = call.get_custom_fan_mode();
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                   |
      |                                                   esphome::StringRef
src/esphome/components/panasonic_ac/esppac_cnt.cpp:299:48: error: cannot convert 'esphome::StringRef' to 'const char*' in initialization
  299 |     const char *preset = call.get_custom_preset();
      |                          ~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                |
      |                                                esphome::StringRef
src/esphome/components/panasonic_ac/esppac.cpp: In member function 'void esphome::panasonic_ac::PanasonicAC::set_vertical_swing_select(esphome::select::Select*)':
src/esphome/components/panasonic_ac/esppac.cpp:219:55: error: cannot convert 'esphome::panasonic_ac::PanasonicAC::set_vertical_swing_select(esphome::select::Select*)::<lambda(const std::string&, size_t)>' to 'std::function<void(unsigned int)>&&'
  219 |   this->vertical_swing_select_->add_on_state_callback([this](const std::string &value, size_t index) {
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                       |
      |                                                       esphome::panasonic_ac::PanasonicAC::set_vertical_swing_select(esphome::select::Select*)::<lambda(const std::string&, size_t)>
  220 |     if (value == this->vertical_swing_state_)
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          
  221 |       return;
      |       ~~~~~~~                                          
  222 |     this->on_vertical_swing_change(value);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             
  223 |   });
      |   ~                                                    
In file included from src/esphome/components/panasonic_ac/esppac.h:4,
                 from src/esphome/components/panasonic_ac/esppac.cpp:1:
src/esphome/components/select/select.h:81:60: note:   initializing argument 1 of 'void esphome::select::Select::add_on_state_callback(std::function<void(unsigned int)>&&)'
   81 |   void add_on_state_callback(std::function<void(size_t)> &&callback);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
src/esphome/components/panasonic_ac/esppac.cpp: In member function 'void esphome::panasonic_ac::PanasonicAC::set_horizontal_swing_select(esphome::select::Select*)':
src/esphome/components/panasonic_ac/esppac.cpp:228:57: error: cannot convert 'esphome::panasonic_ac::PanasonicAC::set_horizontal_swing_select(esphome::select::Select*)::<lambda(const std::string&, size_t)>' to 'std::function<void(unsigned int)>&&'
  228 |   this->horizontal_swing_select_->add_on_state_callback([this](const std::string &value, size_t index) {
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                         |
      |                                                         esphome::panasonic_ac::PanasonicAC::set_horizontal_swing_select(esphome::select::Select*)::<lambda(const std::string&, size_t)>
  229 |     if (value == this->horizontal_swing_state_)
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~          
  230 |       return;
      |       ~~~~~~~                                            
  231 |     this->on_horizontal_swing_change(value);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             
  232 |   });
      |   ~                                                      
src/esphome/components/select/select.h:81:60: note:   initializing argument 1 of 'void esphome::select::Select::add_on_state_callback(std::function<void(unsigned int)>&&)'
   81 |   void add_on_state_callback(std::function<void(size_t)> &&callback);
      |                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
src/esphome/components/panasonic_ac/esppac_wlan.cpp: In member function 'virtual void esphome::panasonic_ac::WLAN::PanasonicACWLAN::control(const esphome::climate::ClimateCall&)':
src/esphome/components/panasonic_ac/esppac_wlan.cpp:113:51: error: cannot convert 'esphome::StringRef' to 'const char*' in initialization
  113 |     const char *fanMode = call.get_custom_fan_mode();
      |                           ~~~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                   |
      |                                                   esphome::StringRef
src/esphome/components/panasonic_ac/esppac_wlan.cpp:167:48: error: cannot convert 'esphome::StringRef' to 'const char*' in initialization
  167 |     const char *preset = call.get_custom_preset();
      |                          ~~~~~~~~~~~~~~~~~~~~~~^~
      |                                                |
      |                                                esphome::StringRef
*** [.pioenvs/bedroomac/src/esphome/components/panasonic_ac/esppac_cnt.cpp.o] Error 1
*** [.pioenvs/bedroomac/src/esphome/components/panasonic_ac/esppac_wlan.cpp.o] Error 1
*** [.pioenvs/bedroomac/src/esphome/components/panasonic_ac/esppac.cpp.o] Error 1
========================== [FAILED] Took 7.93 seconds ==========================
========== [ERROR] /config/esphome/bedroomac.yaml ==========

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions