@homebridge-plugins/homebridge-ewelink 12.16.1-beta.1 → 12.16.1-beta.2
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
|
@@ -8,6 +8,7 @@ All notable changes to `@homebridge-plugins/homebridge-ewelink` will be document
|
|
|
8
8
|
|
|
9
9
|
- fix: restore roller shutters on the dualr3 lite in motor mode (#778) (@zcwtpbn2d9-cell)
|
|
10
10
|
- fix: ignore repeat commands sent to the zigbee water valve (#778) (@zcwtpbn2d9-cell)
|
|
11
|
+
- fix: stop stale valve state echoes overriding a newer command (#778) (@zcwtpbn2d9-cell)
|
|
11
12
|
|
|
12
13
|
## v12.16.0 (2026-07-16)
|
|
13
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { hasProperty } from '../../utils/functions.js'
|
|
1
|
+
import { generateRandomString, hasProperty } from '../../utils/functions.js'
|
|
2
2
|
|
|
3
3
|
export default class {
|
|
4
4
|
constructor(platform, accessory) {
|
|
@@ -71,6 +71,18 @@ export default class {
|
|
|
71
71
|
// this command is still in flight are ignored too
|
|
72
72
|
this.cacheState = newState
|
|
73
73
|
|
|
74
|
+
// The device can echo a superseded state back after a newer command
|
|
75
|
+
// has been sent, flipping HomeKit to a state we have already left
|
|
76
|
+
// behind - suppress incoming updates around a command, the same way
|
|
77
|
+
// the other device types do (#778)
|
|
78
|
+
const timerKey = generateRandomString(5)
|
|
79
|
+
this.updateTimeout = timerKey
|
|
80
|
+
setTimeout(() => {
|
|
81
|
+
if (this.updateTimeout === timerKey) {
|
|
82
|
+
this.updateTimeout = false
|
|
83
|
+
}
|
|
84
|
+
}, 5000)
|
|
85
|
+
|
|
74
86
|
if (this.enableLogging) {
|
|
75
87
|
this.log('[%s] Setting valve to [%s]', this.name, newState ? 'On' : 'Off')
|
|
76
88
|
}
|
|
@@ -127,6 +139,16 @@ export default class {
|
|
|
127
139
|
// Set new timer
|
|
128
140
|
this.timer = setTimeout(async () => {
|
|
129
141
|
try {
|
|
142
|
+
// Suppress incoming updates around this command too, so an echo of
|
|
143
|
+
// the earlier On cannot land after the Off we are about to send (#778)
|
|
144
|
+
const timerKey = generateRandomString(5)
|
|
145
|
+
this.updateTimeout = timerKey
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
if (this.updateTimeout === timerKey) {
|
|
148
|
+
this.updateTimeout = false
|
|
149
|
+
}
|
|
150
|
+
}, 5000)
|
|
151
|
+
|
|
130
152
|
// Send explicit command to turn off the valve
|
|
131
153
|
await this.platform.sendDeviceUpdate(this.accessory, {
|
|
132
154
|
[this.switchParam]: false,
|
|
@@ -180,6 +202,12 @@ export default class {
|
|
|
180
202
|
|
|
181
203
|
async externalUpdate(params) {
|
|
182
204
|
try {
|
|
205
|
+
// Ignore updates while a command we sent is settling - they can carry
|
|
206
|
+
// the state we have just moved away from (#778)
|
|
207
|
+
if (this.updateTimeout) {
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
|
|
183
211
|
// Handle On/Off state
|
|
184
212
|
if (hasProperty(params, this.switchParam)) {
|
|
185
213
|
const newState = !!params[this.switchParam]
|
package/package.json
CHANGED