Summary
ESPHome 2026.4.0 moves custom mode vectors from ClimateTraits to the Climate entity base class (PR #15206). The old ClimateTraits::set_supported_custom_fan_modes() and ClimateTraits::set_supported_custom_presets() methods are deprecated and will be removed in ESPHome 2026.11.0.
Recommended migration
Set custom modes once during setup() or codegen instead of on every traits() call:
// Before — in traits() override, called on every publish_state()
climate::ClimateTraits traits() override {
auto traits = climate::ClimateTraits();
traits.set_supported_custom_fan_modes({"Low", "Medium", "High"});
traits.set_supported_custom_presets({"Eco", "Sleep"});
return traits;
}
// After — set once, traits() gets them automatically
void setup() override {
this->set_supported_custom_fan_modes({"Low", "Medium", "High"});
this->set_supported_custom_presets({"Eco", "Sleep"});
}
Timeline
- 2026.4.0: Old traits setters deprecated (still work with warnings)
- 2026.11.0: Deprecated setters removed
References
Summary
ESPHome 2026.4.0 moves custom mode vectors from
ClimateTraitsto theClimateentity base class (PR #15206). The oldClimateTraits::set_supported_custom_fan_modes()andClimateTraits::set_supported_custom_presets()methods are deprecated and will be removed in ESPHome 2026.11.0.Recommended migration
Set custom modes once during
setup()or codegen instead of on everytraits()call:Timeline
References