6static const char *
const TAG =
"template.water_heater";
15 if (restore.has_value()) {
38 if (curr_temp.has_value()) {
46 if (new_mode.has_value()) {
47 if (*new_mode != this->
mode_) {
48 this->
mode_ = *new_mode;
59 LOG_WATER_HEATER(
"",
"Template Water Heater",
this);
60 ESP_LOGCONFIG(TAG,
" Optimistic: %s", YESNO(this->
optimistic_));
70 if (
call.get_mode().has_value()) {
75 if (!std::isnan(
call.get_target_temperature())) {
void disable_loop()
Disable this component's loop.
constexpr bool empty() const
Check if the set is empty.
optional< T > call(Args &&...args)
Alias for operator() for compatibility.
bool has_value() const
Check if a lambda is set.
void trigger(const Ts &...x)
Inform the parent automation that the event has triggered.
TemplateWaterHeaterRestoreMode restore_mode_
void control(const water_heater::WaterHeaterCall &call) override
water_heater::WaterHeaterCallInternal make_call() override
water_heater::WaterHeaterTraits traits() override
float get_setup_priority() const override
void dump_config() override
TemplateLambda< float > current_temperature_f_
TemplateLambda< water_heater::WaterHeaterMode > mode_f_
water_heater::WaterHeaterModeMask supported_modes_
const optional< WaterHeaterMode > & get_mode() const
float get_target_temperature() const
virtual void publish_state()
float target_temperature_
float current_temperature_
optional< WaterHeaterCall > restore_state()
void set_supported_modes(WaterHeaterModeMask modes)
void set_supports_current_temperature(bool supports)
const float HARDWARE
For components that deal with hardware and are very important like GPIO switch.
@ WATER_HEATER_RESTORE_AND_CALL