@homebridge-plugins/homebridge-wemo 7.7.4-beta.1 → 7.7.4-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
@@ -9,6 +9,8 @@ All notable changes to `@homebridge-plugins/homebridge-wemo` will be documented
9
9
  - ci: update github actions to their latest versions (#288)
10
10
  - fix: keep the decimals of a power reading, so 5.5w is no longer shown as 6w
11
11
  - chore(deps): dependency updates
12
+ - fix(lights): keep adaptive lighting on after a restart in the evening, the bulb stops at 2700k
13
+ - fix(lights): use the brightness step and other settings set for a link bulb in the config
12
14
 
13
15
  ## v7.7.3 (2026-10-18)
14
16
 
@@ -7,7 +7,7 @@ import {
7
7
  xy2rgb,
8
8
  } from '../utils/colour.js'
9
9
  import platformConsts from '../utils/constants.js'
10
- import { generateRandomString, parseError, sleep } from '../utils/functions.js'
10
+ import { generateRandomString, parseError, parseSerialNumber, sleep } from '../utils/functions.js'
11
11
  import platformLang from '../utils/lang-en.js'
12
12
 
13
13
  export default class {
@@ -22,11 +22,8 @@ export default class {
22
22
  this.accessory = accessory
23
23
  this.priAcc = priAcc
24
24
 
25
- // Set up variables from the device
26
- this.deviceID = accessory.context.deviceId
27
-
28
25
  // Set up custom variables for this device type
29
- const deviceConf = platform.deviceConf[this.deviceID] || {}
26
+ const deviceConf = platform.deviceConf[parseSerialNumber(accessory.context.serialNumber)] || {}
30
27
  this.brightStep = deviceConf.brightnessStep
31
28
  ? Math.min(deviceConf.brightnessStep, 100)
32
29
  : platformConsts.defaultValues.brightnessStep
@@ -121,7 +118,17 @@ export default class {
121
118
  this.service.getCharacteristic(this.hapChar.ColorTemperature).onSet(async (value) => {
122
119
  await this.internalCTUpdate(value)
123
120
  })
124
- this.cacheMired = this.service.getCharacteristic(this.hapChar.ColorTemperature).value
121
+
122
+ // The colour temperature last sent to or reported by the bulb, kept in the
123
+ // accessory context so it survives a restart. HomeKit's own saved value is
124
+ // no good for this: adaptive lighting can ask for a temperature outside
125
+ // the 170-370 range the bulb takes, and the bulb is sent the nearest it
126
+ // can do while HomeKit keeps what was asked for. Started from that, the
127
+ // bulb's first report after a restart looked like a change made outside
128
+ // HomeKit, and switched adaptive lighting off. HomeKit's value is only
129
+ // read for an accessory from before the context was kept
130
+ this.cacheMired = this.accessory.context.cacheMired
131
+ ?? this.service.getCharacteristic(this.hapChar.ColorTemperature).value
125
132
 
126
133
  // Add support for adaptive lighting if not disabled by user
127
134
  if (this.alShift !== -1) {
@@ -336,6 +343,7 @@ export default class {
336
343
  this.cacheHue = value
337
344
  this.cacheSat = currentSat
338
345
  this.cacheMired = 0
346
+ this.accessory.context.cacheMired = 0
339
347
  this.accessory.log(`${platformLang.curColour} [X:${X} Y:${Y}]`)
340
348
  } catch (err) {
341
349
  const eText = parseError(err, [platformLang.timeout, platformLang.timeoutUnreach])
@@ -372,6 +380,7 @@ export default class {
372
380
 
373
381
  // Update the cache and log if appropriate
374
382
  this.cacheMired = value
383
+ this.accessory.context.cacheMired = value
375
384
  this.cacheHue = 0
376
385
  this.cacheSat = 0
377
386
  // Convert mired value to kelvin for logging
@@ -444,6 +453,7 @@ export default class {
444
453
 
445
454
  // Update the cache values
446
455
  this.cacheMired = 0
456
+ this.accessory.context.cacheMired = 0
447
457
  this.cacheHue = h
448
458
  this.cacheSat = s
449
459
 
@@ -494,6 +504,7 @@ export default class {
494
504
 
495
505
  // Update the cache value after the adaptive lighting check
496
506
  this.cacheMired = value
507
+ this.accessory.context.cacheMired = value
497
508
  } catch (err) {
498
509
  this.accessory.logWarn(`${platformLang.cantUpd} ${parseError(err)}`)
499
510
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@homebridge-plugins/homebridge-wemo",
3
3
  "alias": "Wemo",
4
4
  "type": "module",
5
- "version": "7.7.4-beta.1",
5
+ "version": "7.7.4-beta.2",
6
6
  "description": "Homebridge plugin to integrate Wemo devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",