From a4c31f63bf3d1e92c64c3778153c91441b13bc40 Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Sun, 29 Oct 2023 05:59:02 +1000 Subject: [PATCH] Add current temperature to master climate entity in Advantage Air (#102938) * Add current_temperature * Update tests --- homeassistant/components/advantage_air/climate.py | 7 +++++++ tests/components/advantage_air/test_climate.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/advantage_air/climate.py b/homeassistant/components/advantage_air/climate.py index a4e0a1033ba..8244472f2b4 100644 --- a/homeassistant/components/advantage_air/climate.py +++ b/homeassistant/components/advantage_air/climate.py @@ -122,6 +122,13 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity): if self._ac.get(ADVANTAGE_AIR_AUTOFAN): self._attr_fan_modes += [FAN_AUTO] + @property + def current_temperature(self) -> float | None: + """Return the selected zones current temperature.""" + if self._myzone: + return self._myzone["measuredTemp"] + return None + @property def target_temperature(self) -> float | None: """Return the current target temperature.""" diff --git a/tests/components/advantage_air/test_climate.py b/tests/components/advantage_air/test_climate.py index b045092d78d..f5f12e48a40 100644 --- a/tests/components/advantage_air/test_climate.py +++ b/tests/components/advantage_air/test_climate.py @@ -73,7 +73,7 @@ async def test_climate_async_setup_entry( assert state.attributes.get(ATTR_MIN_TEMP) == 16 assert state.attributes.get(ATTR_MAX_TEMP) == 32 assert state.attributes.get(ATTR_TEMPERATURE) == 24 - assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) is None + assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 25 entry = registry.async_get(entity_id) assert entry