ManagerBLE

You can access this manager through the Homey instance as this.homey.ble

Instance Methods

__registerPeripheral

__registerPeripheral(peripheral)

Register a peripheral connection, needed for notify and disconnect.

Parameters

Name Type Description
peripheral
BlePeripheral

The peripheral to register

__unregisterPeripheral

__unregisterPeripheral(peripheral)

Unregister a peripheral connection when disconnected.

Parameters

Name Type Description
peripheral
BlePeripheral

The peripheral to register

discover

(async) discover(serviceFilteropt): Promise.<Array.<BleAdvertisement>>

Discovers BLE peripherals for a certain time

Requires the homey:wireless:ble permission. For more information about permissions read the Permissions tutorial.

Parameters

Name Type Description
serviceFilter
Array.<string> <optional>

List of required serviceUuids the peripheral should expose

Returns

Promise.<Array.<BleAdvertisement>>

find

(async) find(peripheralUuid): Promise.<BleAdvertisement>

Finds a Ble peripheral with a given peripheralUuid

Requires the homey:wireless:ble permission. For more information about permissions read the Permissions tutorial.

Parameters

Name Type Description
peripheralUuid
string

The uuid of the peripheral to find

Returns

Promise.<BleAdvertisement>