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

View File

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