From 411102e3afe0943633ae3208079a099915e15d97 Mon Sep 17 00:00:00 2001 From: Joolee Date: Fri, 24 Jul 2020 16:01:47 +0200 Subject: [PATCH] Further fix variant error on pairing --- assets/pairing/sensor.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/assets/pairing/sensor.js b/assets/pairing/sensor.js index 6ee159f..b743693 100644 --- a/assets/pairing/sensor.js +++ b/assets/pairing/sensor.js @@ -170,19 +170,16 @@ document.body.addEventListener('click', (event) => { deviceCapabilities = window.device.capabilities; - if (variant) { + if (typeof variant != "undefined") { device.settings.variant = variant.key; const basicCapabilities = window.device.capabilities.filter(cap => !cap.hasOwnProperty("index")); const variantCapabilities = window.device.capabilities.filter(cap => cap.hasOwnProperty("index") && variant.values.includes(cap.name)); deviceCapabilities = basicCapabilities.concat(variantCapabilities); - - console.dir(basicCapabilities, variantCapabilities); - console.dir(deviceCapabilities); } - if (deviceCapabilities) { + if (typeof deviceCapabilities != "undefined") { for (const value of deviceCapabilities) { if (typeof (value.capabilities) == 'string') { device.capabilities.push(value.capabilities);