|
ESPHome 2026.11.0-dev
|
This class is used to encode all control actions on a climate device. More...
#include <climate.h>
Public Member Functions | |
| ClimateCall (Climate *parent) | |
| ClimateCall & | set_mode (ClimateMode mode) |
| Set the mode of the climate device. | |
| ClimateCall & | set_mode (optional< ClimateMode > mode) |
| Set the mode of the climate device. | |
| ClimateCall & | set_mode (const std::string &mode) |
| Set the mode of the climate device based on a string. | |
| ClimateCall & | set_mode (const char *mode, size_t len) |
| Set the mode of the climate device based on a C string. | |
| ClimateCall & | set_target_temperature (float target_temperature) |
| Set the target temperature of the climate device. | |
| ClimateCall & | set_target_temperature (optional< float > target_temperature) |
| Set the target temperature of the climate device. | |
| ClimateCall & | set_target_temperature_low (float target_temperature_low) |
| Set the low point target temperature of the climate device. | |
| ClimateCall & | set_target_temperature_low (optional< float > target_temperature_low) |
| Set the low point target temperature of the climate device. | |
| ClimateCall & | set_target_temperature_high (float target_temperature_high) |
| Set the high point target temperature of the climate device. | |
| ClimateCall & | set_target_temperature_high (optional< float > target_temperature_high) |
| Set the high point target temperature of the climate device. | |
| ClimateCall & | set_target_humidity (float target_humidity) |
| Set the target humidity of the climate device. | |
| ClimateCall & | set_target_humidity (optional< float > target_humidity) |
| Set the target humidity of the climate device. | |
| ClimateCall & | set_fan_mode (ClimateFanMode fan_mode) |
| Set the fan mode of the climate device. | |
| ClimateCall & | set_fan_mode (optional< ClimateFanMode > fan_mode) |
| Set the fan mode of the climate device. | |
| ClimateCall & | set_fan_mode (const std::string &fan_mode) |
| Set the fan mode of the climate device based on a string. | |
| ClimateCall & | set_fan_mode (optional< std::string > fan_mode) |
| Set the fan mode of the climate device based on a string. | |
| ClimateCall & | set_fan_mode (const char *custom_fan_mode) |
| Set the custom fan mode of the climate device. | |
| ClimateCall & | set_fan_mode (StringRef custom_fan_mode) |
| Set the custom fan mode of the climate device (StringRef overload to resolve ambiguity, zero-copy). | |
| ClimateCall & | set_fan_mode (const char *custom_fan_mode, size_t len) |
| Set the custom fan mode of the climate device (zero-copy API path). | |
| ClimateCall & | set_swing_mode (ClimateSwingMode swing_mode) |
| Set the swing mode of the climate device. | |
| ClimateCall & | set_swing_mode (optional< ClimateSwingMode > swing_mode) |
| Set the swing mode of the climate device. | |
| ClimateCall & | set_swing_mode (const std::string &swing_mode) |
| Set the swing mode of the climate device based on a string. | |
| ClimateCall & | set_swing_mode (const char *swing_mode, size_t len) |
| Set the swing mode of the climate device based on a C string. | |
| ClimateCall & | set_preset (ClimatePreset preset) |
| Set the preset of the climate device. | |
| ClimateCall & | set_preset (optional< ClimatePreset > preset) |
| Set the preset of the climate device. | |
| ClimateCall & | set_preset (const std::string &preset) |
| Set the preset of the climate device based on a string. | |
| ClimateCall & | set_preset (optional< std::string > preset) |
| Set the preset of the climate device based on a string. | |
| ClimateCall & | set_preset (const char *custom_preset) |
| Set the custom preset of the climate device. | |
| ClimateCall & | set_preset (StringRef custom_preset) |
| Set the custom preset of the climate device (StringRef overload to resolve ambiguity, zero-copy). | |
| ClimateCall & | set_preset (const char *custom_preset, size_t len) |
| Set the custom preset of the climate device (zero-copy API path). | |
| void | perform () |
| const optional< float > & | get_target_temperature () const |
| const optional< float > & | get_target_temperature_low () const |
| const optional< float > & | get_target_temperature_high () const |
| const optional< float > & | get_target_humidity () const |
| const optional< ClimateMode > & | get_mode () const |
| const optional< ClimateFanMode > & | get_fan_mode () const |
| const optional< ClimateSwingMode > & | get_swing_mode () const |
| const optional< ClimatePreset > & | get_preset () const |
| StringRef | get_custom_fan_mode () const |
| StringRef | get_custom_preset () const |
| bool | has_custom_fan_mode () const |
| bool | has_custom_preset () const |
Protected Member Functions | |
| void | validate_ () |
Protected Attributes | |
| Climate *const | parent_ |
| optional< float > | target_temperature_ |
| optional< float > | target_temperature_low_ |
| optional< float > | target_temperature_high_ |
| optional< float > | target_humidity_ |
| optional< ClimateMode > | mode_ |
| optional< ClimateFanMode > | fan_mode_ |
| optional< ClimateSwingMode > | swing_mode_ |
| optional< ClimatePreset > | preset_ |
This class is used to encode all control actions on a climate device.
It is supposed to be used by all code that wishes to control a climate device (mqtt, api, lambda etc). Create an instance of this class by calling id(climate_device).make_call();. Then set all attributes with the set_x methods. Finally, to apply the changes call .perform();.
The integration that implements the climate device receives this instance with the control method. It should check all the properties it implements and apply them as needed. It should do so by getting all properties it controls with the getter methods in this class. If the optional value is set (check with .has_value()) that means the user wants to control this property. Get the value of the optional with the star operator (*call.get_mode()) and apply it.
|
inlineexplicit |
|
inline |
|
inline |
| const optional< ClimateFanMode > & esphome::climate::ClimateCall::get_fan_mode | ( | ) | const |
Definition at line 316 of file climate.cpp.
| const optional< ClimateMode > & esphome::climate::ClimateCall::get_mode | ( | ) | const |
Definition at line 315 of file climate.cpp.
| const optional< ClimatePreset > & esphome::climate::ClimateCall::get_preset | ( | ) | const |
Definition at line 318 of file climate.cpp.
| const optional< ClimateSwingMode > & esphome::climate::ClimateCall::get_swing_mode | ( | ) | const |
Definition at line 317 of file climate.cpp.
| const optional< float > & esphome::climate::ClimateCall::get_target_humidity | ( | ) | const |
Definition at line 313 of file climate.cpp.
| const optional< float > & esphome::climate::ClimateCall::get_target_temperature | ( | ) | const |
Definition at line 310 of file climate.cpp.
| const optional< float > & esphome::climate::ClimateCall::get_target_temperature_high | ( | ) | const |
Definition at line 312 of file climate.cpp.
| const optional< float > & esphome::climate::ClimateCall::get_target_temperature_low | ( | ) | const |
Definition at line 311 of file climate.cpp.
|
inline |
|
inline |
| void esphome::climate::ClimateCall::perform | ( | ) |
Definition at line 47 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | ClimateFanMode | fan_mode | ) |
Set the fan mode of the climate device.
Definition at line 190 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | const char * | custom_fan_mode | ) |
Set the custom fan mode of the climate device.
Definition at line 196 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | const char * | custom_fan_mode, |
| size_t | len ) |
Set the custom fan mode of the climate device (zero-copy API path).
Definition at line 204 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | const std::string & | fan_mode | ) |
Set the fan mode of the climate device based on a string.
Definition at line 200 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | optional< ClimateFanMode > | fan_mode | ) |
Set the fan mode of the climate device.
Definition at line 345 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_fan_mode | ( | optional< std::string > | fan_mode | ) |
Set the fan mode of the climate device based on a string.
Definition at line 222 of file climate.cpp.
|
inline |
| ClimateCall & esphome::climate::ClimateCall::set_mode | ( | ClimateMode | mode | ) |
Set the mode of the climate device.
Definition at line 171 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_mode | ( | const char * | mode, |
| size_t | len ) |
Set the mode of the climate device based on a C string.
Definition at line 178 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_mode | ( | const std::string & | mode | ) |
Set the mode of the climate device based on a string.
Definition at line 176 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_mode | ( | optional< ClimateMode > | mode | ) |
Set the mode of the climate device.
Definition at line 340 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | ClimatePreset | preset | ) |
Set the preset of the climate device.
Definition at line 229 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | const char * | custom_preset | ) |
Set the custom preset of the climate device.
Definition at line 235 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | const char * | custom_preset, |
| size_t | len ) |
Set the custom preset of the climate device (zero-copy API path).
Definition at line 243 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | const std::string & | preset | ) |
Set the preset of the climate device based on a string.
Definition at line 239 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | optional< ClimatePreset > | preset | ) |
Set the preset of the climate device.
Definition at line 351 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_preset | ( | optional< std::string > | preset | ) |
Set the preset of the climate device based on a string.
Definition at line 261 of file climate.cpp.
|
inline |
| ClimateCall & esphome::climate::ClimateCall::set_swing_mode | ( | ClimateSwingMode | swing_mode | ) |
Set the swing mode of the climate device.
Definition at line 268 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_swing_mode | ( | const char * | swing_mode, |
| size_t | len ) |
Set the swing mode of the climate device based on a C string.
Definition at line 277 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_swing_mode | ( | const std::string & | swing_mode | ) |
Set the swing mode of the climate device based on a string.
Definition at line 273 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_swing_mode | ( | optional< ClimateSwingMode > | swing_mode | ) |
Set the swing mode of the climate device.
Definition at line 357 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_humidity | ( | float | target_humidity | ) |
Set the target humidity of the climate device.
Definition at line 305 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_humidity | ( | optional< float > | target_humidity | ) |
Set the target humidity of the climate device.
Definition at line 335 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature | ( | float | target_temperature | ) |
Set the target temperature of the climate device.
Definition at line 290 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature | ( | optional< float > | target_temperature | ) |
Set the target temperature of the climate device.
Definition at line 330 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature_high | ( | float | target_temperature_high | ) |
Set the high point target temperature of the climate device.
For climate devices with two point target temperature control
Definition at line 300 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature_high | ( | optional< float > | target_temperature_high | ) |
Set the high point target temperature of the climate device.
For climate devices with two point target temperature control
Definition at line 320 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature_low | ( | float | target_temperature_low | ) |
Set the low point target temperature of the climate device.
For climate devices with two point target temperature control
Definition at line 295 of file climate.cpp.
| ClimateCall & esphome::climate::ClimateCall::set_target_temperature_low | ( | optional< float > | target_temperature_low | ) |
Set the low point target temperature of the climate device.
For climate devices with two point target temperature control
Definition at line 325 of file climate.cpp.
|
protected |
Definition at line 92 of file climate.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |