Fix for devices without output
This commit is contained in:
parent
a633ffacb3
commit
36e5c62b4f
1 changed files with 37 additions and 30 deletions
|
|
@ -326,14 +326,20 @@ class PlejdApi {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const deviceOutput = outputSettings ? outputSettings.output : 0;
|
const deviceOutput = outputSettings ? outputSettings.output : 0;
|
||||||
const bleOutputAddress = this.siteDetails.outputAddress[device.deviceId][deviceOutput];
|
const outputAddress = this.siteDetails.outputAddress[device.deviceId];
|
||||||
|
|
||||||
|
if (outputAddress) {
|
||||||
|
const bleOutputAddress = outputAddress[deviceOutput];
|
||||||
|
|
||||||
if (device.traits === TRAITS.NO_LOAD) {
|
if (device.traits === TRAITS.NO_LOAD) {
|
||||||
logger.warn(
|
logger.warn(
|
||||||
`Device ${device.title} (${device.deviceId}) has no load configured and will be excluded`,
|
`Device ${device.title} (${device.deviceId}) has no load configured and will be excluded`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const uniqueOutputId = this.deviceRegistry.getUniqueOutputId(device.deviceId, deviceOutput);
|
const uniqueOutputId = this.deviceRegistry.getUniqueOutputId(
|
||||||
|
device.deviceId,
|
||||||
|
deviceOutput,
|
||||||
|
);
|
||||||
|
|
||||||
const plejdDevice = this.siteDetails.plejdDevices.find(
|
const plejdDevice = this.siteDetails.plejdDevices.find(
|
||||||
(x) => x.deviceId === device.deviceId,
|
(x) => x.deviceId === device.deviceId,
|
||||||
|
|
@ -363,6 +369,7 @@ class PlejdApi {
|
||||||
|
|
||||||
this.deviceRegistry.addOutputDevice(outputDevice);
|
this.deviceRegistry.addOutputDevice(outputDevice);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// What should we do with inputs?!
|
// What should we do with inputs?!
|
||||||
// if (outputDevice.typeName === 'WPH-01') {
|
// if (outputDevice.typeName === 'WPH-01') {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue