homebridge-alexa 0.5.51 → 0.5.53

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 0.5.52 (2021-12-28)
6
+
7
+ ## [Version 0.5.51](https://github.com/northernman54/homebridge-alexa/compare/v0.5.37...v0.5.52)
8
+
9
+ #### Changes
10
+
11
+ - Workaround for issue #481
12
+ - Cloud service connection tuning
13
+ - Jump version numbers
14
+
5
15
  ## 0.5.37 (2021-06-15)
6
16
 
7
17
  ## [Version 0.5.37](https://github.com/northernman54/homebridge-alexa/compare/v0.5.33...v0.5.37)
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  <img src="docs/homebridge.png" height="200">
7
7
  </p>
8
8
 
9
- Enable Amazon Alexa to control your homebridge smart home devices and accessories. Full support for all Amazon Alexa devices, including the echo 2nd Generation and software based solutions. Uses an Amazon smart home skill based approach for integration between HomeBridge and Amazon Alexa.
9
+ Enable Amazon Alexa to control your homebridge smart home devices and accessories. Please note, that this does **NOT** bring Alexa enabled devices into homebridge. Full support for all Amazon Alexa devices, including the echo 2nd Generation and software based solutions. Uses an Amazon smart home skill based approach for integration between HomeBridge and Amazon Alexa.
10
10
 
11
11
  Country availability - The plugin is available in these countries, English (AU), German (DE), English (CA), English (US), French (FR), English (UK), Italian (IT), English (IN), Spanish (ES), Japanese (JP), Spanish(US), Portuguese (BR) and Spanish (MX).
12
12
 
@@ -879,5 +879,3 @@ See [Roadmap](Roadmap.md)
879
879
  * jelvs - Validate TV Integration for homebridge-samsung-tizen
880
880
  * krocko - bose soundlink preset / channel change
881
881
  * pwilms - deviceList feature
882
-
883
-
@@ -58,14 +58,6 @@
58
58
  "placeholder": "900",
59
59
  "description": "Frequency of refreshes of the homebridge accessory cache, in seconds. Defaults to 15 minutes."
60
60
  },
61
- "keepalive": {
62
- "title": "Cloud Server Connection Keepalive",
63
- "type": "integer",
64
- "placeholder": "20",
65
- "description": "Frequency of keepalive messages to cloud server, in minutes. Defaults to 20 minutes. Do not change from default unless requested as part of problem investigation.",
66
- "minimum": 1,
67
- "maximum": 59
68
- },
69
61
  "filter": {
70
62
  "title": "Instance Filter",
71
63
  "type": "string",
@@ -177,15 +169,6 @@
177
169
  }
178
170
  ]
179
171
  },
180
- {
181
- "type": "fieldset",
182
- "title": "Advanced Settings",
183
- "expandable": true,
184
- "expanded": false,
185
- "items": [
186
- "keepalive"
187
- ]
188
- },
189
172
  {
190
173
  "type": "fieldset",
191
174
  "title": "Speakers",
@@ -36,7 +36,9 @@ function hapDiscovery(options) {
36
36
  alexaDiscovery.call(options, null, function() {
37
37
  // debug("Events", options);
38
38
  if (options.events) {
39
- registerEvents(messages.checkEventDeviceList.call(options, hbDevices.toEvents()));
39
+
40
+ registerEvents(hbDevices.toEvents());
41
+
40
42
  }
41
43
  });
42
44
  });
