@homebridge-plugins/homebridge-meross 10.20.0 → 10.20.1

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to `@homebridge-plugins/homebridge-meross` will be documented in this file.
4
4
 
5
+ ## v10.20.1 (2026-10-18)
6
+
7
+ ### Changed
8
+
9
+ - chore(deps): dependency updates
10
+
5
11
  ## v10.20.0 (2026-08-16)
6
12
 
7
13
  ### Changed
@@ -1,11 +1,11 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
5
  import {
7
6
  generateRandomString,
8
7
  hasProperty,
8
+ isTimeoutError,
9
9
  parseError,
10
10
  sleep,
11
11
  } from '../utils/functions.js'
@@ -190,7 +190,7 @@ export default class {
190
190
  timeout: 10000,
191
191
  throwOnTimeout: true,
192
192
  })
193
- this.queue.on('idle', () => {
193
+ this.queue.addEventListener('idle', () => {
194
194
  this.updateInProgress = false
195
195
  })
196
196
 
@@ -250,7 +250,7 @@ export default class {
250
250
  })
251
251
  } catch (err) {
252
252
  // Catch any errors whilst updating the device
253
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
253
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
254
254
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
255
255
  setTimeout(() => {
256
256
  this.service.updateCharacteristic(this.hapChar.Active, this.cacheState)
@@ -291,7 +291,7 @@ export default class {
291
291
  })
292
292
  } catch (err) {
293
293
  // Catch any errors whilst updating the device
294
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
294
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
295
295
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
296
296
  setTimeout(() => {
297
297
  this.service.updateCharacteristic(this.hapChar.ActiveIdentifier, this.cacheChannel)
@@ -344,7 +344,7 @@ export default class {
344
344
  })
345
345
  } catch (err) {
346
346
  // Catch any errors whilst updating the device
347
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
347
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
348
348
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
349
349
  setTimeout(() => {
350
350
  this.speakerService.updateCharacteristic(this.hapChar.RotationSpeed, this.cacheVolume)
@@ -389,7 +389,7 @@ export default class {
389
389
  })
390
390
  } catch (err) {
391
391
  // Catch any errors whilst updating the device
392
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
392
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
393
393
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
394
394
  setTimeout(() => {
395
395
  this.serviceLight.updateCharacteristic(this.cusChar[charToUpdate], false)
@@ -468,7 +468,7 @@ export default class {
468
468
  }
469
469
  })
470
470
  } catch (err) {
471
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
471
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
472
472
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
473
473
 
474
474
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,9 +1,8 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
- import { hasProperty, parseError } from '../utils/functions.js'
5
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
7
6
  import platformLang from '../utils/lang-en.js'
8
7
 
9
8
  export default class {
@@ -98,7 +97,7 @@ export default class {
98
97
  timeout: 10000,
99
98
  throwOnTimeout: true,
100
99
  })
101
- this.queue.on('idle', () => {
100
+ this.queue.addEventListener('idle', () => {
102
101
  this.updateInProgress = false
103
102
  })
104
103
 
@@ -196,7 +195,7 @@ export default class {
196
195
  )
197
196
  })
198
197
  } catch (err) {
199
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
198
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
200
199
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
201
200
  setTimeout(() => {
202
201
  this.service.updateCharacteristic(this.hapChar.Active, this.cacheState ? 1 : 0)
@@ -266,7 +265,7 @@ export default class {
266
265
  )
267
266
  })
268
267
  } catch (err) {
269
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
268
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
270
269
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
271
270
  setTimeout(() => {
272
271
  this.service.updateCharacteristic(
@@ -333,7 +332,7 @@ export default class {
333
332
  )
334
333
  })
335
334
  } catch (err) {
336
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
335
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
337
336
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
338
337
  }
339
338
  }
@@ -431,7 +430,7 @@ export default class {
431
430
  }
432
431
  })
433
432
  } catch (err) {
434
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
433
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
435
434
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
436
435
 
437
436
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,5 +1,4 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import {
@@ -12,6 +11,7 @@ import platformConsts from '../utils/constants.js'
12
11
  import {
13
12
  generateRandomString,
14
13
  hasProperty,
14
+ isTimeoutError,
15
15
  parseError,
16
16
  sleep,
17
17
  } from '../utils/functions.js'
@@ -155,7 +155,7 @@ export default class {
155
155
  timeout: 10000,
156
156
  throwOnTimeout: true,
157
157
  })
158
- this.queue.on('idle', () => {
158
+ this.queue.addEventListener('idle', () => {
159
159
  this.updateInProgress = false
160
160
  })
161
161
 
@@ -217,7 +217,7 @@ export default class {
217
217
  })
218
218
  } catch (err) {
219
219
  // Catch any errors whilst updating the device
220
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
220
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
221
221
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
222
222
  setTimeout(() => {
223
223
  this.fanService.updateCharacteristic(this.hapChar.On, this.cacheFanState)
@@ -284,7 +284,7 @@ export default class {
284
284
  })
285
285
  } catch (err) {
286
286
  // Catch any errors whilst updating the device
287
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
287
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
288
288
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
289
289
  setTimeout(() => {
290
290
  this.fanService.updateCharacteristic(
@@ -333,7 +333,7 @@ export default class {
333
333
  })
334
334
  } catch (err) {
335
335
  // Catch any errors whilst updating the device
336
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
336
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
337
337
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
338
338
  setTimeout(() => {
339
339
  this.lightService.updateCharacteristic(this.hapChar.On, this.cacheLightState)
@@ -510,7 +510,7 @@ export default class {
510
510
  })
511
511
  } catch (err) {
512
512
  // Catch any errors whilst updating the device
513
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
513
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
514
514
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
515
515
  let charToError
516
516
  switch (mode) {
@@ -605,7 +605,7 @@ export default class {
605
605
  }
606
606
  })
607
607
  } catch (err) {
608
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
608
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
609
609
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
610
610
 
611
611
  // Set the homebridge-ui status of the device to offline if local and error is timeout
package/lib/device/fan.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
5
  import {
7
6
  generateRandomString,
8
7
  hasProperty,
8
+ isTimeoutError,
9
9
  parseError,
10
10
  sleep,
11
11
  } from '../utils/functions.js'
@@ -113,7 +113,7 @@ export default class {
113
113
  timeout: 10000,
114
114
  throwOnTimeout: true,
115
115
  })
116
- this.queue.on('idle', () => {
116
+ this.queue.addEventListener('idle', () => {
117
117
  this.updateInProgress = false
118
118
  })
119
119
 
@@ -171,7 +171,7 @@ export default class {
171
171
  })
172
172
  } catch (err) {
173
173
  // Catch any errors whilst updating the device
174
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
174
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
175
175
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
176
176
  setTimeout(() => {
177
177
  this.fanService.updateCharacteristic(this.hapChar.On, this.cacheFanState)
@@ -241,7 +241,7 @@ export default class {
241
241
  })
242
242
  } catch (err) {
243
243
  // Catch any errors whilst updating the device
244
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
244
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
245
245
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
246
246
  setTimeout(() => {
247
247
  this.fanService.updateCharacteristic(
@@ -286,7 +286,7 @@ export default class {
286
286
  })
287
287
  } catch (err) {
288
288
  // Catch any errors whilst updating the device
289
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
289
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
290
290
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
291
291
  setTimeout(() => {
292
292
  this.lightService.updateCharacteristic(this.hapChar.On, this.cacheLightState)
@@ -414,7 +414,7 @@ export default class {
414
414
  }
415
415
  })
416
416
  } catch (err) {
417
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
417
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
418
418
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
419
419
 
420
420
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,9 +1,8 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
- import { hasProperty, parseError } from '../utils/functions.js'
5
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
7
6
  import platformLang from '../utils/lang-en.js'
8
7
 
9
8
  export default class {
@@ -37,7 +36,7 @@ export default class {
37
36
  timeout: 10000,
38
37
  throwOnTimeout: true,
39
38
  })
40
- this.queue.on('idle', () => {
39
+ this.queue.addEventListener('idle', () => {
41
40
  this.updateInProgress = false
42
41
  })
43
42
 
@@ -157,7 +156,7 @@ export default class {
157
156
  }
158
157
  })
159
158
  } catch (err) {
160
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
159
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
161
160
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
162
161
 
163
162
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,9 +1,8 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
- import { generateRandomString, hasProperty, parseError } from '../utils/functions.js'
5
+ import { generateRandomString, hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
7
6
  import platformLang from '../utils/lang-en.js'
8
7
 
9
8
  export default class {
@@ -80,7 +79,7 @@ export default class {
80
79
  timeout: 10000,
81
80
  throwOnTimeout: true,
82
81
  })
83
- this.queue.on('idle', () => {
82
+ this.queue.addEventListener('idle', () => {
84
83
  this.updateInProgress = false
85
84
  })
86
85
 
@@ -307,7 +306,7 @@ export default class {
307
306
  })
308
307
  } catch (err) {
309
308
  // Catch any errors whilst updating the device
310
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
309
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
311
310
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
312
311
  setTimeout(() => {
313
312
  this.service.updateCharacteristic(this.hapChar.TargetDoorState, this.cacheTarget)
@@ -386,7 +385,7 @@ export default class {
386
385
  }
387
386
  })
388
387
  } catch (err) {
389
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
388
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
390
389
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
391
390
 
392
391
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,8 +1,7 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import platformConsts from '../utils/constants.js'
5
- import { generateRandomString, hasProperty, parseError } from '../utils/functions.js'
4
+ import { generateRandomString, hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
6
5
  import platformLang from '../utils/lang-en.js'
7
6
 
8
7
  export default class {
@@ -71,7 +70,7 @@ export default class {
71
70
  timeout: 10000,
72
71
  throwOnTimeout: true,
73
72
  })
74
- this.queue.on('idle', () => {
73
+ this.queue.addEventListener('idle', () => {
75
74
  this.updateInProgress = false
76
75
  })
77
76
 
@@ -286,7 +285,7 @@ export default class {
286
285
  })
287
286
  } catch (err) {
288
287
  // Catch any errors whilst updating the device
289
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
288
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
290
289
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
291
290
  setTimeout(() => {
292
291
  this.service.updateCharacteristic(this.hapChar.TargetDoorState, this.cacheTarget)
@@ -1,9 +1,8 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
- import { hasProperty, parseError } from '../utils/functions.js'
5
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
7
6
  import platformLang from '../utils/lang-en.js'
8
7
 
9
8
  export default class {
@@ -98,7 +97,7 @@ export default class {
98
97
  timeout: 10000,
99
98
  throwOnTimeout: true,
100
99
  })
101
- this.queue.on('idle', () => {
100
+ this.queue.addEventListener('idle', () => {
102
101
  this.updateInProgress = false
103
102
  })
104
103
 
@@ -196,7 +195,7 @@ export default class {
196
195
  )
197
196
  })
198
197
  } catch (err) {
199
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
198
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
200
199
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
201
200
  setTimeout(() => {
202
201
  this.service.updateCharacteristic(this.hapChar.Active, this.cacheState ? 1 : 0)
@@ -265,7 +264,7 @@ export default class {
265
264
  )
266
265
  })
267
266
  } catch (err) {
268
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
267
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
269
268
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
270
269
  setTimeout(() => {
271
270
  this.service.updateCharacteristic(
@@ -331,7 +330,7 @@ export default class {
331
330
  )
332
331
  })
333
332
  } catch (err) {
334
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
333
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
335
334
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
336
335
  }
337
336
  }
@@ -429,7 +428,7 @@ export default class {
429
428
  }
430
429
  })
431
430
  } catch (err) {
432
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
431
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
433
432
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
434
433
 
435
434
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,9 +1,8 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
- import { hasProperty, parseError } from '../utils/functions.js'
5
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
7
6
  import platformLang from '../utils/lang-en.js'
8
7
 
9
8
  /**
@@ -63,7 +62,7 @@ export default class {
63
62
  timeout: 10000,
64
63
  throwOnTimeout: true,
65
64
  })
66
- this.queue.on('idle', () => {
65
+ this.queue.addEventListener('idle', () => {
67
66
  this.updateInProgress = false
68
67
  })
69
68
 
@@ -346,7 +345,7 @@ export default class {
346
345
  }
347
346
  })
348
347
  } catch (err) {
349
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
348
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
350
349
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
351
350
 
352
351
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,8 +1,7 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import platformConsts from '../utils/constants.js'
5
- import { hasProperty, parseError } from '../utils/functions.js'
4
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
6
5
  import platformLang from '../utils/lang-en.js'
7
6
 
8
7
  export default class {
@@ -71,7 +70,7 @@ export default class {
71
70
  timeout: 10000,
72
71
  throwOnTimeout: true,
73
72
  })
74
- this.queue.on('idle', () => {
73
+ this.queue.addEventListener('idle', () => {
75
74
  this.updateInProgress = false
76
75
  })
77
76
 
@@ -130,7 +129,7 @@ export default class {
130
129
  })
131
130
  } catch (err) {
132
131
  // Catch any errors whilst updating the device
133
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
132
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
134
133
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
135
134
  setTimeout(() => {
136
135
  this.service.updateCharacteristic(this.hapChar.Active, this.cacheState)
@@ -1,8 +1,7 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import platformConsts from '../utils/constants.js'
5
- import { hasProperty, parseError } from '../utils/functions.js'
4
+ import { hasProperty, isTimeoutError, parseError } from '../utils/functions.js'
6
5
  import platformLang from '../utils/lang-en.js'
7
6
 
8
7
  export default class {
@@ -106,7 +105,7 @@ export default class {
106
105
  timeout: 10000,
107
106
  throwOnTimeout: true,
108
107
  })
109
- this.queue.on('idle', () => {
108
+ this.queue.addEventListener('idle', () => {
110
109
  this.updateInProgress = false
111
110
  })
112
111
 
@@ -154,7 +153,7 @@ export default class {
154
153
  })
155
154
  } catch (err) {
156
155
  // Catch any errors whilst updating the device
157
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
156
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
158
157
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
159
158
  setTimeout(() => {
160
159
  this.service.updateCharacteristic(this.hapChar.TargetHeatingCoolingState, this.cacheState)
@@ -211,7 +210,7 @@ export default class {
211
210
  })
212
211
  } catch (err) {
213
212
  // Catch any errors whilst updating the device
214
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
213
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
215
214
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
216
215
  setTimeout(() => {
217
216
  this.service.updateCharacteristic(this.mode2Char[newMode], false)
@@ -268,7 +267,7 @@ export default class {
268
267
  })
269
268
  } catch (err) {
270
269
  // Catch any errors whilst updating the device
271
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
270
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
272
271
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
273
272
  setTimeout(() => {
274
273
  this.service.updateCharacteristic(this.hapChar.TargetTemperature, this.cacheTarg)
@@ -1,5 +1,4 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import {
@@ -12,6 +11,7 @@ import platformConsts from '../utils/constants.js'
12
11
  import {
13
12
  generateRandomString,
14
13
  hasProperty,
14
+ isTimeoutError,
15
15
  parseError,
16
16
  sleep,
17
17
  } from '../utils/functions.js'
@@ -118,7 +118,7 @@ export default class {
118
118
  timeout: 10000,
119
119
  throwOnTimeout: true,
120
120
  })
121
- this.queue.on('idle', () => {
121
+ this.queue.addEventListener('idle', () => {
122
122
  this.updateInProgress = false
123
123
  })
124
124
 
@@ -176,7 +176,7 @@ export default class {
176
176
  })
177
177
  } catch (err) {
178
178
  // Catch any errors whilst updating the device
179
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
179
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
180
180
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
181
181
  setTimeout(() => {
182
182
  this.fanService.updateCharacteristic(this.hapChar.On, this.cacheFanState)
@@ -240,7 +240,7 @@ export default class {
240
240
  })
241
241
  } catch (err) {
242
242
  // Catch any errors whilst updating the device
243
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
243
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
244
244
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
245
245
  setTimeout(() => {
246
246
  this.fanService.updateCharacteristic(
@@ -285,7 +285,7 @@ export default class {
285
285
  })
286
286
  } catch (err) {
287
287
  // Catch any errors whilst updating the device
288
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
288
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
289
289
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
290
290
  setTimeout(() => {
291
291
  this.lightService.updateCharacteristic(this.hapChar.On, this.cacheLightState)
@@ -433,7 +433,7 @@ export default class {
433
433
  }
434
434
  })
435
435
  } catch (err) {
436
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
436
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
437
437
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
438
438
 
439
439
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,5 +1,4 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import { hk2mrCT, mr2hkCT } from '../utils/colour.js'
@@ -7,6 +6,7 @@ import platformConsts from '../utils/constants.js'
7
6
  import {
8
7
  generateRandomString,
9
8
  hasProperty,
9
+ isTimeoutError,
10
10
  parseError,
11
11
  sleep,
12
12
  } from '../utils/functions.js'
@@ -121,7 +121,7 @@ export default class {
121
121
  timeout: 10000,
122
122
  throwOnTimeout: true,
123
123
  })
124
- this.queue.on('idle', () => {
124
+ this.queue.addEventListener('idle', () => {
125
125
  this.updateInProgress = false
126
126
  })
127
127
 
@@ -180,7 +180,7 @@ export default class {
180
180
  })
181
181
  } catch (err) {
182
182
  // Catch any errors whilst updating the device
183
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
183
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
184
184
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
185
185
  setTimeout(() => {
186
186
  this.service.updateCharacteristic(this.hapChar.On, this.cacheState)
@@ -331,7 +331,7 @@ export default class {
331
331
  })
332
332
  } catch (err) {
333
333
  // Catch any errors whilst updating the device
334
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
334
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
335
335
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
336
336
  setTimeout(() => {
337
337
  this.service.updateCharacteristic(this.cusChar.On, this.cacheState)
@@ -410,7 +410,7 @@ export default class {
410
410
  }
411
411
  })
412
412
  } catch (err) {
413
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
413
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
414
414
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
415
415
 
416
416
  // Set the homebridge-ui status of the device to offline if local and error is timeout
@@ -1,11 +1,11 @@
1
1
  import PQueue from 'p-queue'
2
- import { TimeoutError } from 'p-timeout'
3
2
 
4
3
  import mqttClient from '../connection/mqtt.js'
5
4
  import platformConsts from '../utils/constants.js'
6
5
  import {
7
6
  generateRandomString,
8
7
  hasProperty,
8
+ isTimeoutError,
9
9
  parseError,
10
10
  sleep,
11
11
  } from '../utils/functions.js'
@@ -63,7 +63,7 @@ export default class {
63
63
  timeout: 10000,
64
64
  throwOnTimeout: true,
65
65
  })
66
- this.queue.on('idle', () => {
66
+ this.queue.addEventListener('idle', () => {
67
67
  this.updateInProgress = false
68
68
  })
69
69
 
@@ -121,7 +121,7 @@ export default class {
121
121
  })
122
122
  } catch (err) {
123
123
  // Catch any errors whilst updating the device
124
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
124
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
125
125
  this.accessory.logWarn(`${platformLang.sendFailed} ${eText}`)
126
126
  setTimeout(() => {
127
127
  this.service.updateCharacteristic(this.hapChar.On, this.cacheState)
@@ -252,7 +252,7 @@ export default class {
252
252
  }
253
253
  })
254
254
  } catch (err) {
255
- const eText = err instanceof TimeoutError ? platformLang.timeout : parseError(err)
255
+ const eText = isTimeoutError(err) ? platformLang.timeout : parseError(err)
256
256
  this.accessory.logDebugWarn(`${platformLang.reqFailed}: ${eText}`)
257
257
 
258
258
  // Set the homebridge-ui status of the device to offline if local and error is timeout