Debian Codegraph @

src/bluetooth_adapters/systems/macos.py

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