mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00: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:
		
				
					committed by
					
						 Jesse Hills
						Jesse Hills
					
				
			
			
				
	
			
			
			
						parent
						
							df6cc14201
						
					
				
				
					commit
					b724ae9e0e
				
			| @@ -84,18 +84,18 @@ ClimateTraits AirConditioner::traits() { | |||||||
|   traits.set_supported_custom_presets(this->supported_custom_presets_); |   traits.set_supported_custom_presets(this->supported_custom_presets_); | ||||||
|   traits.set_supported_custom_fan_modes(this->supported_custom_fan_modes_); |   traits.set_supported_custom_fan_modes(this->supported_custom_fan_modes_); | ||||||
|   /* + MINIMAL SET OF CAPABILITIES */ |   /* + 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_AUTO); | ||||||
|   traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_LOW); |   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_MEDIUM); | ||||||
|   traits.add_supported_fan_mode(ClimateFanMode::CLIMATE_FAN_HIGH); |   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) |   if (this->base_.getAutoconfStatus() == dudanov::midea::AUTOCONF_OK) | ||||||
|     Converters::to_climate_traits(traits, this->base_.getCapabilities()); |     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; |   return traits; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user