homebridge-nb 1.2.10 → 1.2.11

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.
@@ -22,6 +22,12 @@
22
22
  "type": "integer",
23
23
  "maximum": 65535
24
24
  },
25
+ "openerResetTimeout": {
26
+ "description": "The timeout in milliseconds to wait before resetting the Opener to locked. Default: 500. Set to 0 to keep the Opener unlocked.",
27
+ "type": "integer",
28
+ "minimum": 0,
29
+ "maximum": 2000
30
+ },
25
31
  "timeout": {
26
32
  "description": "The timeout in seconds to wait for a response from a Nuki bridge. Default: 15.",
27
33
  "type": "integer",
@@ -39,6 +45,7 @@
39
45
  "title": "Advanced Settings",
40
46
  "description": "Don't change these, unless you understand what you're doing.",
41
47
  "items": [
48
+ "openerResetTimeout",
42
49
  "timeout",
43
50
  "port"
44
51
  ]
package/lib/NbPlatform.js CHANGED
@@ -16,6 +16,7 @@ class NbPlatform extends homebridgeLib.Platform {
16
16
  constructor (log, configJson, homebridge) {
17
17
  super(log, configJson, homebridge)
18
18
  this.config = {
19
+ openerResetTimeout: 500,
19
20
  timeout: 15
20
21
  }
21
22
  const optionParser = new homebridgeLib.OptionParser(this.config, true)
@@ -24,6 +25,7 @@ class NbPlatform extends homebridgeLib.Platform {
24
25
  .stringKey('name')
25
26
  .boolKey('latch')
26
27
  .intKey('port', 0, 65535)
28
+ .intKey('openerResetTimeout', 0, 2000) // milliseconds
27
29
  .intKey('timeout', 1, 60) // seconds
28
30
  .on('userInputError', (message) => {
29
31
  this.warn('config.json: %s', message)
package/lib/NbService.js CHANGED
@@ -62,7 +62,7 @@ class Bridge extends homebridgeLib.ServiceDelegate {
62
62
  this.addCharacteristicDelegate({
63
63
  key: 'logLevel',
64
64
  Characteristic: this.Characteristics.my.LogLevel,
65
- value: nbAccessory.platform.logLevel
65
+ value: this.accessoryDelegate.logLevel
66
66
  })
67
67
  this.addCharacteristicDelegate({
68
68
  key: 'statusFault',
@@ -400,10 +400,12 @@ class Opener extends homebridgeLib.ServiceDelegate {
400
400
  nbAccessory.update(response.body)
401
401
  }
402
402
  }
403
- setTimeout(() => {
404
- this.values.currentState = this.Characteristics.hap.LockCurrentState.SECURED
405
- this.values.targetState = this.Characteristics.hap.LockTargetState.SECURED
406
- }, 500)
403
+ if (this.platform.config.openerResetTimeout > 0) {
404
+ setTimeout(() => {
405
+ this.values.currentState = this.Characteristics.hap.LockCurrentState.SECURED
406
+ this.values.targetState = this.Characteristics.hap.LockTargetState.SECURED
407
+ }, this.platform.config.openerResetTimeout)
408
+ }
407
409
  } catch (error) { this.error(error) }
408
410
  })
409
411
  this.addCharacteristicDelegate({
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName": "Homebridge NB",
5
5
  "author": "Erik Baauw",
6
6
  "license": "Apache-2.0",
7
- "version": "1.2.10",
7
+ "version": "1.2.11",
8
8
  "keywords": [
9
9
  "homebridge-plugin",
10
10
  "homekit",
@@ -19,10 +19,10 @@
19
19
  },
20
20
  "engines": {
21
21
  "homebridge": "^1.5.0",
22
- "node": "^16.17.0"
22
+ "node": "^16.17.1"
23
23
  },
24
24
  "dependencies": {
25
- "homebridge-lib": "~5.6.5"
25
+ "homebridge-lib": "~5.6.8"
26
26
  },
27
27
  "scripts": {
28
28
  "prepare": "standard",
@@ -36,8 +36,14 @@
36
36
  "url": "https://github.com/ebaauw/homebridge-nb/issues"
37
37
  },
38
38
  "homepage": "https://github.com/ebaauw/homebridge-nb#readme",
39
- "funding": {
40
- "type": "paypal",
41
- "url": "https://www.paypal.me/ebaauw/EUR"
42
- }
39
+ "funding": [
40
+ {
41
+ "type": "github",
42
+ "url": "https://github.com/sponsors/ebaauw"
43
+ },
44
+ {
45
+ "type": "paypal",
46
+ "url": "https://www.paypal.me/ebaauw/EUR"
47
+ }
48
+ ]
43
49
  }