Fix climate traits API compatibility - #163
Open
pavolholes wants to merge 2 commits into
Open
Conversation
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.
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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