@homebridge-plugins/homebridge-ewelink 12.16.1-beta.0 → 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 +2 -0
- package/lib/device/zigbee/zigbee-water-valve.js +29 -1
- package/lib/platform.js +3 -3
- package/lib/utils/constants.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,9 @@ All notable changes to `@homebridge-plugins/homebridge-ewelink` will be document
|
|
|
6
6
|
|
|
7
7
|
### Changed
|
|
8
8
|
|
|
9
|
+
- fix: restore roller shutters on the dualr3 lite in motor mode (#778) (@zcwtpbn2d9-cell)
|
|
9
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)
|
|
10
12
|
|
|
11
13
|
## v12.16.0 (2026-07-16)
|
|
12
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/lib/platform.js
CHANGED
|
@@ -713,7 +713,7 @@ export default class {
|
|
|
713
713
|
// Remove old sub accessories for Accessory Simulations and DUALR3 in motor/meter mode
|
|
714
714
|
if (
|
|
715
715
|
device.showAs !== 'default'
|
|
716
|
-
|| (platformConsts.devices.
|
|
716
|
+
|| (platformConsts.devices.dualr3.includes(uiid)
|
|
717
717
|
&& [2, 3].includes(device.params.workMode))
|
|
718
718
|
) {
|
|
719
719
|
for (let i = 0; i <= 4; i += 1) {
|
|
@@ -725,7 +725,7 @@ export default class {
|
|
|
725
725
|
}
|
|
726
726
|
|
|
727
727
|
// Set up the correct instance for this particular device
|
|
728
|
-
if (platformConsts.devices.
|
|
728
|
+
if (platformConsts.devices.dualr3.includes(uiid) && device.params.workMode === 2) {
|
|
729
729
|
/**
|
|
730
730
|
***********************
|
|
731
731
|
BLINDS [DUALR3 MOTOR MODE]
|
|
@@ -763,7 +763,7 @@ export default class {
|
|
|
763
763
|
accessory.control = new deviceTypes.deviceMotor(this, accessory)
|
|
764
764
|
/** */
|
|
765
765
|
} else if (
|
|
766
|
-
platformConsts.devices.
|
|
766
|
+
platformConsts.devices.dualr3.includes(uiid)
|
|
767
767
|
&& device.params.workMode === 3
|
|
768
768
|
) {
|
|
769
769
|
/**
|
package/lib/utils/constants.js
CHANGED
|
@@ -331,6 +331,11 @@ export default {
|
|
|
331
331
|
20004,
|
|
332
332
|
],
|
|
333
333
|
switchMultiPower: [126, 130, 262],
|
|
334
|
+
|
|
335
|
+
// The DUALR3 family can be switched into motor (workMode 2) or meter
|
|
336
|
+
// (workMode 3) mode. This is kept separate from switchMultiPower because
|
|
337
|
+
// the Lite has those modes but no power monitoring (#778).
|
|
338
|
+
dualr3: [126, 165],
|
|
334
339
|
switchMate: [177],
|
|
335
340
|
switchMan: [174],
|
|
336
341
|
lightDimmer: [36, 44, 57, 277, 20006],
|
package/package.json
CHANGED