mirror of
https://github.com/esphome/esphome.git
synced 2025-10-25 13:13:48 +01:00
Add humidity support to climate (#5732)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -64,6 +64,10 @@ class ClimateCall {
|
||||
* For climate devices with two point target temperature control
|
||||
*/
|
||||
ClimateCall &set_target_temperature_high(optional<float> target_temperature_high);
|
||||
/// Set the target humidity of the climate device.
|
||||
ClimateCall &set_target_humidity(float target_humidity);
|
||||
/// Set the target humidity of the climate device.
|
||||
ClimateCall &set_target_humidity(optional<float> target_humidity);
|
||||
/// Set the fan mode of the climate device.
|
||||
ClimateCall &set_fan_mode(ClimateFanMode fan_mode);
|
||||
/// Set the fan mode of the climate device.
|
||||
@@ -93,6 +97,7 @@ class ClimateCall {
|
||||
const optional<float> &get_target_temperature() const;
|
||||
const optional<float> &get_target_temperature_low() const;
|
||||
const optional<float> &get_target_temperature_high() const;
|
||||
const optional<float> &get_target_humidity() const;
|
||||
const optional<ClimateFanMode> &get_fan_mode() const;
|
||||
const optional<ClimateSwingMode> &get_swing_mode() const;
|
||||
const optional<std::string> &get_custom_fan_mode() const;
|
||||
@@ -107,6 +112,7 @@ class ClimateCall {
|
||||
optional<float> target_temperature_;
|
||||
optional<float> target_temperature_low_;
|
||||
optional<float> target_temperature_high_;
|
||||
optional<float> target_humidity_;
|
||||
optional<ClimateFanMode> fan_mode_;
|
||||
optional<ClimateSwingMode> swing_mode_;
|
||||
optional<std::string> custom_fan_mode_;
|
||||
@@ -136,6 +142,7 @@ struct ClimateDeviceRestoreState {
|
||||
float target_temperature_high;
|
||||
};
|
||||
};
|
||||
float target_humidity;
|
||||
|
||||
/// Convert this struct to a climate call that can be performed.
|
||||
ClimateCall to_call(Climate *climate);
|
||||
@@ -164,11 +171,16 @@ class Climate : public EntityBase {
|
||||
|
||||
/// The active mode of the climate device.
|
||||
ClimateMode mode{CLIMATE_MODE_OFF};
|
||||
|
||||
/// The active state of the climate device.
|
||||
ClimateAction action{CLIMATE_ACTION_OFF};
|
||||
|
||||
/// The current temperature of the climate device, as reported from the integration.
|
||||
float current_temperature{NAN};
|
||||
|
||||
/// The current humidity of the climate device, as reported from the integration.
|
||||
float current_humidity{NAN};
|
||||
|
||||
union {
|
||||
/// The target temperature of the climate device.
|
||||
float target_temperature;
|
||||
@@ -180,6 +192,9 @@ class Climate : public EntityBase {
|
||||
};
|
||||
};
|
||||
|
||||
/// The target humidity of the climate device.
|
||||
float target_humidity;
|
||||
|
||||
/// The active fan mode of the climate device.
|
||||
optional<ClimateFanMode> fan_mode;
|
||||
|
||||
@@ -233,6 +248,8 @@ class Climate : public EntityBase {
|
||||
void set_visual_min_temperature_override(float visual_min_temperature_override);
|
||||
void set_visual_max_temperature_override(float visual_max_temperature_override);
|
||||
void set_visual_temperature_step_override(float target, float current);
|
||||
void set_visual_min_humidity_override(float visual_min_humidity_override);
|
||||
void set_visual_max_humidity_override(float visual_max_humidity_override);
|
||||
|
||||
protected:
|
||||
friend ClimateCall;
|
||||
@@ -282,6 +299,8 @@ class Climate : public EntityBase {
|
||||
optional<float> visual_max_temperature_override_{};
|
||||
optional<float> visual_target_temperature_step_override_{};
|
||||
optional<float> visual_current_temperature_step_override_{};
|
||||
optional<float> visual_min_humidity_override_{};
|
||||
optional<float> visual_max_humidity_override_{};
|
||||
};
|
||||
|
||||
} // namespace climate
|
||||
|
||||
Reference in New Issue
Block a user