6static const char *
const TAG =
"template.climate";
11 if (restore.has_value()) {
43 LOG_CLIMATE(
"",
"Template Climate",
this);
44 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
56 if (
auto target_temp =
call.get_target_temperature()) {
62 if (
auto target_temp_low =
call.get_target_temperature_low()) {
68 if (
auto target_temp_high =
call.get_target_temperature_high()) {
118 ESP_LOGW(TAG,
"'%s' - Unsupported mode %u", this->
get_name().c_str(),
static_cast<unsigned>(
mode));
126 ESP_LOGW(TAG,
"'%s' - Unsupported swing mode %u", this->
get_name().c_str(),
static_cast<unsigned>(
swing_mode));
134 ESP_LOGW(TAG,
"'%s' - Unsupported fan mode %u", this->
get_name().c_str(),
static_cast<unsigned>(
fan_mode));
142 ESP_LOGW(TAG,
"'%s' - Unsupported preset %u", this->
get_name().c_str(),
static_cast<unsigned>(
preset));
150 ESP_LOGW(TAG,
"'%s' - Unsupported custom fan mode '%s'", this->
get_name().c_str(),
mode.
c_str());
158 ESP_LOGW(TAG,
"'%s' - Unsupported custom preset '%s'", this->
get_name().c_str(),
preset.c_str());
BedjetMode mode
BedJet operating mode.
const StringRef & get_name() const
StringRef is a reference to a string owned by something else.
constexpr const char * c_str() const
void trigger(const Ts &...x) ESPHOME_ALWAYS_INLINE
Inform the parent automation that the event has triggered.
This class is used to encode all control actions on a climate device.
bool has_custom_fan_mode() const
bool has_custom_preset() const
const optional< ClimatePreset > & get_preset() const
const optional< ClimateFanMode > & get_fan_mode() const
StringRef get_custom_fan_mode() const
StringRef get_custom_preset() 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.
float current_humidity
The current humidity of the climate device, as reported from the integration.
ClimateSwingMode swing_mode
The active swing mode of the climate device.
float target_temperature_low
The minimum target temperature of the climate device, for climate devices with split target temperatu...
bool set_preset_(ClimatePreset preset)
Set preset. Reset custom preset. Return true if preset has been changed.
bool set_custom_preset_(const char *preset)
Set custom preset. Reset primary preset. Return true if preset has been changed.
const char * find_custom_fan_mode_(const char *custom_fan_mode)
Find and return the matching custom fan mode pointer from traits, or nullptr if not found.
bool set_fan_mode_(ClimateFanMode mode)
Set fan mode. Reset custom fan mode. Return true if fan mode has been changed.
const char * find_custom_preset_(const char *custom_preset)
Find and return the matching custom preset pointer from traits, or nullptr if not found.
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.
float target_humidity
The target humidity of the climate device.
bool set_custom_fan_mode_(const char *mode)
Set custom fan mode. Reset primary fan mode. Return true if fan mode has been changed.
float target_temperature_high
The maximum target temperature of the climate device, for climate devices with split target temperatu...
bool supports_mode(ClimateMode mode) const
bool supports_fan_mode(ClimateFanMode fan_mode) const
bool supports_preset(ClimatePreset preset) const
bool supports_swing_mode(ClimateSwingMode swing_mode) const
void add_on_state_callback(F &&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::ClimateTraits traits_
Trigger< climate::ClimateMode > set_mode_trigger_
sensor::Sensor * humidity_sensor_
void dump_config() override
Trigger< float > set_target_temperature_trigger_
void set_swing_mode(climate::ClimateSwingMode mode)
Trigger< climate::ClimatePreset > set_preset_trigger_
void set_mode(climate::ClimateMode mode)
Trigger< climate::ClimateSwingMode > set_swing_mode_trigger_
void set_preset(climate::ClimatePreset preset)
Trigger< StringRef > set_custom_fan_mode_trigger_
void set_custom_fan_mode(const char *mode)
void control(const climate::ClimateCall &call) override
Trigger< float > set_target_temperature_low_trigger_
TemplateClimateRestoreMode restore_mode_
Trigger< StringRef > set_custom_preset_trigger_
void set_custom_preset(const char *preset)
void set_fan_mode(climate::ClimateFanMode mode)
Trigger< climate::ClimateFanMode > set_fan_mode_trigger_
Trigger< float > set_target_humidity_trigger_
Trigger< float > set_target_temperature_high_trigger_
ClimateSwingMode swing_mode
ClimatePreset
Enum for all preset modes NOTE: If adding values, update ClimatePresetMask in climate_traits....
ClimateSwingMode
Enum for all modes a climate swing can be in NOTE: If adding values, update ClimateSwingModeMask in c...
ClimateMode
Enum for all modes a climate device can be in.
ClimateFanMode
NOTE: If adding values, update ClimateFanModeMask in climate_traits.h to use the new last value.
@ TEMPLATE_CLIMATE_RESTORE_MODE_RESTORE