Merge PR #286: Fix setup of discovered devices with pairing
This commit is contained in:
commit
43abc8bf20
@ -7,7 +7,7 @@ import Nymea 1.0
|
|||||||
NymeaListItemDelegate {
|
NymeaListItemDelegate {
|
||||||
id: root
|
id: root
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: device.deviceClass ? app.interfacesToIcon(device.deviceClass.interfaces) : ""
|
iconName: device && device.deviceClass ? app.interfacesToIcon(device.deviceClass.interfaces) : ""
|
||||||
text: device ? device.name : ""
|
text: device ? device.name : ""
|
||||||
progressive: true
|
progressive: true
|
||||||
secondaryIconName: batteryCritical ? "../images/battery/battery-010.svg" : ""
|
secondaryIconName: batteryCritical ? "../images/battery/battery-010.svg" : ""
|
||||||
|
|||||||
@ -231,7 +231,7 @@ Page {
|
|||||||
deviceDiscovery: discovery
|
deviceDiscovery: discovery
|
||||||
showAlreadyAdded: root.device !== null
|
showAlreadyAdded: root.device !== null
|
||||||
showNew: root.device === null
|
showNew: root.device === null
|
||||||
filterDeviceId: root.device !== null ? root.device.id : null
|
filterDeviceId: root.device ? root.device.id : ""
|
||||||
}
|
}
|
||||||
delegate: NymeaListItemDelegate {
|
delegate: NymeaListItemDelegate {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -376,7 +376,7 @@ Page {
|
|||||||
|
|
||||||
switch (root.deviceClass.setupMethod) {
|
switch (root.deviceClass.setupMethod) {
|
||||||
case 0:
|
case 0:
|
||||||
if (root.device !== null) {
|
if (root.device) {
|
||||||
if (d.deviceDescriptor) {
|
if (d.deviceDescriptor) {
|
||||||
engine.deviceManager.reconfigureDiscoveredDevice(root.device.id, d.deviceDescriptor.id);
|
engine.deviceManager.reconfigureDiscoveredDevice(root.device.id, d.deviceDescriptor.id);
|
||||||
} else {
|
} else {
|
||||||
@ -404,7 +404,7 @@ Page {
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (d.deviceDescriptor) {
|
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 {
|
} else {
|
||||||
engine.deviceManager.pairDevice(root.deviceClass.id, params, nameTextField.text);
|
engine.deviceManager.pairDevice(root.deviceClass.id, params, nameTextField.text);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user