Fixed bug where Liftmaster door ID may not be defined

This commit is contained in:
Alistair Galbraith
2015-06-30 19:42:07 -07:00
parent 466ace2761
commit ef64ec6635

View File

@@ -87,7 +87,7 @@ LiftMasterAccessory.prototype = {
// look through the array of devices for an opener
for (var i=0; i<devices.length; i++) {
var device = devices[i];
if ((device["MyQDeviceTypeName"] == "GarageDoorOpener") && (that.requiredDeviceId == device.MyQDeviceId)) {
if ((device["MyQDeviceTypeName"] == "GarageDoorOpener") && ((that.requiredDeviceId == undefined) || (that.requiredDeviceId == device.MyQDeviceId))) {
that.deviceId = device.MyQDeviceId;
break;
}