@homebridge-plugins/homebridge-ewelink 12.15.3-beta.4 → 12.16.1-beta.0
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
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@homebridge-plugins/homebridge-ewelink` will be documented in this file.
|
|
4
4
|
|
|
5
|
-
## v12.
|
|
5
|
+
## v12.16.1 (Pending Release)
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- fix: ignore repeat commands sent to the zigbee water valve (#778) (@zcwtpbn2d9-cell)
|
|
10
|
+
|
|
11
|
+
## v12.16.0 (2026-07-16)
|
|
6
12
|
|
|
7
13
|
### Changed
|
|
8
14
|
|
|
@@ -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/package.json
CHANGED