ESPHome 2026.5.0
Loading...
Searching...
No Matches
esphome::climate::ClimateTraits Class Reference

#include <climate_traits.h>

Public Member Functions

uint32_t get_feature_flags () const
 Get/set feature flags (see ClimateFeatures enum in climate_mode.h)
 
void add_feature_flags (uint32_t feature_flags)
 
void clear_feature_flags (uint32_t feature_flags)
 
bool has_feature_flags (uint32_t feature_flags) const
 
void set_feature_flags (uint32_t feature_flags)
 
void set_supported_modes (ClimateModeMask modes)
 
void add_supported_mode (ClimateMode mode)
 
bool supports_mode (ClimateMode mode) const
 
const ClimateModeMaskget_supported_modes () const
 
void set_supported_fan_modes (ClimateFanModeMask modes)
 
void add_supported_fan_mode (ClimateFanMode mode)
 
bool supports_fan_mode (ClimateFanMode fan_mode) const
 
bool get_supports_fan_modes () const
 
const ClimateFanModeMaskget_supported_fan_modes () const
 
 ESPDEPRECATED ("Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_fan_modes(std
 
 ESPDEPRECATED ("Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_fan_modes(const std
 
template<size_t N>
 ESPDEPRECATED ("Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_fan_modes(const char *const (&modes)[N])
 
void set_supported_custom_fan_modes (const std::vector< std::string > &modes)=delete
 
void set_supported_custom_fan_modes (std::initializer_list< std::string > modes)=delete
 
const std::vector< const char * > & get_supported_custom_fan_modes () const
 
bool supports_custom_fan_mode (const char *custom_fan_mode) const
 
bool supports_custom_fan_mode (const std::string &custom_fan_mode) const
 
void set_supported_presets (ClimatePresetMask presets)
 
void add_supported_preset (ClimatePreset preset)
 
bool supports_preset (ClimatePreset preset) const
 
bool get_supports_presets () const
 
const ClimatePresetMaskget_supported_presets () const
 
 ESPDEPRECATED ("Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_presets(std
 
 ESPDEPRECATED ("Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_presets(const std
 
template<size_t N>
 ESPDEPRECATED ("Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0", "2026.5.0") void set_supported_custom_presets(const char *const (&presets)[N])
 
void set_supported_custom_presets (const std::vector< std::string > &presets)=delete
 
void set_supported_custom_presets (std::initializer_list< std::string > presets)=delete
 
const std::vector< const char * > & get_supported_custom_presets () const
 
bool supports_custom_preset (const char *custom_preset) const
 
bool supports_custom_preset (const std::string &custom_preset) const
 
void set_supported_swing_modes (ClimateSwingModeMask modes)
 
void add_supported_swing_mode (ClimateSwingMode mode)
 
bool supports_swing_mode (ClimateSwingMode swing_mode) const
 
bool get_supports_swing_modes () const
 
const ClimateSwingModeMaskget_supported_swing_modes () const
 
float get_visual_min_temperature () const
 
void set_visual_min_temperature (float visual_min_temperature)
 
float get_visual_max_temperature () const
 
void set_visual_max_temperature (float visual_max_temperature)
 
float get_visual_target_temperature_step () const
 
float get_visual_current_temperature_step () const
 
void set_visual_target_temperature_step (float temperature_step)
 
void set_visual_current_temperature_step (float temperature_step)
 
void set_visual_temperature_step (float temperature_step)
 
int8_t get_target_temperature_accuracy_decimals () const
 
int8_t get_current_temperature_accuracy_decimals () const
 
float get_visual_min_humidity () const
 
void set_visual_min_humidity (float visual_min_humidity)
 
float get_visual_max_humidity () const
 
void set_visual_max_humidity (float visual_max_humidity)
 

Protected Member Functions

void set_mode_support_ (climate::ClimateMode mode, bool supported)
 
void set_fan_mode_support_ (climate::ClimateFanMode mode, bool supported)
 
void set_swing_mode_support_ (climate::ClimateSwingMode mode, bool supported)
 
void set_supported_custom_fan_modes_ (const std::vector< const char * > *modes)
 Set custom mode pointers (only Climate::get_traits() should call these).
 
void set_supported_custom_presets_ (const std::vector< const char * > *presets)
 
const char * find_custom_fan_mode_ (const char *custom_fan_mode) const
 Find and return the matching custom fan mode pointer from supported modes, or nullptr if not found This is protected as it's an implementation detail - use Climate::find_custom_fan_mode_() instead.
 
const char * find_custom_fan_mode_ (const char *custom_fan_mode, size_t len) const
 
const char * find_custom_preset_ (const char *custom_preset) const
 Find and return the matching custom preset pointer from supported presets, or nullptr if not found This is protected as it's an implementation detail - use Climate::find_custom_preset_() instead.
 
const char * find_custom_preset_ (const char *custom_preset, size_t len) const
 

Protected Attributes

uint32_t feature_flags_ {0}
 
float visual_min_temperature_ {10}
 
float visual_max_temperature_ {30}
 
float visual_target_temperature_step_ {0.1}
 
float visual_current_temperature_step_ {0.1}
 
float visual_min_humidity_ {30}
 
float visual_max_humidity_ {99}
 
climate::ClimateModeMask supported_modes_ {climate::CLIMATE_MODE_OFF}
 
climate::ClimateFanModeMask supported_fan_modes_
 
climate::ClimateSwingModeMask supported_swing_modes_
 
climate::ClimatePresetMask supported_presets_
 
const std::vector< const char * > * supported_custom_fan_modes_ {nullptr}
 Custom mode storage - pointers to vectors owned by the Climate base class.
 
const std::vector< const char * > * supported_custom_presets_ {nullptr}
 
std::vector< const char * > compat_custom_fan_modes_
 
std::vector< const char * > compat_custom_presets_
 

Detailed Description

Definition at line 73 of file climate_traits.h.

Member Function Documentation

◆ add_feature_flags()

void esphome::climate::ClimateTraits::add_feature_flags ( uint32_t feature_flags)
inline

Definition at line 79 of file climate_traits.h.

◆ add_supported_fan_mode()

void esphome::climate::ClimateTraits::add_supported_fan_mode ( ClimateFanMode mode)
inline

Definition at line 90 of file climate_traits.h.

◆ add_supported_mode()

void esphome::climate::ClimateTraits::add_supported_mode ( ClimateMode mode)
inline

Definition at line 85 of file climate_traits.h.

◆ add_supported_preset()

void esphome::climate::ClimateTraits::add_supported_preset ( ClimatePreset preset)
inline

Definition at line 138 of file climate_traits.h.

◆ add_supported_swing_mode()

void esphome::climate::ClimateTraits::add_supported_swing_mode ( ClimateSwingMode mode)
inline

Definition at line 175 of file climate_traits.h.

◆ clear_feature_flags()

void esphome::climate::ClimateTraits::clear_feature_flags ( uint32_t feature_flags)
inline

Definition at line 80 of file climate_traits.h.

◆ ESPDEPRECATED() [1/6]

template<size_t N>
esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  ))[N] const &
inline

Definition at line 117 of file climate_traits.h.

◆ ESPDEPRECATED() [2/6]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  ) const
inline

Definition at line 111 of file climate_traits.h.

◆ ESPDEPRECATED() [3/6]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_fan_modes() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  )
inline

Definition at line 105 of file climate_traits.h.

◆ ESPDEPRECATED() [4/6]

template<size_t N>
esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  ))[N] const &
inline

