homebridge-alexa 0.7.0-beta.6 → 0.7.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/parse/Homebridge.js +15 -13
- package/package.json +1 -1
package/lib/parse/Homebridge.js
CHANGED
|
@@ -25,7 +25,7 @@ function Homebridge(devices, context) {
|
|
|
25
25
|
thermostatTurnOn: context.thermostatTurnOn
|
|
26
26
|
};
|
|
27
27
|
this.playback = {};
|
|
28
|
-
devices.accessories.accessories.forEach(function(element) {
|
|
28
|
+
devices.accessories.accessories.forEach(function (element) {
|
|
29
29
|
var accessory = new Accessory(element, this);
|
|
30
30
|
if (this.accessories[accessory.name + accessory.aid]) {
|
|
31
31
|
debug("Duplicate", accessory.name);
|
|
@@ -44,7 +44,7 @@ function Homebridge(devices, context) {
|
|
|
44
44
|
}.bind(this));
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
Homebridge.prototype.toList = function(opt) {
|
|
47
|
+
Homebridge.prototype.toList = function (opt) {
|
|
48
48
|
var list = [];
|
|
49
49
|
for (var index in this.accessories) {
|
|
50
50
|
var accessory = this.accessories[index];
|
|
@@ -60,7 +60,7 @@ Homebridge.prototype.toList = function(opt) {
|
|
|
60
60
|
return (list);
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
Homebridge.prototype.toAlexa = function(opt) {
|
|
63
|
+
Homebridge.prototype.toAlexa = function (opt) {
|
|
64
64
|
var list = [];
|
|
65
65
|
|
|
66
66
|
// Alexa devices made up of multiple homekit accessories in a single homebridge instance
|
|
@@ -143,7 +143,7 @@ Homebridge.prototype.toAlexa = function(opt) {
|
|
|
143
143
|
id: this.id,
|
|
144
144
|
opt: opt
|
|
145
145
|
});
|
|
146
|
-
if (messages.playbackNameTranslate(device.name) === "Play" && !
|
|
146
|
+
if (messages.playbackNameTranslate(device.name) === "Play" && !cookie.Pause) {
|
|
147
147
|
// No need for fake pause button, the Play button is a pause/play toggle
|
|
148
148
|
// debug('Fake pause', this.id, opt);
|
|
149
149
|
cookie["Pause"] = device.toCookie("On", {
|
|
@@ -211,16 +211,18 @@ Homebridge.prototype.toAlexa = function(opt) {
|
|
|
211
211
|
if (accessory.playback) {
|
|
212
212
|
// debug("Media device", accessory.name);
|
|
213
213
|
}
|
|
214
|
-
|
|
215
|
-
|
|
214
|
+
if (accessory.info.Manufacturer !== 'homebridge-alexa-smarthome') {
|
|
215
|
+
var alexa = accessory.toAlexa({
|
|
216
|
+
deviceID: this.deviceID,
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
218
|
+
homebridge: this.homebridge,
|
|
219
|
+
id: this.id,
|
|
220
|
+
opt: opt
|
|
221
|
+
});
|
|
222
|
+
// debug("Alexa", alexa);
|
|
223
|
+
if (alexa) {
|
|
224
|
+
list = list.concat(alexa);
|
|
225
|
+
}
|
|
224
226
|
}
|
|
225
227
|
}
|
|
226
228
|
return (list);
|