Avoid update call in entity state write if there is no customize data (#116296)

This commit is contained in:
J. Nick Koston 2024-04-27 10:48:05 -05:00 committed by GitHub
parent b94b93cc63
commit eea66921bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1189,8 +1189,10 @@ class Entity(
)
# Overwrite properties that have been set in the config file.
if customize := hass.data.get(DATA_CUSTOMIZE):
attr.update(customize.get(entity_id))
if (customize := hass.data.get(DATA_CUSTOMIZE)) and (
custom := customize.get(entity_id)
):
attr.update(custom)
if (
self._context_set is not None