From ae791b3f2661592d2dec4aeaa8584918d81d4d0a Mon Sep 17 00:00:00 2001 From: Evelyn Eastmond Date: Fri, 31 May 2019 11:27:20 -0400 Subject: [PATCH] Don't send null pin. --- src/io/bt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/io/bt.js b/src/io/bt.js index 39d570b68..37b2c3a5e 100644 --- a/src/io/bt.js +++ b/src/io/bt.js @@ -61,7 +61,11 @@ class BT extends JSONRPCWebSocket { * @param {string} pin - an optional pin for pairing */ connectPeripheral (id, pin = null) { - this.sendRemoteRequest('connect', {peripheralId: id, pin: pin}) + const params = {peripheralId: id}; + if (pin) { + params.pin = pin; + } + this.sendRemoteRequest('connect', params) .then(() => { this._connected = true; this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED);