mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Fix async_all_discovered_devices(False) to return connectable and unconnectable devices (#77670)
This commit is contained in:
parent
d65eaf11f4
commit
93a8aef4cc
@ -221,10 +221,14 @@ class BluetoothManager:
|
|||||||
@hass_callback
|
@hass_callback
|
||||||
def async_all_discovered_devices(self, connectable: bool) -> Iterable[BLEDevice]:
|
def async_all_discovered_devices(self, connectable: bool) -> Iterable[BLEDevice]:
|
||||||
"""Return all of discovered devices from all the scanners including duplicates."""
|
"""Return all of discovered devices from all the scanners including duplicates."""
|
||||||
return itertools.chain.from_iterable(
|
yield from itertools.chain.from_iterable(
|
||||||
scanner.discovered_devices
|
scanner.discovered_devices for scanner in self._get_scanners_by_type(True)
|
||||||
for scanner in self._get_scanners_by_type(connectable)
|
|
||||||
)
|
)
|
||||||
|
if not connectable:
|
||||||
|
yield from itertools.chain.from_iterable(
|
||||||
|
scanner.discovered_devices
|
||||||
|
for scanner in self._get_scanners_by_type(False)
|
||||||
|
)
|
||||||
|
|
||||||
@hass_callback
|
@hass_callback
|
||||||
def async_discovered_devices(self, connectable: bool) -> list[BLEDevice]:
|
def async_discovered_devices(self, connectable: bool) -> list[BLEDevice]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user