Skip to content

Commit

Permalink
Add current temperature to master climate entity in Advantage Air (#1…
Browse files Browse the repository at this point in the history
…02938)

* Add current_temperature

* Update tests
  • Loading branch information
Bre77 authored Oct 28, 2023
1 parent b1aeaf2 commit a4c31f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions homeassistant/components/advantage_air/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ def __init__(self, instance: AdvantageAirData, ac_key: str) -> None:
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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/components/advantage_air/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a4c31f6

Please sign in to comment.