scanner.py
scanner
¶
Scanning tools for finding mugs.
Attributes¶
Functions¶
build_scanner_kwargs
¶
build_scanner_kwargs(
adapter: str | None = None,
) -> dict[str, Any]
Add Adapter to kwargs for scanner if specified and using BlueZ.
Source code in ember_mug/scanner.py
23 24 25 26 27 28 29 |
|
discover_devices
async
¶
discover_devices(
mac: str | None = None,
adapter: str | None = None,
wait: int = 5,
) -> list[tuple[BLEDevice, AdvertisementData]]
Discover new devices in pairing mode.
Example:¶
```python
devices = await discover_devices()
for device, advertisement in devices:
print(device.address, advertisement)
```
Source code in ember_mug/scanner.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
find_device
async
¶
find_device(
mac: str | None = None,
adapter: str | None = None,
timeout: int = DEFAULT_TIMEOUT,
) -> (
tuple[BLEDevice, AdvertisementData] | tuple[None, None]
)
Find a device that has previously been discovered.
Example:¶
```python
device = await find_device("my:mac:addr")
```
Source code in ember_mug/scanner.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|