Definition at line 155 of file climate_traits.h.

◆ ESPDEPRECATED() [5/6]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  ) const
inline

Definition at line 149 of file climate_traits.h.

◆ ESPDEPRECATED() [6/6]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "Call set_supported_custom_presets() on the Climate entity instead. Removed in 2026.11.0" ,
"2026.5.0"  )
inline

Definition at line 144 of file climate_traits.h.

◆ find_custom_fan_mode_() [1/2]

const char * esphome::climate::ClimateTraits::find_custom_fan_mode_ ( const char * custom_fan_mode) const
inlineprotected

Find and return the matching custom fan mode pointer from supported modes, or nullptr if not found This is protected as it's an implementation detail - use Climate::find_custom_fan_mode_() instead.

Definition at line 241 of file climate_traits.h.

◆ find_custom_fan_mode_() [2/2]

const char * esphome::climate::ClimateTraits::find_custom_fan_mode_ ( const char * custom_fan_mode,
size_t len ) const
inlineprotected

Definition at line 244 of file climate_traits.h.

◆ find_custom_preset_() [1/2]

const char * esphome::climate::ClimateTraits::find_custom_preset_ ( const char * custom_preset) const
inlineprotected

Find and return the matching custom preset pointer from supported presets, or nullptr if not found This is protected as it's an implementation detail - use Climate::find_custom_preset_() instead.

Definition at line 254 of file climate_traits.h.

◆ find_custom_preset_() [2/2]

const char * esphome::climate::ClimateTraits::find_custom_preset_ ( const char * custom_preset,
size_t len ) const
inlineprotected

Definition at line 257 of file climate_traits.h.

◆ get_current_temperature_accuracy_decimals()

int8_t esphome::climate::ClimateTraits::get_current_temperature_accuracy_decimals ( ) const

Definition at line 36 of file climate_traits.cpp.

◆ get_feature_flags()

uint32_t esphome::climate::ClimateTraits::get_feature_flags ( ) const
inline

Get/set feature flags (see ClimateFeatures enum in climate_mode.h)

Definition at line 78 of file climate_traits.h.

◆ get_supported_custom_fan_modes()

const std::vector< const char * > & esphome::climate::ClimateTraits::get_supported_custom_fan_modes ( ) const

Definition at line 10 of file climate_traits.cpp.

◆ get_supported_custom_presets()

const std::vector< const char * > & esphome::climate::ClimateTraits::get_supported_custom_presets ( ) const

Definition at line 21 of file climate_traits.cpp.

◆ get_supported_fan_modes()

const ClimateFanModeMask & esphome::climate::ClimateTraits::get_supported_fan_modes ( ) const
inline

Definition at line 102 of file climate_traits.h.

◆ get_supported_modes()

const ClimateModeMask & esphome::climate::ClimateTraits::get_supported_modes ( ) const
inline

Definition at line 87 of file climate_traits.h.

◆ get_supported_presets()

const ClimatePresetMask & esphome::climate::ClimateTraits::get_supported_presets ( ) const
inline

Definition at line 141 of file climate_traits.h.

◆ get_supported_swing_modes()

const ClimateSwingModeMask & esphome::climate::ClimateTraits::get_supported_swing_modes ( ) const
inline

Definition at line 178 of file climate_traits.h.

◆ get_supports_fan_modes()

bool esphome::climate::ClimateTraits::get_supports_fan_modes ( ) const
inline

Definition at line 92 of file climate_traits.h.

◆ get_supports_presets()

bool esphome::climate::ClimateTraits::get_supports_presets ( ) const
inline

Definition at line 140 of file climate_traits.h.

◆ get_supports_swing_modes()

bool esphome::climate::ClimateTraits::get_supports_swing_modes ( ) const
inline

Definition at line 177 of file climate_traits.h.

◆ get_target_temperature_accuracy_decimals()

int8_t esphome::climate::ClimateTraits::get_target_temperature_accuracy_decimals ( ) const

Definition at line 32 of file climate_traits.cpp.

◆ get_visual_current_temperature_step()

float esphome::climate::ClimateTraits::get_visual_current_temperature_step ( ) const
inline

Definition at line 189 of file climate_traits.h.

◆ get_visual_max_humidity()

float esphome::climate::ClimateTraits::get_visual_max_humidity ( ) const
inline

Definition at line 205 of file climate_traits.h.

◆ get_visual_max_temperature()

float esphome::climate::ClimateTraits::get_visual_max_temperature ( ) const
inline

Definition at line 184 of file climate_traits.h.

◆ get_visual_min_humidity()

float esphome::climate::ClimateTraits::get_visual_min_humidity ( ) const
inline

Definition at line 203 of file climate_traits.h.

◆ get_visual_min_temperature()

float esphome::climate::ClimateTraits::get_visual_min_temperature ( ) const
inline

Definition at line 180 of file climate_traits.h.

◆ get_visual_target_temperature_step()

float esphome::climate::ClimateTraits::get_visual_target_temperature_step ( ) const
inline

Definition at line 188 of file climate_traits.h.

◆ has_feature_flags()

bool esphome::climate::ClimateTraits::has_feature_flags ( uint32_t feature_flags) const
inline

Definition at line 81 of file climate_traits.h.

◆ set_fan_mode_support_()

void esphome::climate::ClimateTraits::set_fan_mode_support_ ( climate::ClimateFanMode mode,
bool supported )
inlineprotected

Definition at line 216 of file climate_traits.h.

◆ set_feature_flags()

void esphome::climate::ClimateTraits::set_feature_flags ( uint32_t feature_flags)
inline

Definition at line 82 of file climate_traits.h.

◆ set_mode_support_()

void esphome::climate::ClimateTraits::set_mode_support_ ( climate::ClimateMode mode,
bool supported )
inlineprotected

Definition at line 209 of file climate_traits.h.

◆ set_supported_custom_fan_modes() [1/2]

void esphome::climate::ClimateTraits::set_supported_custom_fan_modes ( const std::vector< std::string > & modes)
delete

◆ set_supported_custom_fan_modes() [2/2]

void esphome::climate::ClimateTraits::set_supported_custom_fan_modes ( std::initializer_list< std::string > modes)
delete

◆ set_supported_custom_fan_modes_()

void esphome::climate::ClimateTraits::set_supported_custom_fan_modes_ ( const std::vector< const char * > * modes)
inlineprotected

Set custom mode pointers (only Climate::get_traits() should call these).

Definition at line 232 of file climate_traits.h.

◆ set_supported_custom_presets() [1/2]

void esphome::climate::ClimateTraits::set_supported_custom_presets ( const std::vector< std::string > & presets)
delete

◆ set_supported_custom_presets() [2/2]

void esphome::climate::ClimateTraits::set_supported_custom_presets ( std::initializer_list< std::string > presets)
delete

◆ set_supported_custom_presets_()

void esphome::climate::ClimateTraits::set_supported_custom_presets_ ( const std::vector< const char * > * presets)
inlineprotected

Definition at line 235 of file climate_traits.h.

◆ set_supported_fan_modes()

void esphome::climate::ClimateTraits::set_supported_fan_modes ( ClimateFanModeMask modes)
inline

Definition at line 89 of file climate_traits.h.

◆ set_supported_modes()

void esphome::climate::ClimateTraits::set_supported_modes ( ClimateModeMask modes)
inline

Definition at line 84 of file climate_traits.h.

◆ set_supported_presets()

void esphome::climate::ClimateTraits::set_supported_presets ( ClimatePresetMask presets)
inline

Definition at line 137 of file climate_traits.h.

◆ set_supported_swing_modes()

void esphome::climate::ClimateTraits::set_supported_swing_modes ( ClimateSwingModeMask modes)
inline

Definition at line 174 of file climate_traits.h.

◆ set_swing_mode_support_()

void esphome::climate::ClimateTraits::set_swing_mode_support_ ( climate::ClimateSwingMode mode,
bool supported )
inlineprotected

Definition at line 223 of file climate_traits.h.

◆ set_visual_current_temperature_step()

void esphome::climate::ClimateTraits::set_visual_current_temperature_step ( float temperature_step)
inline

Definition at line 193 of file climate_traits.h.

◆ set_visual_max_humidity()

void esphome::climate::ClimateTraits::set_visual_max_humidity ( float visual_max_humidity)
inline

Definition at line 206 of file climate_traits.h.

◆ set_visual_max_temperature()

void esphome::climate::ClimateTraits::set_visual_max_temperature ( float visual_max_temperature)
inline

Definition at line 185 of file climate_traits.h.

◆ set_visual_min_humidity()

void esphome::climate::ClimateTraits::set_visual_min_humidity ( float visual_min_humidity)
inline

Definition at line 204 of file climate_traits.h.

◆ set_visual_min_temperature()

void esphome::climate::ClimateTraits::set_visual_min_temperature ( float visual_min_temperature)
inline

Definition at line 181 of file climate_traits.h.

◆ set_visual_target_temperature_step()

void esphome::climate::ClimateTraits::set_visual_target_temperature_step ( float temperature_step)
inline

Definition at line 190 of file climate_traits.h.

◆ set_visual_temperature_step()

void esphome::climate::ClimateTraits::set_visual_temperature_step ( float temperature_step)
inline

Definition at line 196 of file climate_traits.h.

◆ supports_custom_fan_mode() [1/2]

bool esphome::climate::ClimateTraits::supports_custom_fan_mode ( const char * custom_fan_mode) const
inline

Definition at line 128 of file climate_traits.h.

◆ supports_custom_fan_mode() [2/2]

bool esphome::climate::ClimateTraits::supports_custom_fan_mode ( const std::string & custom_fan_mode) const
inline

Definition at line 133 of file climate_traits.h.

◆ supports_custom_preset() [1/2]

bool esphome::climate::ClimateTraits::supports_custom_preset ( const char * custom_preset) const
inline

Definition at line 166 of file climate_traits.h.

◆ supports_custom_preset() [2/2]

bool esphome::climate::ClimateTraits::supports_custom_preset ( const std::string & custom_preset) const
inline

Definition at line 170 of file climate_traits.h.

◆ supports_fan_mode()

bool esphome::climate::ClimateTraits::supports_fan_mode ( ClimateFanMode fan_mode) const
inline

Definition at line 91 of file climate_traits.h.

◆ supports_mode()

bool esphome::climate::ClimateTraits::supports_mode ( ClimateMode mode) const
inline

Definition at line 86 of file climate_traits.h.

◆ supports_preset()

bool esphome::climate::ClimateTraits::supports_preset ( ClimatePreset preset) const
inline

Definition at line 139 of file climate_traits.h.

◆ supports_swing_mode()

bool esphome::climate::ClimateTraits::supports_swing_mode ( ClimateSwingMode swing_mode) const
inline

Definition at line 176 of file climate_traits.h.

Field Documentation

◆ compat_custom_fan_modes_

std::vector<const char *> esphome::climate::ClimateTraits::compat_custom_fan_modes_
protected

Definition at line 287 of file climate_traits.h.

◆ compat_custom_presets_

std::vector<const char *> esphome::climate::ClimateTraits::compat_custom_presets_
protected

Definition at line 288 of file climate_traits.h.

◆ feature_flags_

uint32_t esphome::climate::ClimateTraits::feature_flags_ {0}
protected

Definition at line 265 of file climate_traits.h.

◆ supported_custom_fan_modes_

const std::vector<const char *>* esphome::climate::ClimateTraits::supported_custom_fan_modes_ {nullptr}
protected

Custom mode storage - pointers to vectors owned by the Climate base class.

ClimateTraits does not own this data; Climate stores the vectors and get_traits() wires these pointers automatically.

Definition at line 283 of file climate_traits.h.

◆ supported_custom_presets_

const std::vector<const char *>* esphome::climate::ClimateTraits::supported_custom_presets_ {nullptr}
protected

Definition at line 284 of file climate_traits.h.

◆ supported_fan_modes_

climate::ClimateFanModeMask esphome::climate::ClimateTraits::supported_fan_modes_
protected

Definition at line 274 of file climate_traits.h.

◆ supported_modes_

climate::ClimateModeMask esphome::climate::ClimateTraits::supported_modes_ {climate::CLIMATE_MODE_OFF}
protected

Definition at line 273 of file climate_traits.h.

◆ supported_presets_

climate::ClimatePresetMask esphome::climate::ClimateTraits::supported_presets_
protected

Definition at line 276 of file climate_traits.h.

◆ supported_swing_modes_

climate::ClimateSwingModeMask esphome::climate::ClimateTraits::supported_swing_modes_
protected

Definition at line 275 of file climate_traits.h.

◆ visual_current_temperature_step_

float esphome::climate::ClimateTraits::visual_current_temperature_step_ {0.1}
protected

Definition at line 269 of file climate_traits.h.

◆ visual_max_humidity_

float esphome::climate::ClimateTraits::visual_max_humidity_ {99}
protected

Definition at line 271 of file climate_traits.h.

◆ visual_max_temperature_

float esphome::climate::ClimateTraits::visual_max_temperature_ {30}
protected

Definition at line 267 of file climate_traits.h.

◆ visual_min_humidity_

float esphome::climate::ClimateTraits::visual_min_humidity_ {30}
protected

Definition at line 270 of file climate_traits.h.

◆ visual_min_temperature_

float esphome::climate::ClimateTraits::visual_min_temperature_ {10}
protected

Definition at line 266 of file climate_traits.h.

◆ visual_target_temperature_step_

float esphome::climate::ClimateTraits::visual_target_temperature_step_ {0.1}
protected

Definition at line 268 of file climate_traits.h.


The documentation for this class was generated from the following files: