From 2debf04a48f95e3157bd266868ec82f65a38ce04 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Oct 2025 22:32:58 -1000 Subject: [PATCH] [climate] Use std::set API for EnumBitmask - Change .add() to .insert() - Change .remove() to .erase() - Change .contains() to .count() > 0 - Consistent with std::set API --- esphome/components/climate/climate_traits.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/esphome/components/climate/climate_traits.h b/esphome/components/climate/climate_traits.h index 21adf5b99c..09197a5de3 100644 --- a/esphome/components/climate/climate_traits.h +++ b/esphome/components/climate/climate_traits.h @@ -237,23 +237,23 @@ class ClimateTraits { protected: void set_mode_support_(climate::ClimateMode mode, bool supported) { if (supported) { - this->supported_modes_.add(mode); + this->supported_modes_.insert(mode); } else { - this->supported_modes_.remove(mode); + this->supported_modes_.erase(mode); } } void set_fan_mode_support_(climate::ClimateFanMode mode, bool supported) { if (supported) { - this->supported_fan_modes_.add(mode); + this->supported_fan_modes_.insert(mode); } else { - this->supported_fan_modes_.remove(mode); + this->supported_fan_modes_.erase(mode); } } void set_swing_mode_support_(climate::ClimateSwingMode mode, bool supported) { if (supported) { - this->supported_swing_modes_.add(mode); + this->supported_swing_modes_.insert(mode); } else { - this->supported_swing_modes_.remove(mode); + this->supported_swing_modes_.erase(mode); } }