@homebridge-plugins/homebridge-ewelink 12.16.0 → 12.16.1-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 +7 -0
- package/lib/device/zigbee/zigbee-water-valve.js +16 -5
- package/lib/platform.js +3 -3
- package/lib/utils/constants.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@homebridge-plugins/homebridge-ewelink` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## v12.16.1 (Pending Release)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- fix: restore roller shutters on the dualr3 lite in motor mode (#778) (@zcwtpbn2d9-cell)
|
|
10
|
+
- fix: ignore repeat commands sent to the zigbee water valve (#778) (@zcwtpbn2d9-cell)
|
|
11
|
+
|
|
5
12
|
## v12.16.0 (2026-07-16)
|
|
6
13
|
|
|
7
14
|
### Changed
|
|
@@ -57,8 +57,20 @@ export default class {
|
|
|
57
57
|
this.service
|
|
58
58
|
.getCharacteristic(this.hapChar.Active)
|
|
59
59
|
.onSet(async (value) => {
|
|
60
|
+
const prevState = this.cacheState
|
|
60
61
|
try {
|
|
61
62
|
const newState = value === 1
|
|
63
|
+
|
|
64
|
+
// HomeKit can send the same command several times over, so ignore
|
|
65
|
+
// anything that asks the valve to do what it is already doing (#778)
|
|
66
|
+
if (newState === this.cacheState) {
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Claim the new state before sending, so repeats that arrive while
|
|
71
|
+
// this command is still in flight are ignored too
|
|
72
|
+
this.cacheState = newState
|
|
73
|
+
|
|
62
74
|
if (this.enableLogging) {
|
|
63
75
|
this.log('[%s] Setting valve to [%s]', this.name, newState ? 'On' : 'Off')
|
|
64
76
|
}
|
|
@@ -79,13 +91,12 @@ export default class {
|
|
|
79
91
|
// If turning off, clear the timer and reset remaining duration
|
|
80
92
|
this.clearTimer()
|
|
81
93
|
}
|
|
82
|
-
|
|
83
|
-
// Update cache after successful command
|
|
84
|
-
this.cacheState = newState
|
|
85
94
|
} catch (err) {
|
|
86
95
|
// Revert the characteristic state on error
|
|
87
|
-
this.
|
|
88
|
-
|
|
96
|
+
this.cacheState = prevState
|
|
97
|
+
const prevValue = prevState ? 1 : 0
|
|
98
|
+
this.service.updateCharacteristic(this.hapChar.Active, prevValue)
|
|
99
|
+
this.service.updateCharacteristic(this.hapChar.InUse, prevValue)
|
|
89
100
|
this.platform.deviceUpdateError(this.accessory, err, false)
|
|
90
101
|
throw new this.hapErr(-70402)
|
|
91
102
|
}
|
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