@homebridge-plugins/homebridge-govee 11.33.1 → 11.33.2-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,6 +2,12 @@
2
2
 
3
3
  All notable changes to `@homebridge-plugins/homebridge-govee` will be documented in this file.
4
4
 
5
+ ## v11.33.2 (Pending Release)
6
+
7
+ ### Changed
8
+
9
+ - fix: implement the H7105 oscillation toggle, which threw a not-implemented error (#1339)
10
+
5
11
  ## v11.33.1 (2026-08-04)
6
12
 
7
13
  ### Changed
@@ -187,33 +187,42 @@ export default class extends GoveeDevice {
187
187
 
188
188
  async internalSwingUpdate(value) {
189
189
  try {
190
- // Don't continue if the new value is the same as before
191
- if (this.cacheSwing === value) {
190
+ const newValue = value ? 'on' : 'off'
191
+ // Don't continue if the new value is the same as before. The comparison
192
+ // has to be against the mapped string - cacheSwing holds 'on'/'off' and
193
+ // value arrives as a boolean, so comparing them directly never matched
194
+ if (this.cacheSwing === newValue) {
192
195
  return
193
196
  }
194
197
 
195
- throw new Error('Swing mode update not implemented yet')
196
-
197
- // const newValue = value ? 'on' : 'off'
198
- // The existing cacheSwingCode might be something like aa1d0101960384000000000000000000000000a6
199
- // We need to change the third hex value to 00 for off or 01 for on
200
- // const hexValues = [
201
- // 0x3A,
202
- // 0x1D,
203
- // value ? 0x01 : 0x00,
204
- // ...this.cacheSwingCode.slice(6, 14).match(/.{1,2}/g).map(byte => Number.parseInt(byte, 16)),
205
- // ]
206
- //
207
- // await this.platform.sendDeviceUpdate(this.accessory, {
208
- // cmd: 'multiSync',
209
- // value: generateCodeFromHexValues(hexValues),
210
- // })
198
+ // Same oscillation shape as the H7107, which is the only other fan that
199
+ // reports a swing RANGE rather than a plain on/off. Turning ON carries
200
+ // over the range bytes from the last report seen; turning OFF must not,
201
+ // because a parameterised off command was answered with a zero-tailed
202
+ // frame while the fan kept oscillating (#1334, #1339)
203
+ const tailBytes = value && this.cacheSwingCode
204
+ ? this.cacheSwingCode.slice(6, 14).match(/.{1,2}/g).map(byte => Number.parseInt(byte, 16))
205
+ : []
206
+ await this.platform.sendDeviceUpdate(this.accessory, {
207
+ cmd: 'ptReal',
208
+ value: generateCodeFromHexValues([0x33, 0x1D, value ? 0x01 : 0x00, ...tailBytes]),
209
+ openApi: this.accessory.context.openApiCapabilities?.oscillationToggle
210
+ ? { instance: 'oscillationToggle', capabilityType: 'devices.capabilities.toggle', value: value ? 1 : 0 }
211
+ : undefined,
212
+ })
213
+
214
+ // The fan's own oscillation state travels as multiSync traffic, so send
215
+ // that shape too. Whichever the model ignores is harmless
216
+ await this.platform.sendDeviceUpdate(this.accessory, {
217
+ cmd: 'multiSync',
218
+ value: generateCodeFromHexValues([0x3A, 0x1D, value ? 0x01 : 0x00, ...tailBytes]),
219
+ })
211
220
 
212
221
  // Cache the new state and log if appropriate
213
- // if (this.cacheSwing !== newValue) {
214
- // this.cacheSwing = newValue
215
- // this.accessory.log(`${platformLang.curSwing} [${newValue}]`)
216
- // }
222
+ if (this.cacheSwing !== newValue) {
223
+ this.cacheSwing = newValue
224
+ this.accessory.log(`${platformLang.curSwing} [${newValue}]`)
225
+ }
217
226
  } catch (err) {
218
227
  this.failUpdate(err, () => {
219
228
  this.service.updateCharacteristic(this.hapChar.SwingMode, this.cacheSwing === 'on' ? 1 : 0)
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-govee",
3
3
  "alias": "Govee",
4
4
  "type": "module",
5
- "version": "11.33.1",
5
+ "version": "11.33.2-beta.0",
6
6
  "description": "Homebridge plugin to integrate Govee devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",