0.0.1(any
= {logEnabled:false})
Enables battery level notifications.
(function)
The callback function that is triggered on battery level change. Will receive a battery level object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables button notifications from Thingy. The assigned event handler will be called when the button on the Thingy is pushed or released.
(function)
The callback function that is triggered on notification. Will receive a button object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise with button state when resolved or a promise with an error on rejection.
Enables color sensor notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a color sensor object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Configures color sensor LED calibration parameters.
(Number)
The red intensity, ranging from 0 to 255.
(Number)
The green intensity, ranging from 0 to 255.
(Number)
The blue intensity, ranging from 0 to 255.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection.
Enables Euler angle data notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive an Euler angle data object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables gas notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a gas object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables gravity vector notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a heading object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables heading notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a heading object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables humidity notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a humidity object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Sets the LED in "breathe" mode where the LED continuously pulses with the specified color, intensity and delay between pulses.
(Object)
Options object for LED breathe mode
| Name | Description |
|---|---|
params.color (number | string)
|
The color code or color name. 1 = red, 2 = green, 3 = yellow, 4 = blue, 5 = purple, 6 = cyan, 7 = white. |
params.intensity number
|
Intensity of LED pulses. Range from 0 to 100 [ % ] . |
params.delay number
|
Delay between pulses in milliseconds. Range from 50 ms to 10 000 ms. |
Promise<Error>:
Returns a resolved promise or an error in a rejected promise.
Sets the LED in constant mode with the specified RGB color.
(Object)
Color object with RGB values
| Name | Description |
|---|---|
color.red number
|
The value for red color in an RGB color. Ranges from 0 to 255. |
color.green number
|
The value for green color in an RGB color. Ranges from 0 to 255. |
color.blue number
|
The value for blue color in an RGB color. Ranges from 0 to 255. |
Promise<Error>:
Returns a resolved promise or an error in a rejected promise.
Enables raw motion data notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a raw motion data object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables orientation detection notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a orientation detection object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables pressure notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a pressure object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables quaternion notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a quaternion object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables rotation matrix notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive an rotation matrix object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Sets the advertising parameters
(Object)
Object with key/value pairs 'interval' and 'timeout':
{interval: someInterval, timeout: someTimeout}
.
| Name | Description |
|---|---|
params.interval number
|
The advertising interval in milliseconds in the range of 20 ms to 5 000 ms. |
params.timeout number
|
The advertising timeout in seconds in the range 1 s to 180 s. |
Promise<Error>:
Returns a promise.
Sets the connection supervision timeout Note: According to the Bluetooth Low Energy specification, the supervision timeout in milliseconds must be greater than (1 + slaveLatency) maxConnInterval 2, where maxConnInterval is also given in milliseconds.
(number)
The desired connection supervision timeout in milliseconds and in the range of 100 ms to 32 000 ms.
Promise<Error>:
Returns a promise.
Sets the Eddystone URL It's recommeended to use URL shortener to stay within the limit of 14 characters long URL URL scheme prefix such as "https://" and "https://www." do not count towards that limit, neither does expansion codes such as ".com/" and ".org". Full details in the Eddystone URL specification: https://github.com/google/eddystone/tree/master/eddystone-url
(string)
The URL that should be broadcasted.
Promise<Error>:
Returns a promise.
Sets the current Maximal Transmission Unit (MTU)
(Object
= {peripheralRequest:false})
MTU settings object: {mtuSize: value, peripheralRequest: value}, where peripheralRequest is optional.
| Name | Description |
|---|---|
params.mtuSize number
|
The desired MTU size. |
params.peripheralRequest boolean
|
Optional. Set to
true
if peripheral should send an MTU exchange request. Default is
false
;
|
Promise<Error>:
Returns a promise.
Enables step counter notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a step counter object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables tap detection notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a tap detection object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection
Enables temperature notifications from Thingy. The assigned event handler will be called when notifications are received.
(function)
The callback function that is triggered on notification. Will receive a temperature object as argument.
(boolean)
Enables notifications if true or disables them if set to false.
Promise<Error>:
Returns a promise when resolved or a promise with an error on rejection