homebridge-nb 1.5.10 → 1.5.12

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.
@@ -45,34 +45,11 @@ class Bridge extends AccessoryDelegate {
45
45
  this.client = new NbClient({
46
46
  encryption: platform.config.encryption,
47
47
  host: this.context.host,
48
+ logger: this,
48
49
  timeout: platform.config.timeout,
49
50
  token: this.context.token
50
51
  })
51
52
  this.client
52
- .on('error', (error) => {
53
- this.log(
54
- 'request %d: %s %s', error.request.id,
55
- error.request.method, error.request.resource
56
- )
57
- this.warn('request %d: error: %s', error.request.id, error)
58
- })
59
- .on('request', (request) => {
60
- this.debug(
61
- 'request %d: %s %s', request.id, request.method, request.resource
62
- )
63
- this.vdebug(
64
- 'request %d: %s %s', request.id, request.method, request.url
65
- )
66
- })
67
- .on('response', (response) => {
68
- this.vdebug(
69
- 'request %d: response: %j', response.request.id, response.body
70
- )
71
- this.debug(
72
- 'request %d: %s %s', response.request.id,
73
- response.statusCode, response.statusMessage
74
- )
75
- })
76
53
  .on('event', (event) => {
77
54
  this.debug('event: %j', event)
78
55
  const id = toHexString(event.nukiId)
package/lib/NbPlatform.js CHANGED
@@ -92,38 +92,9 @@ class NbPlatform extends Platform {
92
92
  this.config.devices = validDevices
93
93
  this.bridges = {}
94
94
  this.discovery = new NbDiscovery({
95
+ logger: this,
95
96
  timeout: this.config.timeout
96
97
  })
97
- this.discovery
98
- .on('error', (error) => {
99
- this.warn(
100
- '%s: request %d: %s %s', error.request.name, error.request.id,
101
- error.request.method, error.request.resource
102
- )
103
- this.warn(
104
- '%s: request %d: error: %s', error.request.name, error.request.id, error
105
- )
106
- })
107
- .on('request', (request) => {
108
- this.debug(
109
- '%s: request %d: %s %s', request.name, request.id,
110
- request.method, request.resource
111
- )
112
- this.vdebug(
113
- '%s: request %d: %s %s', request.name, request.id,
114
- request.method, request.url
115
- )
116
- })
117
- .on('response', (response) => {
118
- this.vdebug(
119
- '%s: request %d: response: %j', response.request.name, response.request.id,
120
- response.body
121
- )
122
- this.debug(
123
- '%s: request %d: %d %s', response.request.name, response.request.id,
124
- response.statusCode, response.statusMessage
125
- )
126
- })
127
98
  this
128
99
  .on('accessoryRestored', this.accessoryRestored)
129
100
  .once('heartbeat', this.init)
@@ -233,39 +204,10 @@ class NbPlatform extends Platform {
233
204
  const client = new NbClient({
234
205
  encryption: this.config.encryption,
235
206
  host,
207
+ logger: this,
236
208
  timeout: 60,
237
209
  token: this._accessories[id]?.context?.context?.token
238
210
  })
239
- client
240
- .on('error', (error) => {
241
- this.log(
242
- '%s: request %d: %s %s', name, error.request.id,
243
- error.request.method, error.request.resource
244
- )
245
- this.warn(
246
- '%s: request %d: error: %s', name, error.request.id, error
247
- )
248
- })
249
- .on('request', (request) => {
250
- this.debug(
251
- '%s: request %d: %s %s', name, request.id,
252
- request.method, request.resource
253
- )
254
- this.vdebug(
255
- '%s: equest %d: %s %s', name, request.id,
256
- request.method, request.url
257
- )
258
- })
259
- .on('response', (response) => {
260
- this.vdebug(
261
- '%s: request %d: response: %j', name, response.request.id,
262
- response.body
263
- )
264
- this.debug(
265
- '%s: request %d: %s %s', name, response.request.id,
266
- response.statusCode, response.statusMessage
267
- )
268
- })
269
211
  while (client.token === '') {
270
212
  try {
271
213
  this.log('%s: press Nuki bridge button to obtain token', name)
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "ebaauw"
8
8
  ],
9
9
  "license": "Apache-2.0",
10
- "version": "1.5.10",
10
+ "version": "1.5.12",
11
11
  "keywords": [
12
12
  "homebridge-plugin",
13
13
  "homekit",
@@ -22,13 +22,13 @@
22
22
  "nb": "cli/nb.js"
23
23
  },
24
24
  "engines": {
25
- "homebridge": "^1.11.2||^2.0.0-beta",
26
- "node": "^24||^22||^20",
25
+ "homebridge": "^2.0.0",
26
+ "node": "^24||^22",
27
27
  "nuki": "2.18.0"
28
28
  },
29
29
  "dependencies": {
30
- "homebridge-lib": "~7.3.1",
31
- "hb-nb-tools": "~2.0.23"
30
+ "homebridge-lib": "~8.0.1",
31
+ "hb-nb-tools": "~2.1.1"
32
32
  },
33
33
  "scripts": {
34
34
  "prepare": "standard",