Skip to content

Commit

Permalink
fix error when fresh install
Browse files Browse the repository at this point in the history
  • Loading branch information
caibinqing committed Apr 1, 2024
1 parent eb6c8f1 commit d6a7071
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/xiaomi_gateway3/hass/hass_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def stop(*args):

def get_cloud_gateways(hass: HomeAssistant) -> list[dict]:
gateways = []
for item in hass.data[DOMAIN].values():
for item in hass.data.get(DOMAIN, {}).values():
if isinstance(item, MiCloud) and item.devices:
gateways += [i for i in item.devices if i["model"] in SUPPORTED_MODELS]
return gateways
Expand Down

0 comments on commit d6a7071

Please sign in to comment.