@@ -54,6 +56,7 @@ function registerEvents(message) {
54
56
  var HBMessage = [];
55
57
 
56
58
  for (var key in message) {
59
+ // console.log("Key", key, JSON.parse(key));
57
60
  var endpoint = JSON.parse(key);
58
61
  var device = {
59
62
  "aid": endpoint.aid,
@@ -52,7 +52,6 @@ function _getActions(description, context, devices) {
52
52
  var cookie = {};
53
53
  var reportState = [];
54
54
  var hapEvents = [];
55
- // debug("_getActions", description, devices);
56
55
  switch (description) {
57
56
  case "Active": // Active on a Fan 2 aka Dyson or Valve
58
57
  case "On": // Accessory On/Off
@@ -93,7 +92,6 @@ function _getActions(description, context, devices) {
93
92
  "iid": context.liid
94
93
  })] = {
95
94
  "endpointID": context.endpointID,
96
- "friendlyName": context.name,
97
95
  "true": "DETECTED",
98
96
  "false": "NOT_DETECTED",
99
97
  "1": "DETECTED",
@@ -120,7 +118,6 @@ function _getActions(description, context, devices) {
120
118
  "iid": context.liid
121
119
  })] = {
122
120
  "endpointID": context.endpointID,
123
- "friendlyName": context.name,
124
121
  "0": "DETECTED", // Aka open for Alexa
125
122
  "1": "NOT_DETECTED",
126
123
  // "2": "DETECTED",
@@ -160,7 +157,6 @@ function _getActions(description, context, devices) {
160
157
  "iid": context.liid
161
158
  })] = {
162
159
  "endpointID": context.endpointID,
163
- "friendlyName": context.name,
164
160
  "1": "DETECTED", // Aka open for Alexa
165
161
  "0": "NOT_DETECTED",
166
162
  "template": "ContactSensor"
@@ -176,7 +172,6 @@ function _getActions(description, context, devices) {
176
172
  "iid": context.liid
177
173
  })] = {
178
174
  "endpointID": context.endpointID,
179
- "friendlyName": context.name,
180
175
  "0": "DETECTED", // Aka open for Alexa
181
176
  "1": "NOT_DETECTED",
182
177
  "template": "DoorbellEventSource"
@@ -258,7 +253,6 @@ function _getActions(description, context, devices) {
258
253
  cookie["targetSetpoint"] = messages.cookie(context);
259
254
  }
260
255
  break;
261
- case "Target Heater-Cooler State":
262
256
  case "Target Heater Cooler State":
263
257
  case "Target Heating Cooling State":
264
258
  reportState.push(messages.reportState("Alexa.ThermostatControllerthermostatMode", context));
@@ -35,7 +35,6 @@ function Service(devices, context) {
35
35
  this.info = context.info;
36
36
  this.characteristics = [];
37
37
  this.linked = devices.linked;
38
- this.name = context.name;
39
38
  var endpointReg = /[^\w|_|-|=|#|;|:|?|@|&]/g; // Invalid characters in endpointid
40
39
  this.endpointID = Buffer.from(this.id + "-" + context.homebridge + "-" + context.info.Manufacturer + "-" + context.info.Name + "-" + this.serviceType).toString('base64').replace(endpointReg, '#');
41
40
  // this.endpointID = new Buffer(this.id + "-" + context.homebridge + "-" + context.info.Manufacturer + "-" + context.info.Name + "-" + this.serviceType).toString('base64');
@@ -19,8 +19,7 @@ module.exports = {
19
19
  round: round,
20
20
  combine: combine,
21
21
  channel: channel,
22
- inputs: inputs,
23
- checkEventDeviceList: checkEventDeviceList
22
+ inputs: inputs
24
23
  };
25
24
 
26
25
  function createMessageId() {
@@ -1415,37 +1414,3 @@ function _getThermoMode(mode) {
1415
1414
  return "AUTO";
1416
1415
  }
1417
1416
  }
1418
-
1419
-
1420
- function checkEventDeviceList(endpoints) {
1421
- if (this.deviceList && this.deviceList.length > 0 && ['allow', 'deny'].includes(this.deviceListHandling)) {
1422
- debug(`INFO: DeviceList - The following devices are ${this.deviceListHandling} =>`, this.deviceList);
1423
- var response = [];
1424
- for (var key in endpoints) {
1425
- var endpoint = endpoints[key];
1426
- if (this.deviceListHandling === "allow") {
1427
- if (verifyDeviceInList(this.deviceList, endpoint.friendlyName)) {
1428
- response[key] = endpoint;
1429
- debug("INFO: DeviceList - allow =>", endpoint.friendlyName);
1430
- }
1431
- } else if (this.deviceListHandling === "deny") {
1432
- if (verifyDeviceInList(this.deviceList, endpoint.friendlyName)) {
1433
- debug("INFO: DeviceList - deny =>", endpoint.friendlyName);
1434
- } else {
1435
- response[key] = endpoint;
1436
- }
1437
- }
1438
- }
1439
- return (response);
1440
- } else {
1441
- debug("INFO: DeviceList empty feature not enabled or config error in deviceListHandling");
1442
- return endpoints;
1443
- }
1444
- }
1445
-
1446
- function verifyDeviceInList(deviceList, deviceName) {
1447
- for (var i = 0, len = deviceList.length; i < len; i++) {
1448
- if (deviceName === deviceList[i] || deviceName.match(new RegExp(deviceList[i]))) return true;
1449
- }
1450
- return false;
1451
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-alexa",
3
- "version": "0.5.51",
3
+ "version": "0.5.53",
4
4
  "description": "Control your Homebridge devices with Amazon Alexa.",
5
5
  "main": "plugin.js",
6
6
  "scripts": {
@@ -32,16 +32,16 @@
32
32
  "homebridge": ">=0.4.16"
33
33
  },
34
34
  "devDependencies": {
35
- "documentation": "^13.0.2",
35
+ "@oznu/hap-client": "^1.8.1",
36
+ "documentation": "^13.2.5",
36
37
  "nodemon": "^2.0.4"
37
38
  },
38
39
  "dependencies": {
39
- "@oznu/hap-client": "^1.7.2",
40
- "bottleneck": ">=2.18.0",
41
- "debug": ">2.6.9",
40
+ "bottleneck": ">=2.19.5",
41
+ "debug": ">=4.3.3",
42
42
  "hap-node-client": ">=0.1.16",
43
- "is-my-json-valid": ">=2.19.0",
44
- "mqtt": ">=2.18.8"
43
+ "is-my-json-valid": ">=2.20.6",
44
+ "mqtt": "4.2.7"
45
45
  },
46
46
  "author": "NorthernMan54",
47
47
  "license": "Apache-2.0",
package/plugin.js CHANGED
@@ -40,14 +40,6 @@ function alexaHome(log, config, api) {
40
40
  this.deviceList = config['deviceList'] || []; // Use ea
41
41
  this.door = config['door'] || false; // Use mode controller for Garage Doors
42
42
  this.name = config['name'] || "homebridgeAlexa";
43
- var mqttKeepalive = config['keepalive'] || 20; // MQTT Connection Keepalive
44
-
45
- if( mqttKeepalive < 60 )
46
- {
47
- this.keepalive = mqttKeepalive * 60;
48
- } else {
49
- this.keepalive = mqttKeepalive;
50
- }
51
43
 
52
44
  // Enable config based DEBUG logging enable
53
45
  this.debug = config['debug'] || false;
@@ -111,7 +103,7 @@ alexaHome.prototype.didFinishLaunching = function() {
111
103
  port: 1883
112
104
  }],
113
105
  reconnectPeriod: 65000,
114
- keepalive: this.keepalive, // Reduce client timeout to 10 minutes
106
+ keepalive: 1200, // Reduce client timeout to 20 minutes
115
107
  // HAP Node Client options
116
108
  pin: this.pin,
117
109
  refresh: this.refresh,