Disable call_soon for device tracker device registry updates (#93638)

Run device tracker device registry updates immediately
without the call_soon delay. This listener does not
need a delay and it only adds overhead in this case.
This commit is contained in:
J. Nick Koston 2023-05-27 18:58:27 -05:00 committed by GitHub
parent b966ff7a3d
commit 67d9fa8b22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -176,7 +176,9 @@ def _async_register_mac(
# Enable entity
ent_reg.async_update_entity(entity_id, disabled_by=None)
hass.bus.async_listen(dr.EVENT_DEVICE_REGISTRY_UPDATED, handle_device_event)
hass.bus.async_listen(
dr.EVENT_DEVICE_REGISTRY_UPDATED, handle_device_event, run_immediately=True
)
class BaseTrackerEntity(Entity):