1
0
mirror of https://github.com/home-assistant/core.git synced 2026-04-17 07:34:07 +01:00

Check Daikin zone temp keys before represent (#164297)

Co-authored-by: barneyonline <barneyonline@users.noreply.github.com>
This commit is contained in:
James
2026-03-03 06:48:39 +11:00
committed by GitHub
parent cb016b014b
commit 713b7cf36d

View File

@@ -112,11 +112,12 @@ def _zone_is_configured(zone: DaikinZone) -> bool:
def _zone_temperature_lists(device: Appliance) -> tuple[list[str], list[str]]:
"""Return the decoded zone temperature lists."""
try:
heating = device.represent(DAIKIN_ZONE_TEMP_HEAT)[1]
cooling = device.represent(DAIKIN_ZONE_TEMP_COOL)[1]
except AttributeError, KeyError:
values = device.values
if DAIKIN_ZONE_TEMP_HEAT not in values or DAIKIN_ZONE_TEMP_COOL not in values:
return ([], [])
heating = device.represent(DAIKIN_ZONE_TEMP_HEAT)[1]
cooling = device.represent(DAIKIN_ZONE_TEMP_COOL)[1]
return (list(heating or []), list(cooling or []))