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

@@ -319,6 +319,7 @@ def register_hci0_scanner(hass: HomeAssistant) -> Generator[None]:
cancel = bluetooth.async_register_scanner(hass, hci0_scanner)
yield
cancel()
bluetooth.async_remove_scanner(hass, hci0_scanner.source)
@pytest.fixture
@@ -328,3 +329,4 @@ def register_hci1_scanner(hass: HomeAssistant) -> Generator[None]:
cancel = bluetooth.async_register_scanner(hass, hci1_scanner)
yield
cancel()
bluetooth.async_remove_scanner(hass, hci1_scanner.source)