Fix iCloud matching accounts (#42303)

`name` is no longer defined but `username`.
Fixes #38393
This commit is contained in:
Jörg Thalheim 2020-10-25 01:07:17 +02:00 committed by GitHub
parent c1a7896a40
commit 51915c86cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,7 +187,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
icloud_account = hass.data[DOMAIN].get(account_identifier)
if icloud_account is None:
for account in hass.data[DOMAIN].values():
if account.name == account_identifier:
if account.username == account_identifier:
icloud_account = account
if icloud_account is None: