homebridge-lib 5.6.4 → 5.6.6

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.
@@ -286,14 +286,25 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
286
286
  /** Manage `logLevel` from characteristic delegate.
287
287
  * @param {CharacteristicDelegate} delegate - The delegate of the `logLevel`
288
288
  * characteristic.
289
+ * @param {Boolean} [forPlatform=false] - Manage the Platform `logLevel` as
290
+ * well.
289
291
  */
290
- manageLogLevel (delegate) {
292
+ manageLogLevel (delegate, forPlatform = false) {
291
293
  if (!(delegate instanceof homebridgeLib.CharacteristicDelegate)) {
292
294
  throw new TypeError('delegate: not an CharacteristicDelegate')
293
295
  }
294
296
  Object.defineProperty(this, 'logLevel', {
295
297
  get () { return delegate.value }
296
298
  })
299
+ if (forPlatform) {
300
+ try {
301
+ // TODO handle multiple delegates for platform log level
302
+ // now platform log level is linked to first delegate only
303
+ Object.defineProperty(this.platform, 'logLevel', {
304
+ get () { return delegate.value }
305
+ })
306
+ } catch (error) { }
307
+ }
297
308
  }
298
309
 
299
310
  // Called by homebridge when Identify is selected.
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.6.4",
6
+ "version": "5.6.6",
7
7
  "keywords": [
8
8
  "homekit",
9
9
  "homebridge"
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "engines": {
24
24
  "homebridge": "^1.5.0",
25
- "node": "^16.16.0"
25
+ "node": "^16.17.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "@homebridge/plugin-ui-utils": "~0.0.19",