Fix update entity prior to adding (#54015)

This commit is contained in:
Trinnik 2021-08-07 21:51:05 -06:00 committed by Paulus Schoutsen
parent 4fbe713079
commit 1934159fd0

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(