mirror of
https://github.com/esphome/esphome.git
synced 2024-12-26 15:34:53 +01:00
Fix setting wrong traits on midea climate component (#4425)
* Fix issue3914 * Remove also default presets and modes * Fix traits after autoconf
This commit is contained in:
parent
c02871fdfe
commit
a0d04ba091
1 changed files with 6 additions and 6 deletions
|
@ -84,18 +84,18 @@ ClimateTraits AirConditioner::traits() {
|
|||
traits.set_supported_custom_presets(this->supported_custom_presets_);
|
||||
traits.set_supported_custom_fan_modes(this->supported_custom_fan_modes_);
|
||||
/* + MINIMAL SET OF CAPABILITIES */
|
||||
traits.add_supported_mode(ClimateMode::CLIMATE_MODE_OFF);
|
||||
traits.add_supported_mode(ClimateMode::CLIMATE_MODE_FAN_ONLY);
|
||||
traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_AUTO);
|
||||
traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_LOW);
|
||||
traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_MEDIUM);
|
||||
traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_HIGH);
|
||||
traits.add_supported_swing_mode(ClimateSwingMode::CLIMATE_SWING_OFF);
|
||||
traits.add_supported_swing_mode(ClimateSwingMode::CLIMATE_SWING_VERTICAL);
|
||||
traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_NONE);
|
||||
traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_SLEEP);
|
||||
if (this->base_.getAutoconfStatus() == dudanov::midea::AUTOCONF_OK)
|
||||
Converters::to_climate_traits(traits, this->base_.getCapabilities());
|
||||
if (!traits.get_supported_modes().empty())
|
||||
traits.add_supported_mode(ClimateMode::CLIMATE_MODE_OFF);
|
||||
if (!traits.get_supported_swing_modes().empty())
|
||||
traits.add_supported_swing_mode(ClimateSwingMode::CLIMATE_SWING_OFF);
|
||||
if (!traits.get_supported_presets().empty())
|
||||
traits.add_supported_preset(ClimatePreset::CLIMATE_PRESET_NONE);
|
||||
return traits;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue