Skip to content

Fix ClimateTraits API for ESPHome 2026.5+ compatibility - #15

Open
nightstalker80-glitch wants to merge 5 commits into
florianbrede-ayet:mainfrom
nightstalker80-glitch:fix/esphome-2026-5-climate-traits
Open

Fix ClimateTraits API for ESPHome 2026.5+ compatibility#15
nightstalker80-glitch wants to merge 5 commits into
florianbrede-ayet:mainfrom
nightstalker80-glitch:fix/esphome-2026-5-climate-traits

Conversation

@nightstalker80-glitch

@nightstalker80-glitch nightstalker80-glitch commented Jun 13, 2026

Copy link
Copy Markdown

Problem

ESPHome 2026.5.0 removed the deprecated ClimateTraits::set_supports_*
accessors, breaking the build with:

error: 'class esphome::climate::ClimateTraits' has no member named 
'set_supports_current_temperature'

Changes

  • Replaced set_supports_current_temperature(true) with
    add_feature_flags(climate::CLIMATE_SUPPORTS_CURRENT_TEMPERATURE)
  • Removed set_supports_two_point_target_temperature(false) and
    set_supports_action(false) (both were false/default, no replacement needed)
  • Migrated deprecated supported_traits_.set_supported_custom_fan_modes()
    to this->set_supported_custom_fan_modes() on the Climate entity
    (scheduled for removal in ESPHome 2026.11.0)
  • Added compatibility note to README.md

Tested

✅ Compiled successfully with ESPHome 2026.5.3
✅ Flashed via OTA on ESP32 (esp32dev, esp-idf framework)
✅ Connected to real Toshiba indoor unit (RAS-10PKVPG-E) via UART (9600 8E1, 5V with level shifter)
✅ AC fully controllable from Home Assistant (mode, temperature, fan, swing, special modes)
✅ Sensor values (outdoor temp, FCU/CDU data) received correctly from unit

Nightstalker80 and others added 5 commits June 13, 2026 16:08
The 2026.5+ fix used add_feature_flags() and the entity-level
Climate::set_supported_custom_fan_modes(), neither of which exists on
older ESPHome, so the component no longer compiled on pre-2025.11 /
pre-2026.4 versions. Wrap both migrations in ESPHOME_VERSION_CODE guards
so the new APIs are used on recent ESPHome while older versions fall back
to the previous accessors:

- add_feature_flags(CLIMATE_SUPPORTS_CURRENT_TEMPERATURE): since 2025.11.0,
  falls back to set_supports_current_temperature(true) on older.
- Climate::set_supported_custom_fan_modes(): since 2026.4.0, falls back to
  ClimateTraits::set_supported_custom_fan_modes() on older (still present,
  removal planned for 2026.11.0).

Also restore the class-body indentation on handle_register_power_selection()
and set_power_select() that was dropped in an earlier commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@florianbrede-ayet

Copy link
Copy Markdown
Owner

@nightstalker80-glitch can you confirm if the changes are fine?
I was unable to compile under older 2025 esphome versions without version guards.

@nightstalker80-glitch

nightstalker80-glitch commented Jul 1, 2026

Copy link
Copy Markdown
Author

@nightstalker80-glitch can you confirm if the changes are fine? I was unable to compile under older 2025 esphome versions without version guards.

I‘m running it on the latest ESPHome version, works great!
EDIT: I found that some registers don't seem to work with my Unit (for example the Fixed 1-5 positions). I will implement some code to test the registers and try find out which work and what they do. I'm a bit bussy but if I find any useful I'll update it here as well!

@wltng

wltng commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

I have added these changes to my fork as well. I can confirm it all works just fine (latest ESPHome).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants