ESPHome  2021.9.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::climate::ClimateTraits Class Reference

This class contains all static data for climate devices. More...

#include <climate_traits.h>

Public Member Functions

bool get_supports_current_temperature () const
 
void set_supports_current_temperature (bool supports_current_temperature)
 
bool get_supports_two_point_target_temperature () const
 
void set_supports_two_point_target_temperature (bool supports_two_point_target_temperature)
 
void set_supported_modes (std::set< ClimateMode > modes)
 
void add_supported_mode (ClimateMode mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_auto_mode(bool supports_auto_mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_cool_mode(bool supports_cool_mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_heat_mode(bool supports_heat_mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_heat_cool_mode(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_fan_only_mode(bool supports_fan_only_mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_modes() instead", "v1.20") void set_supports_dry_mode(bool supports_dry_mode)
 
bool supports_mode (ClimateMode mode) const
 
const std::set< ClimateModeget_supported_modes () const
 
void set_supports_action (bool supports_action)
 
bool get_supports_action () const
 
void set_supported_fan_modes (std::set< ClimateFanMode > modes)
 
void add_supported_fan_mode (ClimateFanMode mode)
 
void add_supported_custom_fan_mode (const std::string &mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_on(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_off(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_auto(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_low(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_medium(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_high(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_middle(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_focus(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_fan_modes() instead", "v1.20") void set_supports_fan_mode_diffuse(bool supported)
 
bool supports_fan_mode (ClimateFanMode fan_mode) const
 
bool get_supports_fan_modes () const
 
const std::set< ClimateFanModeget_supported_fan_modes () const
 
void set_supported_custom_fan_modes (std::set< std::string > supported_custom_fan_modes)
 
const std::set< std::string > & get_supported_custom_fan_modes () const
 
bool supports_custom_fan_mode (const std::string &custom_fan_mode) const
 
void set_supported_presets (std::set< ClimatePreset > presets)
 
void add_supported_preset (ClimatePreset preset)
 
void add_supported_custom_preset (const std::string &preset)
 
bool supports_preset (ClimatePreset preset) const
 
bool get_supports_presets () const
 
const std::set< climate::ClimatePreset > & get_supported_presets () const
 
void set_supported_custom_presets (std::set< std::string > supported_custom_presets)
 
const std::set< std::string > & get_supported_custom_presets () const
 
bool supports_custom_preset (const std::string &custom_preset) const
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_presets() instead", "v1.20") void set_supports_away(bool supports)
 
 ESPDEPRECATED ("This method is deprecated, use supports_preset() instead", "v1.20") bool get_supports_away() const
 
void set_supported_swing_modes (std::set< ClimateSwingMode > modes)
 
void add_supported_swing_mode (ClimateSwingMode mode)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_swing_modes() instead", "v1.20") void set_supports_swing_mode_off(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_swing_modes() instead", "v1.20") void set_supports_swing_mode_both(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_swing_modes() instead", "v1.20") void set_supports_swing_mode_vertical(bool supported)
 
 ESPDEPRECATED ("This method is deprecated, use set_supported_swing_modes() instead", "v1.20") void set_supports_swing_mode_horizontal(bool supported)
 
bool supports_swing_mode (ClimateSwingMode swing_mode) const
 
bool get_supports_swing_modes () const
 
const std::set< ClimateSwingModeget_supported_swing_modes ()
 
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_temperature_step () const
 
int8_t get_temperature_accuracy_decimals () const
 
void set_visual_temperature_step (float temperature_step)
 

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)
 

Protected Attributes

bool supports_current_temperature_ {false}
 
bool supports_two_point_target_temperature_ {false}
 
std::set< climate::ClimateModesupported_modes_ = {climate::CLIMATE_MODE_OFF}
 
bool supports_action_ {false}
 
std::set< climate::ClimateFanModesupported_fan_modes_
 
std::set< climate::ClimateSwingModesupported_swing_modes_
 
std::set< climate::ClimatePresetsupported_presets_
 
std::set< std::string > supported_custom_fan_modes_
 
std::set< std::string > supported_custom_presets_
 
float visual_min_temperature_ {10}
 
float visual_max_temperature_ {30}
 
float visual_temperature_step_ {0.1}
 

Detailed Description

This class contains all static data for climate devices.

All climate devices must support these features:

All other properties and modes are optional and the integration must mark each of them as supported by setting the appropriate flag here.

This class also contains static data for the climate device display:

Definition at line 41 of file climate_traits.h.

Member Function Documentation

◆ add_supported_custom_fan_mode()

void esphome::climate::ClimateTraits::add_supported_custom_fan_mode ( const std::string &  mode)
inline

Definition at line 75 of file climate_traits.h.

◆ add_supported_custom_preset()

void esphome::climate::ClimateTraits::add_supported_custom_preset ( const std::string &  preset)
inline

Definition at line 108 of file climate_traits.h.

◆ add_supported_fan_mode()

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

Definition at line 74 of file climate_traits.h.

◆ add_supported_mode()

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

Definition at line 52 of file climate_traits.h.

◆ add_supported_preset()

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

Definition at line 107 of file climate_traits.h.

◆ add_supported_swing_mode()

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

Definition at line 131 of file climate_traits.h.

◆ ESPDEPRECATED() [1/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 53 of file climate_traits.h.

◆ ESPDEPRECATED() [2/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 55 of file climate_traits.h.

◆ ESPDEPRECATED() [3/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 57 of file climate_traits.h.

◆ ESPDEPRECATED() [4/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 59 of file climate_traits.h.

◆ ESPDEPRECATED() [5/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 61 of file climate_traits.h.

◆ ESPDEPRECATED() [6/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 65 of file climate_traits.h.

◆ ESPDEPRECATED() [7/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 76 of file climate_traits.h.

◆ ESPDEPRECATED() [8/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 78 of file climate_traits.h.

◆ ESPDEPRECATED() [9/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 80 of file climate_traits.h.

◆ ESPDEPRECATED() [10/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 82 of file climate_traits.h.

◆ ESPDEPRECATED() [11/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 84 of file climate_traits.h.

◆ ESPDEPRECATED() [12/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 86 of file climate_traits.h.

◆ ESPDEPRECATED() [13/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 88 of file climate_traits.h.

◆ ESPDEPRECATED() [14/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 90 of file climate_traits.h.

◆ ESPDEPRECATED() [15/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_fan_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 92 of file climate_traits.h.

◆ ESPDEPRECATED() [16/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_presets() instead"  ,
"v1.20"   
)
inline

Definition at line 120 of file climate_traits.h.

◆ ESPDEPRECATED() [17/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use supports_preset() instead"  ,
"v1.20"   
) const
inline

Definition at line 127 of file climate_traits.h.

◆ ESPDEPRECATED() [18/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_swing_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 132 of file climate_traits.h.

◆ ESPDEPRECATED() [19/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_swing_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 134 of file climate_traits.h.

◆ ESPDEPRECATED() [20/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_swing_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 136 of file climate_traits.h.

◆ ESPDEPRECATED() [21/21]

esphome::climate::ClimateTraits::ESPDEPRECATED ( "This method is  deprecated,
use set_supported_swing_modes() instead"  ,
"v1.20"   
)
inline

Definition at line 138 of file climate_traits.h.

◆ get_supported_custom_fan_modes()

const std::set<std::string>& esphome::climate::ClimateTraits::get_supported_custom_fan_modes ( ) const
inline

Definition at line 101 of file climate_traits.h.

◆ get_supported_custom_presets()

const std::set<std::string>& esphome::climate::ClimateTraits::get_supported_custom_presets ( ) const
inline

Definition at line 116 of file climate_traits.h.

◆ get_supported_fan_modes()

const std::set<ClimateFanMode> esphome::climate::ClimateTraits::get_supported_fan_modes ( ) const
inline

Definition at line 96 of file climate_traits.h.

◆ get_supported_modes()

const std::set<ClimateMode> esphome::climate::ClimateTraits::get_supported_modes ( ) const
inline

Definition at line 68 of file climate_traits.h.

◆ get_supported_presets()

const std::set<climate::ClimatePreset>& esphome::climate::ClimateTraits::get_supported_presets ( ) const
inline

Definition at line 111 of file climate_traits.h.

◆ get_supported_swing_modes()

const std::set<ClimateSwingMode> esphome::climate::ClimateTraits::get_supported_swing_modes ( )
inline

Definition at line 144 of file climate_traits.h.

◆ get_supports_action()

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

Definition at line 71 of file climate_traits.h.

◆ get_supports_current_temperature()

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

Definition at line 43 of file climate_traits.h.

◆ get_supports_fan_modes()

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

Definition at line 95 of file climate_traits.h.

◆ get_supports_presets()

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

Definition at line 110 of file climate_traits.h.

◆ get_supports_swing_modes()

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

Definition at line 143 of file climate_traits.h.

◆ get_supports_two_point_target_temperature()

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

Definition at line 47 of file climate_traits.h.

◆ get_temperature_accuracy_decimals()

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

Definition at line 7 of file climate_traits.cpp.

◆ get_visual_max_temperature()

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

Definition at line 148 of file climate_traits.h.

◆ get_visual_min_temperature()

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

Definition at line 146 of file climate_traits.h.

◆ get_visual_temperature_step()

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

Definition at line 150 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 162 of file climate_traits.h.

◆ set_mode_support_()

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

Definition at line 155 of file climate_traits.h.

◆ set_supported_custom_fan_modes()

void esphome::climate::ClimateTraits::set_supported_custom_fan_modes ( std::set< std::string >  supported_custom_fan_modes)
inline

Definition at line 98 of file climate_traits.h.

◆ set_supported_custom_presets()

void esphome::climate::ClimateTraits::set_supported_custom_presets ( std::set< std::string >  supported_custom_presets)
inline

Definition at line 113 of file climate_traits.h.

◆ set_supported_fan_modes()

void esphome::climate::ClimateTraits::set_supported_fan_modes ( std::set< ClimateFanMode modes)
inline

Definition at line 73 of file climate_traits.h.

◆ set_supported_modes()

void esphome::climate::ClimateTraits::set_supported_modes ( std::set< ClimateMode modes)
inline

Definition at line 51 of file climate_traits.h.

◆ set_supported_presets()

void esphome::climate::ClimateTraits::set_supported_presets ( std::set< ClimatePreset presets)
inline

Definition at line 106 of file climate_traits.h.

◆ set_supported_swing_modes()

void esphome::climate::ClimateTraits::set_supported_swing_modes ( std::set< ClimateSwingMode modes)
inline

Definition at line 130 of file climate_traits.h.

◆ set_supports_action()

void esphome::climate::ClimateTraits::set_supports_action ( bool  supports_action)
inline

Definition at line 70 of file climate_traits.h.

◆ set_supports_current_temperature()

void esphome::climate::ClimateTraits::set_supports_current_temperature ( bool  supports_current_temperature)
inline

Definition at line 44 of file climate_traits.h.

◆ set_supports_two_point_target_temperature()

void esphome::climate::ClimateTraits::set_supports_two_point_target_temperature ( bool  supports_two_point_target_temperature)
inline

Definition at line 48 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 169 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 149 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 147 of file climate_traits.h.

◆ set_visual_temperature_step()

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

Definition at line 152 of file climate_traits.h.

◆ supports_custom_fan_mode()

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

Definition at line 102 of file climate_traits.h.

◆ supports_custom_preset()

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

Definition at line 117 of file climate_traits.h.

◆ supports_fan_mode()

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

Definition at line 94 of file climate_traits.h.

◆ supports_mode()

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

Definition at line 67 of file climate_traits.h.

◆ supports_preset()

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

Definition at line 109 of file climate_traits.h.

◆ supports_swing_mode()

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

Definition at line 142 of file climate_traits.h.

Field Documentation

◆ supported_custom_fan_modes_

std::set<std::string> esphome::climate::ClimateTraits::supported_custom_fan_modes_
protected

Definition at line 184 of file climate_traits.h.

◆ supported_custom_presets_

std::set<std::string> esphome::climate::ClimateTraits::supported_custom_presets_
protected

Definition at line 185 of file climate_traits.h.

◆ supported_fan_modes_

std::set<climate::ClimateFanMode> esphome::climate::ClimateTraits::supported_fan_modes_
protected

Definition at line 181 of file climate_traits.h.

◆ supported_modes_

std::set<climate::ClimateMode> esphome::climate::ClimateTraits::supported_modes_ = {climate::CLIMATE_MODE_OFF}
protected

Definition at line 179 of file climate_traits.h.

◆ supported_presets_

std::set<climate::ClimatePreset> esphome::climate::ClimateTraits::supported_presets_
protected

Definition at line 183 of file climate_traits.h.

◆ supported_swing_modes_

std::set<climate::ClimateSwingMode> esphome::climate::ClimateTraits::supported_swing_modes_
protected

Definition at line 182 of file climate_traits.h.

◆ supports_action_

bool esphome::climate::ClimateTraits::supports_action_ {false}
protected

Definition at line 180 of file climate_traits.h.

◆ supports_current_temperature_

bool esphome::climate::ClimateTraits::supports_current_temperature_ {false}
protected

Definition at line 177 of file climate_traits.h.

◆ supports_two_point_target_temperature_

bool esphome::climate::ClimateTraits::supports_two_point_target_temperature_ {false}
protected

Definition at line 178 of file climate_traits.h.

◆ visual_max_temperature_

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

Definition at line 188 of file climate_traits.h.

◆ visual_min_temperature_

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

Definition at line 187 of file climate_traits.h.

◆ visual_temperature_step_

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

Definition at line 189 of file climate_traits.h.


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