homebridge-lib 5.1.24-3 → 5.1.24-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.
@@ -35,6 +35,7 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
35
35
  * @param {!string} params.firmware - The accessory firmware revision.
36
36
  * @param {?string} params.hardware - The accessory hardware revision.
37
37
  * @param {?string} params.software - The accessory software revision.
38
+ * @param {integer} params.logLevel - The log level for the accessory.
38
39
  * @param {?boolean} [params.inheritLogLevel] - Inherit `logLevel` from
39
40
  * `platform` instead of maintaining it oneself.
40
41
  */
@@ -50,7 +51,13 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
50
51
  throw new RangeError('params.id: invalid id')
51
52
  }
52
53
 
53
- if (params.inheritLogLevel != null) {
54
+ // Link or create associated PlatformAccessory.
55
+ this._accessory = this._platform._getAccessory(this, params)
56
+ this._context = this._accessory.context
57
+
58
+ if (params.logLevel != null) {
59
+ this._context.logLevel = Math.max(0, Math.min(params.logLevel, maxLogLevel))
60
+ } else if (params.inheritLogLevel != null) {
54
61
  if (params.inheritLogLevel) {
55
62
  Object.defineProperty(this, 'logLevel', {
56
63
  get () { return platform.logLevel }
@@ -59,10 +66,6 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
59
66
  delete params.inheritLogLevel
60
67
  }
61
68
 
62
- // Link or create associated PlatformAccessory.
63
- this._accessory = this._platform._getAccessory(this, params)
64
- this._context = this._accessory.context
65
-
66
69
  // Create delegate for AccessoryInformation service.
67
70
  this._serviceDelegates = {}
68
71
  this._accessoryInformationDelegate =
@@ -197,7 +200,7 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
197
200
  this._context.logLevel = Math.max(0, Math.min(value, maxLogLevel))
198
201
  this._platform._message(
199
202
  'log', 2, this.name + ': ',
200
- 'set loglevel from %d to %d', oldLogLevel, this.logLevel
203
+ 'set Log Level from %d to %d', oldLogLevel, this.logLevel
201
204
  )
202
205
  }
203
206
 
@@ -83,8 +83,16 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
83
83
  * <br>Used by: homebridge-hue.
84
84
  * @property {Class} Enabled - Enable/disable service.
85
85
  * <br>Used by: homebridge-hue.
86
- * @property {Class} Expose - Expose to HomeKit.
87
- * <br>Used by: homebridge-deconz.
86
+ * @property {Class} Expose - Expose device to HomeKit.
87
+ * <br>Used by: homebridge-deconz, homebridge-hue2.
88
+ * @property {Class} ExposeGroups - Expose groups to HomeKit.
89
+ * <br>Used by: homebridge-deconz, homebridge-hue2.
90
+ * @property {Class} ExposeLights - Expose lights devices to HomeKit.
91
+ * <br>Used by: homebridge-deconz, homebridge-hue2.
92
+ * @property {Class} ExposeSchedules - Expose schdules to HomeKit.
93
+ * <br>Used by: homebridge-deconz, homebridge-hue2.
94
+ * @property {Class} ExposeSensors - Expose sensors devices to HomeKit.
95
+ * <br>Used by: homebridge-deconz, homebridge-hue2.
88
96
  * @property {Class} Heartrate - Refresh rate.
89
97
  * <br>Used by: homebridge-hue in HueBridge service,
90
98
  * by Homebridge-soma, by Homebridge-rpi, by Homebridge-ws.
@@ -714,6 +722,30 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
714
722
  adminOnlyAccess: [this.Access.WRITE]
715
723
  })
716
724
 
725
+ this.createCharacteristicClass('ExposeLights', uuid('079'), {
726
+ format: this.Formats.BOOL,
727
+ perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
728
+ adminOnlyAccess: [this.Access.WRITE]
729
+ }, 'Expose Lights')
730
+
731
+ this.createCharacteristicClass('ExposeSensors', uuid('07A'), {
732
+ format: this.Formats.BOOL,
733
+ perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
734
+ adminOnlyAccess: [this.Access.WRITE]
735
+ }, 'Expose Sensors')
736
+
737
+ this.createCharacteristicClass('ExposeGroups', uuid('07B'), {
738
+ format: this.Formats.BOOL,
739
+ perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
740
+ adminOnlyAccess: [this.Access.WRITE]
741
+ }, 'Expose Groups')
742
+
743
+ this.createCharacteristicClass('ExposeSchedules', uuid('07C'), {
744
+ format: this.Formats.BOOL,
745
+ perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
746
+ adminOnlyAccess: [this.Access.WRITE]
747
+ }, 'Expose Schedules')
748
+
717
749
  // Characteristic for Unique ID, used by homebridge-hue.
718
750
  // Source: as exposed by the Philips Hue bridge. This characteristic is
719
751
  // used by the Hue app to select the accessories when syncing Hue bridge
@@ -782,13 +814,17 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
782
814
  ])
783
815
 
784
816
  this.createServiceClass('DeconzGateway', uuid('014'), [
785
- this.Characteristics.LogLevel,
786
- this.Characteristics.Expose,
787
817
  this.Characteristics.Heartrate,
788
818
  this.Characteristics.LastUpdated,
819
+ this.Characteristics.TransitionTime,
820
+ this.Characteristics.Expose,
821
+ this.Characteristics.ExposeLights,
822
+ this.Characteristics.ExposeSensors,
823
+ this.Characteristics.ExposeGroups,
824
+ this.Characteristics.ExposeSchedules,
825
+ this.Characteristics.LogLevel,
789
826
  this.Characteristics.Restart,
790
827
  this.Characteristics.Search,
791
- this.Characteristics.TransitionTime,
792
828
  this.Characteristics.Unlock
793
829
  ])
794
830
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Library for homebridge plugins",
4
4
  "author": "Erik Baauw",
5
5
  "license": "Apache-2.0",
6
- "version": "5.1.24-3",
6
+ "version": "5.1.24-4",
7
7
  "keywords": [
8
8
  "homekit",
9
9
  "homebridge"
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "engines": {
24
24
  "homebridge": "^1.3.9",
25
- "node": "^16.13.1"
25
+ "node": "^16.13.2"
26
26
  },
27
27
  "dependencies": {
28
28
  "bonjour-hap": "^3.6.3",