| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import platform |
| 4 |
|
| 5 |
from ..adapters import BluetoothAdapters |
| 6 |
from ..const import DEFAULT_ADDRESS, WINDOWS_DEFAULT_BLUETOOTH_ADAPTER |
| 7 |
from ..models import AdapterDetails |
| 8 |
|
| 9 |
|
| 10 |
class WindowsAdapters(BluetoothAdapters): |
| 11 |
"""Class for getting the bluetooth adapters on a Windows system.""" |
| 12 |
|
| 13 |
@property |
| 14 |
def adapters(self) -> dict[str, AdapterDetails]: |
| 15 |
"""Get the adapter details.""" |
| 16 |
return { |
| 17 |
WINDOWS_DEFAULT_BLUETOOTH_ADAPTER: AdapterDetails( |
| 18 |
address=DEFAULT_ADDRESS, |
| 19 |
sw_version=platform.release(), |
| 20 |
passive_scan=False, |
| 21 |
manufacturer="Microsoft", |
| 22 |
product="Unknown Windows Model", |
| 23 |
vendor_id="Unknown", |
| 24 |
product_id="Unknown", |
| 25 |
adapter_type=None, # Unknown for Windows |
| 26 |
advertise=True, |
| 27 |
powered=True, |
| 28 |
) |
| 29 |
} |
| 30 |
|
| 31 |
@property |
| 32 |
def default_adapter(self) -> str: |
| 33 |
"""Get the default adapter.""" |
| 34 |
return WINDOWS_DEFAULT_BLUETOOTH_ADAPTER |