Skip to content

Bluetooth

class BluetoothDevice (device: Device, client: BluetoothClient, **kwargs)

Bases: Service

Default service constructor (base constructor)

  • Parameters: **kwargs

    mapped to signal connections (e.g. on_clicked=lambda *_: … connects the given function to the signal “clicked”, notify_my_property=my_func connects the given function to the signal “notify::my-property”)

signal changed (self) NoneType

property device Device

property connected bool

property connecting bool

property closed bool

property paired bool

property trusted bool

property address str

property name str

property alias str

property icon_name str

property type str

property battery_level int

property battery_percentage float

def connect_device (connect: bool = True, callback: ~collections.abc.Callable[[~typing.Concatenate[bool, ~P]], ~typing.Any] | None = None, *args: ~typing.~P, **kwargs: ~typing.~P)

def close ()

def notifier (name: str, args=None)

class BluetoothClient (**kwargs)

Bases: Service

Default service constructor (base constructor)

  • Parameters: **kwargs

    mapped to signal connections (e.g. on_clicked=lambda *_: … connects the given function to the signal “clicked”, notify_my_property=my_func connects the given function to the signal “notify::my-property”)

signal changed (self) NoneType

signal closed (self) NoneType

signal device_added (self, address: str) NoneType

signal device_removed (self, address: str) NoneType

property devices list[BluetoothDevice]

property connected_devices list[BluetoothDevice]

property state str

property scanning bool

property enabled bool

property powered bool

property address str

def scan ()

def toggle_power ()

def toggle_scan ()

def get_device (address: str) BluetoothDevice | None

def connect_device (device: ~fabric.bluetooth.service.BluetoothDevice, connect: bool = True, callback: ~collections.abc.Callable[[~typing.Concatenate[bool, ~P]], ~typing.Any] | None = None, *args: ~typing.~P, **kwargs: ~typing.~P)

def notifier (name: str, *args)