From cc7d167e8b0996ff24e75ea0feac386ec0ef6f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=87etin=20Koca?= <_@cetinkoca.com> Date: Tue, 12 Dec 2023 08:17:56 +0300 Subject: [PATCH] Fix uninitialized climate target temperature (#5795) --- esphome/components/climate/climate.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/climate/climate.h b/esphome/components/climate/climate.h index f90db3f52a..1bbb17322d 100644 --- a/esphome/components/climate/climate.h +++ b/esphome/components/climate/climate.h @@ -160,6 +160,8 @@ struct ClimateDeviceRestoreState { */ class Climate : public EntityBase { public: + Climate() {} + /// The active mode of the climate device. ClimateMode mode{CLIMATE_MODE_OFF}; /// The active state of the climate device. @@ -172,9 +174,9 @@ class Climate : public EntityBase { float target_temperature; struct { /// The minimum target temperature of the climate device, for climate devices with split target temperature. - float target_temperature_low; + float target_temperature_low{NAN}; /// The maximum target temperature of the climate device, for climate devices with split target temperature. - float target_temperature_high; + float target_temperature_high{NAN}; }; };