Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimum setpoint deadband to Climate entity #118186

Closed
wants to merge 10 commits into from
Prev Previous commit
Next Next commit
Change min_temp_range to not set
  • Loading branch information
gjohansson-ST committed Aug 23, 2024
commit 0c1f23ffc8b216b35e06f3f99f9aa942e43a3238
6 changes: 3 additions & 3 deletions homeassistant/components/climate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class ClimateEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_):
_attr_target_humidity: float | None = None
_attr_target_temperature_high: float | None
_attr_target_temperature_low: float | None
_attr_min_temperature_range: float | None = None
_attr_min_temperature_range: float | None
_attr_target_temperature_step: float | None = None
_attr_target_temperature: float | None = None
_attr_temperature_unit: str
Expand Down Expand Up @@ -524,7 +524,6 @@ def state_attributes(self) -> dict[str, Any]:
supported_features = self.supported_features
temperature_unit = self.temperature_unit
precision = self.precision
min_temp_range = self.min_temperature_range
hass = self.hass

data: dict[str, str | float | None] = {
Expand All @@ -548,7 +547,8 @@ def state_attributes(self) -> dict[str, Any]:
data[ATTR_TARGET_TEMP_LOW] = show_temp(
hass, self.target_temperature_low, temperature_unit, precision
)
data[ATTR_MIN_TEMP_RANGE] = min_temp_range
if hasattr(self, "min_temperature_range"):
data[ATTR_MIN_TEMP_RANGE] = self.min_temperature_range

if (current_humidity := self.current_humidity) is not None:
data[ATTR_CURRENT_HUMIDITY] = current_humidity
Expand Down