From f64973ee9a5120e8ac331d27084c6916dadf1114 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Sun, 15 Dec 2019 13:43:32 +0100 Subject: [PATCH] Fix setup of discovered devices with pairing --- nymea-app/ui/delegates/ThingDelegate.qml | 2 +- nymea-app/ui/thingconfiguration/SetupWizard.qml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nymea-app/ui/delegates/ThingDelegate.qml b/nymea-app/ui/delegates/ThingDelegate.qml index 8d8414e7..11ef6650 100644 --- a/nymea-app/ui/delegates/ThingDelegate.qml +++ b/nymea-app/ui/delegates/ThingDelegate.qml @@ -7,7 +7,7 @@ import Nymea 1.0 NymeaListItemDelegate { id: root width: parent.width - iconName: device.deviceClass ? app.interfacesToIcon(device.deviceClass.interfaces) : "" + iconName: device && device.deviceClass ? app.interfacesToIcon(device.deviceClass.interfaces) : "" text: device ? device.name : "" progressive: true secondaryIconName: batteryCritical ? "../images/battery/battery-010.svg" : "" diff --git a/nymea-app/ui/thingconfiguration/SetupWizard.qml b/nymea-app/ui/thingconfiguration/SetupWizard.qml index 47c4fd8c..e04b59a3 100644 --- a/nymea-app/ui/thingconfiguration/SetupWizard.qml +++ b/nymea-app/ui/thingconfiguration/SetupWizard.qml @@ -231,7 +231,7 @@ Page { deviceDiscovery: discovery showAlreadyAdded: root.device !== null showNew: root.device === null - filterDeviceId: root.device !== null ? root.device.id : null + filterDeviceId: root.device ? root.device.id : "" } delegate: NymeaListItemDelegate { width: parent.width @@ -376,7 +376,7 @@ Page { switch (root.deviceClass.setupMethod) { case 0: - if (root.device !== null) { + if (root.device) { if (d.deviceDescriptor) { engine.deviceManager.reconfigureDiscoveredDevice(root.device.id, d.deviceDescriptor.id); } else { @@ -404,7 +404,7 @@ Page { return; } else { if (d.deviceDescriptor) { - engine.deviceManager.pairDevice(d.deviceDescriptor.id, params, nameTextField.text); + engine.deviceManager.pairDiscoveredDevice(root.deviceClass.id, d.deviceDescriptor.id, params, nameTextField.text); } else { engine.deviceManager.pairDevice(root.deviceClass.id, params, nameTextField.text); }