7static const char *
const TAG =
"climate_ir";
45 if (restore.has_value()) {
63 if (
call.get_mode().has_value())
65 if (
call.get_target_temperature().has_value())
67 if (
call.get_fan_mode().has_value())
69 if (
call.get_swing_mode().has_value())
71 if (
call.get_preset().has_value())
77 LOG_CLIMATE(
"",
"IR Climate",
this);
80 ESP_LOGCONFIG(TAG,
" Supports HEAT: %s", YESNO(this->
supports_heat_));
81 ESP_LOGCONFIG(TAG,
" Supports COOL: %s", YESNO(this->
supports_cool_));
This class is used to encode all control actions on a climate device.
const optional< ClimateSwingMode > & get_swing_mode() const
const optional< float > & get_target_temperature() const
const optional< ClimatePreset > & get_preset() const
const optional< ClimateFanMode > & get_fan_mode() const
const optional< ClimateMode > & get_mode() const
ClimateMode mode
The active mode of the climate device.
optional< ClimateFanMode > fan_mode
The active fan mode of the climate device.
float target_temperature
The target temperature of the climate device.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float current_temperature
The current temperature of the climate device, as reported from the integration.
void publish_state()
Publish the state of the climate device, to be called from integrations.
optional< ClimatePreset > preset
The active preset of the climate device.
optional< ClimateDeviceRestoreState > restore_state_()
Restore the state of the climate device, call this from your setup() method.
This class contains all static data for climate devices.
void set_visual_max_temperature(float visual_max_temperature)
void set_supported_modes(std::set< ClimateMode > modes)
void set_visual_temperature_step(float temperature_step)
void set_supports_two_point_target_temperature(bool supports_two_point_target_temperature)
void set_visual_min_temperature(float visual_min_temperature)
void set_supported_swing_modes(std::set< ClimateSwingMode > modes)
void set_supported_presets(std::set< ClimatePreset > presets)
void add_supported_mode(ClimateMode mode)
void set_supported_fan_modes(std::set< ClimateFanMode > modes)
void set_supports_current_temperature(bool supports_current_temperature)
std::set< climate::ClimateFanMode > fan_modes_
void dump_config() override
void control(const climate::ClimateCall &call) override
Override control to change settings of the climate device.
climate::ClimateTraits traits() override
Return the traits of this controller.
std::set< climate::ClimatePreset > presets_
float maximum_temperature_
virtual void transmit_state()=0
Transmit via IR the state of this climate controller.
std::set< climate::ClimateSwingMode > swing_modes_
float minimum_temperature_
void add_on_state_callback(std::function< void(float)> &&callback)
Add a callback that will be called every time a filtered value arrives.
float state
This member variable stores the last state that has passed through all filters.
@ CLIMATE_PRESET_NONE
No preset is active.
@ CLIMATE_SWING_OFF
The swing mode is set to Off.
@ CLIMATE_MODE_DRY
The climate device is set to dry/humidity mode.
@ CLIMATE_MODE_FAN_ONLY
The climate device only has the fan enabled, no heating or cooling is taking place.
@ CLIMATE_MODE_HEAT
The climate device is set to heat to reach the target temperature.
@ CLIMATE_MODE_COOL
The climate device is set to cool to reach the target temperature.
@ CLIMATE_MODE_HEAT_COOL
The climate device is set to heat/cool to reach the target temperature.
@ CLIMATE_MODE_OFF
The climate device is off.
@ CLIMATE_FAN_AUTO
The fan mode is set to Auto.
Providing packet encoding functions for exchanging data with a remote host.
constexpr const T & clamp(const T &v, const T &lo, const T &hi, Compare comp)