Skip to content

Fix climate traits API compatibility - #163

Open
pavolholes wants to merge 2 commits into
JanM321:mainfrom
pavolholes:fix/climate-traits-api-esphome-2026
Open

Fix climate traits API compatibility#163
pavolholes wants to merge 2 commits into
JanM321:mainfrom
pavolholes:fix/climate-traits-api-esphome-2026

Conversation

@pavolholes

Copy link
Copy Markdown

ESPHome changed the climate traits API from using mask types (ClimateModeMask, ClimateFanModeMask, ClimateSwingModeMask) with set_supported_modes() to individual add_supported_mode(), add_supported_fan_mode(), and add_supported_swing_mode() methods.

This fix updates configure_capabilities() to use the new API methods.
The specific ESPHome version where this change occurred is unclear as it is not documented in release notes, but compilation fails with the old API and succeeds with the new API.

Testing

  • Successfully compiled with ESPHome 2026.4.2
  • OTA upload successful
  • Device running normally with updated firmware

ESPHome changed the climate traits API from using mask types
(ClimateModeMask, ClimateFanModeMask, ClimateSwingModeMask) with
set_supported_modes() to individual add_supported_mode(),
add_supported_fan_mode(), and add_supported_swing_mode() methods.

This fix updates configure_capabilities() to use the new API methods.
The specific ESPHome version where this change occurred is unclear
as it is not documented in release notes, but compilation fails with
the old API and succeeds with the new API.
Replace deprecated set_supports_current_temperature(),
set_supports_two_point_target_temperature(), and set_supports_action()
with add_feature_flags() to eliminate compilation warnings.

Note: set_internal() warnings remain as they require dynamic
runtime decisions based on device capabilities and cannot be
easily moved to YAML configuration.
@JanM321

JanM321 commented May 23, 2026

Copy link
Copy Markdown
Owner

Hi @pavolholes. Sorry for the delay. I'm confused because when I compile with ESPHome 2026.5.0 (the latest version) I only get warnings about set_internal. Am I missing something?

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.

2 participants