homebridge-alexa 0.9.0-beta.2 → 0.9.0-beta.4

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
@@ -8,11 +8,12 @@ All notable changes to this project will be documented in this file. This projec
8
8
 
9
9
  #### Changes
10
10
 
11
- - Changed behaviour for missing devices, and have updated the plugin inform Alexa about some missing devices so they can be automatically deleted. Feature is enabled with the config option `deviceCleanup`.
11
+ - Major improvement in the handling of missing or orphan devices in Alexa. When `deviceCleanup` is enabled the plugin will inform Alexa when a request is received for a missing or orphan device, and tell Alexa to remove the device.
12
12
 
13
13
  #### Bug Fix
14
14
 
15
15
  - Fix for Routines not working #761
16
+ - Fix for missing Mute function with Apple TV
16
17
 
17
18
  #### Changes
18
19
 
package/Installation.md CHANGED
@@ -18,6 +18,7 @@ Installation and Configuration of Homebridge Alexa
18
18
  * [Required Settings](#required-settings)
19
19
  * [Optional Settings](#optional-settings)
20
20
  * [debug](#debug)
21
+ * [deviceCleanup](#devicecleanup)
21
22
  * [pin](#pin)
22
23
  * [routines](#routines)
23
24
  * [deviceList & deviceListHandling - Filtering of devices by name, either allow or allow](#devicelist--devicelisthandling---filtering-of-devices-by-name-either-allow-or-allow)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homebridge-alexa",
3
- "version": "0.9.0-beta.2",
3
+ "version": "0.9.0-beta.4",
4
4
  "description": "Control your Homebridge devices with Amazon Alexa.",
5
5
  "main": "src/plugin.js",
6
6
  "scripts": {
@@ -902,7 +902,7 @@ function alexaSpeaker(message, callback) {
902
902
  }
903
903
 
904
904
  function alexaStepSpeaker(message, callback) {
905
- // debug(JSON.stringify(message, null, 2));
905
+ // debug('alexaStepSpeaker', JSON.stringify(message, null, 2));
906
906
  var action = message.directive.header.name;
907
907
  var volume, haAction;
908
908
  try {
@@ -934,6 +934,25 @@ function alexaStepSpeaker(message, callback) {
934
934
  callback(err, response);
935
935
  }.bind(this));
936
936
  break;
937
+ case "setmute":
938
+ // Characteristic.VolumeSelector.INCREMENT = 0;
939
+ // Characteristic.VolumeSelector.DECREMENT = 1;
940
+ const payload = message.directive.payload.mute;
941
+ var body = {
942
+ "characteristics": [{
943
+ "aid": haAction.aid,
944
+ "iid": haAction.iid,
945
+ "value": !payload // Alexa is opposite of HomeKit
946
+ }]
947
+ };
948
+ homebridge.HAPcontrolByDeviceID(haAction.deviceID, JSON.stringify(body), function (err, status) {
949
+ this.log("StepSpeaker", action, haAction.deviceID, status, body, err);
950
+ var response = alexaMessages.alexaResponse(message, status, err, volume);
951
+ callback(err, response);
952
+ }.bind(this));
953
+ break;
954
+ default:
955
+ this.log.error("Unhandled alexaStepSpeaker Directive", message.directive.header.name);
937
956
  }
938
957
  }
939
958
 
@@ -228,16 +228,16 @@ function _getActions(description, context, devices) {
228
228
  break;
229
229
  case "Volume Selector": // Speaker volume
230
230
  // case "91288267": // This is in the homebridge-bose-soundtouch plugin
231
- reportState.push(messages.reportState("Alexa.StepSpeaker", context));
231
+ // reportState.push(messages.reportState("Alexa.StepSpeaker", context)); // Volume Selector is read only
232
232
  cookie["AdjustVolume"] = messages.cookie(context);
233
233
  break;
234
- /*
235
- case "Mute": // Speaker volume
236
- // case "91288267": // This is in the homebridge-bose-soundtouch plugin
237
- reportState.push(messages.reportState("Alexa.StepSpeaker", context));
238
- cookie["SetMute"] = messages.cookie(context);
239
- break;
240
- */
234
+
235
+ case "Mute": // Speaker volume
236
+ // case "91288267": // This is in the homebridge-bose-soundtouch plugin
237
+ // reportState.push(messages.reportState("Alexa.StepSpeaker", context));
238
+ cookie["SetMute"] = messages.cookie(context);
239
+ break;
240
+
241
241
  case "Target Temperature": // Target Temperature
242
242
  reportState.push(messages.reportState("Alexa.ThermostatControllertargetSetpoint", context));
243
243
  // cookie["SetTargetTemperature"] = messages.cookie(context);
@@ -312,7 +312,7 @@ function _getActions(description, context, devices) {
312
312
  Characteristic.RemoteKey.INFORMATION = 15;
313
313
  */
314
314
  // "Play", "Pause", "Stop", "Next", "Previous"
315
- // console.log("Remote Key", context);
315
+ // console.log("Remote Key", context);
316
316
  cookie["Pause"] = messages.cookieV(11, context);
317
317
  cookie["Play"] = messages.cookieV(8, context);
318
318
  cookie["Stop"] = messages.cookieV(9, context);