Fix possible KeyError exception in Airzone Cloud (#93747)
airzone_cloud: fix KeyError for Aidoo installations Some Airzone Cloud installations might be limited to Aidoo devices. In that case, the library will provide AZD_AIDOOS, but it won't provide AZD_ZONES, resulting in a KeyError exception. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
067fc079a3
commit
a3ce1ac497
1 changed files with 1 additions and 1 deletions
|
@ -45,7 +45,7 @@ async def async_setup_entry(
|
|||
coordinator = hass.data[DOMAIN][entry.entry_id]
|
||||
|
||||
sensors = []
|
||||
for zone_id, zone_data in coordinator.data[AZD_ZONES].items():
|
||||
for zone_id, zone_data in coordinator.data.get(AZD_ZONES, {}).items():
|
||||
for description in ZONE_SENSOR_TYPES:
|
||||
if description.key in zone_data:
|
||||
sensors.append(
|
||||
|
|
Loading…
Add table
Reference in a new issue