Add bluetooth API to remove scanners that are no longer used (#135408)

This commit is contained in:
J. Nick Koston
2025-01-12 14:03:05 -10:00
committed by GitHub
parent 0a444de39c
commit c9a7afe439
6 changed files with 39 additions and 0 deletions

View File

@@ -38,6 +38,12 @@ class BluetoothStorage:
"""Get all scanners."""
return list(self._data.keys())
@callback
def async_remove_advertisement_history(self, scanner: str) -> None:
"""Remove discovered devices by scanner."""
if self._data.pop(scanner, None):
self._store.async_delay_save(self._async_get_data, SCANNER_SAVE_DELAY)
@callback
def async_get_advertisement_history(
self, scanner: str