Fix update entity prior to adding (#54015)

This commit is contained in:
Trinnik 2021-08-07 21:51:05 -06:00 committed by GitHub
parent af565ea6bd
commit b9e0de2eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,7 +49,10 @@ def setup_platform(
try:
if not acc.login():
raise ValueError("Username or Password is incorrect")
add_entities(AladdinDevice(acc, door) for door in acc.get_doors())
add_entities(
(AladdinDevice(acc, door) for door in acc.get_doors()),
update_before_add = True
)
except (TypeError, KeyError, NameError, ValueError) as ex:
_LOGGER.error("%s", ex)
hass.components.persistent_notification.create(