Skip to content

Bluetooth

import { Aside } from “@astrojs/starlight/components”; import TypeSignature from “@components/TypeSignature.astro”;

<TypeSignature typeName={ “BluetoothDevice” } typePrefix={ “class” } typeArgList={ “(device: Device, client: BluetoothClient, **kwargs)” }> 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”)

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “device” } typePrefix={ “property” } returnType={ “Device” }> device

<TypeSignature typeName={ “connected” } typePrefix={ “property” } returnType={ “bool” }> connected

<TypeSignature typeName={ “connecting” } typePrefix={ “property” } returnType={ “bool” }> connecting

<TypeSignature typeName={ “closed” } typePrefix={ “property” } returnType={ “bool” }> closed

<TypeSignature typeName={ “paired” } typePrefix={ “property” } returnType={ “bool” }> paired

<TypeSignature typeName={ “trusted” } typePrefix={ “property” } returnType={ “bool” }> trusted

<TypeSignature typeName={ “address” } typePrefix={ “property” } returnType={ “str” }> address

<TypeSignature typeName={ “name” } typePrefix={ “property” } returnType={ “str” }> name

<TypeSignature typeName={ “alias” } typePrefix={ “property” } returnType={ “str” }> alias

<TypeSignature typeName={ “icon_name” } typePrefix={ “property” } returnType={ “str” }> icon_name

<TypeSignature typeName={ “type” } typePrefix={ “property” } returnType={ “str” }> type

<TypeSignature typeName={ “battery_level” } typePrefix={ “property” } returnType={ “int” }> battery_level

<TypeSignature typeName={ “battery_percentage” } typePrefix={ “property” } returnType={ “float” }> battery_percentage

<TypeSignature typeName={ “connect_device” } typePrefix={ “def” } typeArgList={ “(connect: bool = True, callback: ~collections.abc.Callable[[~typing.Concatenate[bool, ~P]], ~typing.Any] | None = None, *args: ~typing.~P, **kwargs: ~typing.~P)” }> connect_device

<TypeSignature typeName={ “close” } typePrefix={ “def” } typeArgList={ ”()” }> close

<TypeSignature typeName={ “notifier” } typePrefix={ “def” } typeArgList={ “(name: str, args=None)” }> notifier

<TypeSignature typeName={ “BluetoothClient” } typePrefix={ “class” } typeArgList={ ”(**kwargs)” }> 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”)

<TypeSignature typeName={ “changed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> changed

<TypeSignature typeName={ “closed” } typePrefix={ “signal” } typeArgList={ “(self)” } returnType={ “NoneType” }> closed

<TypeSignature typeName={ “device_added” } typePrefix={ “signal” } typeArgList={ “(self, address: str)” } returnType={ “NoneType” }> device_added

<TypeSignature typeName={ “device_removed” } typePrefix={ “signal” } typeArgList={ “(self, address: str)” } returnType={ “NoneType” }> device_removed

<TypeSignature typeName={ “devices” } typePrefix={ “property” } returnType={ “list[BluetoothDevice]” }> devices

<TypeSignature typeName={ “connected_devices” } typePrefix={ “property” } returnType={ “list[BluetoothDevice]” }> connected_devices

<TypeSignature typeName={ “state” } typePrefix={ “property” } returnType={ “str” }> state

<TypeSignature typeName={ “scanning” } typePrefix={ “property” } returnType={ “bool” }> scanning

<TypeSignature typeName={ “enabled” } typePrefix={ “property” } returnType={ “bool” }> enabled

<TypeSignature typeName={ “powered” } typePrefix={ “property” } returnType={ “bool” }> powered

<TypeSignature typeName={ “address” } typePrefix={ “property” } returnType={ “str” }> address

<TypeSignature typeName={ “scan” } typePrefix={ “def” } typeArgList={ ”()” }> scan

<TypeSignature typeName={ “toggle_power” } typePrefix={ “def” } typeArgList={ ”()” }> toggle_power

<TypeSignature typeName={ “toggle_scan” } typePrefix={ “def” } typeArgList={ ”()” }> toggle_scan

<TypeSignature typeName={ “get_device” } typePrefix={ “def” } typeArgList={ “(address: str)” } returnType={ “BluetoothDevice | None” }> get_device

<TypeSignature typeName={ “connect_device” } typePrefix={ “def” } typeArgList={ “(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)” }> connect_device

<TypeSignature typeName={ “notifier” } typePrefix={ “def” } typeArgList={ “(name: str, *args)” }> notifier