Module homey.ble_service
Classes
class BleService-
A BLE service of a peripheral.
This class must not be initialized by the developer, but retrieved through
BlePeripheral.servicesor by callingBlePeripheral.discover_services()orBlePeripheral.get_service().Ancestors
- SimpleClass
- EventEmitter
- typing.Generic
Instance variables
var id : Final[str]-
The ID of the service assigned by Homey.
var uuid : Final[str]prop characteristics : tuple[BleCharacteristic, ...]-
BleCharacteristics of the service.
Methods
async def get_characteristic(self, uuid: str) ‑> BleCharacteristic-
Get the characteristic with the given UUID.
Raises
NotConnected: NotFound:
async def discover_characteristics(self, uuid_filter: list[str] | None = None) ‑> tuple[BleCharacteristic, ...]-
Discover the characteristics of this service.
Args
uuid_filter- A collection of characteristic UUIDs to limit the discovery to.
Raises
NotConnected:
async def read(self, characteristic_uuid: str) ‑> bytes-
Read the current value of the characteristic with the given UUID.
Raises
NotConnected: NotFound:
async def write(self, characteristic_uuid: str, data: bytes) ‑> None-
Write the data to the characteristic with the given UUID.
Raises
NotConnected: NotFound:
Inherited members