@homebridge-plugins/homebridge-ewelink 12.19.1-beta.7 → 12.19.1-beta.8

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
@@ -29,6 +29,7 @@ All notable changes to `@homebridge-plugins/homebridge-ewelink` will be document
29
29
  - feat: show pm2.5 and pm10 on the air quality sensors that measure them
30
30
  - fix(zigbee): show a curtain motor at rest after a restart, not stuck opening (#810)
31
31
  - fix: log the state each device starts from in debug mode, to trace a wrong start (#810)
32
+ - fix(zigbee): ignore the stale position the cloud keeps for a zbu-curt-7006 (#810)
32
33
 
33
34
  ## v12.19.0 (2026-10-18)
34
35
 
@@ -189,6 +189,10 @@ export default class {
189
189
  // Set a device online flag now which we can change later
190
190
  let onlineStatus = true
191
191
 
192
+ // A reply to a request (such as a status query) carries an error code,
193
+ // which an update the device pushes does not
194
+ let isReply = false
195
+
192
196
  // Set up a params object if one didn't already come within the message
193
197
  if (!msg.params) {
194
198
  msg.params = {}
@@ -199,6 +203,7 @@ export default class {
199
203
  msg.action = 'update'
200
204
  // Set the online status of the device
201
205
  onlineStatus = msg.error === 0
206
+ isReply = true
202
207
  }
203
208
 
204
209
  // Normally the WS messages comes with an action
@@ -236,6 +241,12 @@ export default class {
236
241
  msg.params.online = onlineStatus
237
242
  msg.params.updateSource = 'WS'
238
243
 
244
+ // A reply comes from the cloud's stored copy of the device, which
245
+ // can be stale, rather than from the device itself (#810)
246
+ if (isReply) {
247
+ msg.params.storedState = true
248
+ }
249
+
239
250
  // Generate the object to return to the plugin
240
251
  const returnTemplate = {
241
252
  deviceid: msg.deviceid,
@@ -26,6 +26,11 @@ export default class {
26
26
  // which is the reverse of HomeKit (#810)
27
27
  this.invertPosition = accessory.context.eweUIID === 7006
28
28
 
29
+ // The cloud's stored copy of its position goes stale too. Two open curtains
30
+ // came back from it as closed (curPercent 100) after every restart (#810),
31
+ // so for this model only a live report from the motor sets the position
32
+ this.ignoreStoredPosition = accessory.context.eweUIID === 7006
33
+
29
34
  // Set the correct logging variables for this accessory
30
35
  switch (deviceConf.overrideLogging) {
31
36
  case 'standard':
@@ -242,8 +247,12 @@ export default class {
242
247
  }
243
248
  }
244
249
 
250
+ // The state handed over at startup, and the cloud's reply to a status
251
+ // request, come from its stored copy rather than from the motor itself
252
+ const fromStore = !params.updateSource || params.storedState
253
+
245
254
  // curPercent is the current position of the motor
246
- if (hasProperty(params, 'curPercent')) {
255
+ if (hasProperty(params, 'curPercent') && !(fromStore && this.ignoreStoredPosition)) {
247
256
  const newPos = this.convertPosition(params.curPercent)
248
257
  if (newPos !== this.cachePos) {
249
258
  this.cachePos = newPos
@@ -270,12 +279,13 @@ export default class {
270
279
  }
271
280
  }
272
281
 
273
- // The state the cloud hands over at startup carries the target but not
274
- // the position, so a curtain that had finished moving was left at its
275
- // cached position and shown opening or closing until it next moved
276
- // (#810). A motor at rest after a restart sits at its target; a real
277
- // position report corrects this straight away if it is still moving
278
- if (!params.updateSource && hasProperty(params, 'openPercent') && !hasProperty(params, 'curPercent')) {
282
+ // A stored state with no position the plugin can use - none at all, or a
283
+ // stale one it ignores - left a curtain that had finished moving at its
284
+ // cached position, shown opening or closing until it next moved (#810).
285
+ // A motor at rest sits at its target; a live position report corrects
286
+ // this straight away if it is still moving
287
+ const hasUsablePosition = hasProperty(params, 'curPercent') && !this.ignoreStoredPosition
288
+ if (fromStore && hasProperty(params, 'openPercent') && !hasUsablePosition) {
279
289
  this.cachePos = this.cacheTarg
280
290
  if (!this.isGarage) {
281
291
  this.service.updateCharacteristic(this.hapChar.CurrentPosition, this.cachePos)
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Homebridge eWeLink",
4
4
  "alias": "eWeLink",
5
5
  "type": "module",
6
- "version": "12.19.1-beta.7",
6
+ "version": "12.19.1-beta.8",
7
7
  "description": "Homebridge plugin to integrate eWeLink devices into HomeKit.",
8
8
  "author": {
9
9
  "name": "bwp91",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@homebridge/plugin-ui-utils": "^2.2.6",
70
- "axios": "^1.20.0",
70
+ "axios": "^1.21.0",
71
71
  "node-persist": "^4.0.4",
72
72
  "p-queue": "^10.0.0",
73
73
  "websocket-as-promised": "^3.0.1",