@homebridge-plugins/homebridge-ewelink 12.18.2-beta.0 → 12.18.2-beta.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
@@ -15,6 +15,7 @@ All notable changes to `@homebridge-plugins/homebridge-ewelink` will be document
15
15
  - fix: survive a network change on the lan discovery socket instead of crashing the bridge
16
16
  - fix: set a garage's sensor up after the garage, so it gets its open and closed feedback
17
17
  - fix: make the per-device logging override settable, and drop the debug option that never was
18
+ - fix: move the two-door garage one door at a time, so the second is not cut short
18
19
 
19
20
  ## v12.18.1 (2026-08-02)
20
21
 
@@ -232,10 +232,15 @@ export default class {
232
232
  }
233
233
  }
234
234
 
235
- externalUpdate(params) {
235
+ async externalUpdate(params) {
236
236
  try {
237
237
  if (params.switches?.length >= 4 && !this.inUse) {
238
- ['1', '2'].forEach(async (v) => {
238
+ // One door at a time. This was a `forEach(async ...)`, so both doors ran
239
+ // at once over a shared `this.inUse` flag - door one cleared it two
240
+ // seconds in while door two was still moving, defeating the guard - and a
241
+ // rejection from the awaits below escaped the try above rather than being
242
+ // caught by it, because the callback's promise was thrown away.
243
+ for (const v of ['1', '2']) {
239
244
  const gcService = this.accessory.getService(`Garage ${v}`)
240
245
  const prevState = v === '1'
241
246
  ? this.accessory.context.cacheOneCurrentDoorState
@@ -247,7 +252,7 @@ export default class {
247
252
  params.switches[0].switch === params.switches[1].switch
248
253
  || params.switches[prevState % 2].switch === 'on'
249
254
  ) {
250
- return
255
+ continue
251
256
  }
252
257
  break
253
258
  case '2':
@@ -255,11 +260,11 @@ export default class {
255
260
  params.switches[2].switch === params.switches[3].switch
256
261
  || params.switches[(prevState % 2) + 2].switch === 'on'
257
262
  ) {
258
- return
263
+ continue
259
264
  }
260
265
  break
261
266
  default:
262
- return
267
+ continue
263
268
  }
264
269
  this.inUse = true
265
270
  gcService.updateCharacteristic(this.hapChar.TargetDoorState, newPos - 2)
@@ -274,7 +279,7 @@ export default class {
274
279
  this.accessory.context.cacheTwoTargetDoorState = newPos - 2
275
280
  break
276
281
  default:
277
- return
282
+ continue
278
283
  }
279
284
  await sleep(2000)
280
285
  this.inUse = false
@@ -306,7 +311,7 @@ export default class {
306
311
  break
307
312
  default:
308
313
  }
309
- })
314
+ }
310
315
  }
311
316
 
312
317
  // Get the power readings given by certain devices
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Homebridge eWeLink",
4
4
  "alias": "eWeLink",
5
5
  "type": "module",
6
- "version": "12.18.2-beta.0",
6
+ "version": "12.18.2-beta.1",
7
7
  "description": "Homebridge plugin to integrate eWeLink devices into HomeKit.",
8
8
  "author": {
9
9
  "name": "bwp91",