Improve code readability in iBeacon integration (#78844)

This commit is contained in:
J. Nick Koston 2022-09-20 23:18:38 -10:00 committed by GitHub
parent bc120e9ff2
commit a981d096aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,11 +152,9 @@ class IBeaconCoordinator:
"""Ignore an address that does not follow the spec and any entities created by it."""
self._ignore_addresses.add(address)
self._async_cancel_unavailable_tracker(address)
self.hass.config_entries.async_update_entry(
self._entry,
data=self._entry.data
| {CONF_IGNORE_ADDRESSES: sorted(self._ignore_addresses)},
)
entry_data = self._entry.data
new_data = entry_data | {CONF_IGNORE_ADDRESSES: list(self._ignore_addresses)}
self.hass.config_entries.async_update_entry(self._entry, data=new_data)
self._async_purge_untrackable_entities(self._unique_ids_by_address[address])
self._group_ids_by_address.pop(address)
self._unique_ids_by_address.pop(address)