Skip to content

Bluetooth

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

Section titled “ BluetoothDevice ”

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

Section titled “ changed ”

property device Device

Section titled “ device ”

property connected bool

Section titled “ connected ”

property connecting bool

Section titled “ connecting ”

property closed bool

Section titled “ closed ”

property paired bool

Section titled “ paired ”

property trusted bool

Section titled “ trusted ”

property address str

Section titled “ address ”

property icon_name str

Section titled “ icon_name ”

property battery_level int

Section titled “ battery_level ”

property battery_percentage float

Section titled “ battery_percentage ”

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

Section titled “ connect_device ”

def notifier (name: str, args=None)

Section titled “ notifier ”

class BluetoothClient (**kwargs)

Section titled “ BluetoothClient ”

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

Section titled “ changed ”

signal closed (self)NoneType

Section titled “ closed ”

signal device_added (self, address: str)NoneType

Section titled “ device_added ”

signal device_removed (self, address: str)NoneType

Section titled “ device_removed ”

property devices list[BluetoothDevice]

Section titled “ devices ”

property connected_devices list[BluetoothDevice]

Section titled “ connected_devices ”

property scanning bool

Section titled “ scanning ”

property enabled bool

Section titled “ enabled ”

property powered bool

Section titled “ powered ”

property address str

Section titled “ address ”

def get_device (address: str)BluetoothDevice | None

Section titled “ get_device ”

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)

Section titled “ connect_device ”

def notifier (name: str, *args)

Section titled “ notifier ”