mirror of
https://github.com/esphome/esphome.git
synced 2025-10-29 06:04:01 +00:00
[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
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user