Skip to content

Commit

Permalink
Fix uninitialized climate target temperature (esphome#5795)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoca authored Dec 12, 2023
1 parent ad79e4f commit cc7d167
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions esphome/components/climate/climate.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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};
};
};

Expand Down

0 comments on commit cc7d167

Please sign in to comment.