@homebridge-plugins/homebridge-wemo 7.7.2 → 7.7.4-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,19 @@
2
2
 
3
3
  All notable changes to `@homebridge-plugins/homebridge-wemo` will be documented in this file.
4
4
 
5
+ ## v7.7.4 (Pending Release)
6
+
7
+ ### Changed
8
+
9
+ - ci: update github actions to their latest versions (#288)
10
+ - fix: keep the decimals of a power reading, so 5.5w is no longer shown as 6w
11
+
12
+ ## v7.7.3 (2026-10-18)
13
+
14
+ ### Changed
15
+
16
+ - chore(deps): dependency updates
17
+
5
18
  ## v7.7.2 (2026-08-11)
6
19
 
7
20
  ### Changed
@@ -269,8 +269,8 @@ export default class {
269
269
 
270
270
  externalConsumptionUpdate(power) {
271
271
  try {
272
- // Divide by 1000 to get the power value in W
273
- const powerInWatts = Math.round(power / 1000)
272
+ // The device reports milliwatts, so keep two decimal places of watts
273
+ const powerInWatts = Math.round(power / 10) / 100
274
274
 
275
275
  // Check to see if the cache value is different
276
276
  if (powerInWatts === this.cachePowerInWatts) {
@@ -274,8 +274,8 @@ export default class {
274
274
 
275
275
  externalConsumptionUpdate(power) {
276
276
  try {
277
- // Divide by 1000 to get the power value in W
278
- const powerInWatts = Math.round(power / 1000)
277
+ // The device reports milliwatts, so keep two decimal places of watts
278
+ const powerInWatts = Math.round(power / 10) / 100
279
279
 
280
280
  // Check to see if the cache value is different
281
281
  if (powerInWatts === this.cachePowerInWatts) {
@@ -232,8 +232,8 @@ export default class {
232
232
 
233
233
  externalConsumptionUpdate(power) {
234
234
  try {
235
- // Divide by 1000 to get the power value in W
236
- const powerInWatts = Math.round(power / 1000)
235
+ // The device reports milliwatts, so keep two decimal places of watts
236
+ const powerInWatts = Math.round(power / 10) / 100
237
237
 
238
238
  // Check to see if the cache value is different
239
239
  if (powerInWatts === this.cachePowerInWatts) {
package/lib/platform.js CHANGED
@@ -14,7 +14,7 @@ import upnpClient from './connection/upnp.js'
14
14
  import deviceTypes from './device/index.js'
15
15
  import eveService from './fakegato/fakegato-history.js'
16
16
  import platformConsts from './utils/constants.js'
17
- import eveChars from './utils/eve-chars.js'
17
+ import eveChars, { currentConsumptionUUID } from './utils/eve-chars.js'
18
18
  import { parseError, parseSerialNumber, sameIpv4Subnet } from './utils/functions.js'
19
19
  import platformLang from './utils/lang-en.js'
20
20
 
@@ -1350,6 +1350,22 @@ export default class {
1350
1350
  }
1351
1351
 
1352
1352
  configureAccessory(accessory) {
1353
+ // A cached accessory comes back with the characteristic props it was saved
1354
+ // with, so a power reading made before it became decimal would stay whole
1355
+ // watts and keep rounding. Every restored accessory passes through here
1356
+ // before any device handler runs, so this one place covers all of them.
1357
+ // eveChar is not created until launch, hence the uuid on its own.
1358
+ if (this.api) {
1359
+ accessory.services.forEach((service) => {
1360
+ service.characteristics
1361
+ .filter(characteristic => characteristic.UUID === currentConsumptionUUID)
1362
+ .forEach(characteristic => characteristic.setProps({
1363
+ format: this.api.hap.Formats.FLOAT,
1364
+ minStep: 0.01,
1365
+ }))
1366
+ })
1367
+ }
1368
+
1353
1369
  // Add the configured accessory to our global map
1354
1370
  devicesInHB.set(accessory.UUID, accessory)
1355
1371
  }
@@ -1,7 +1,11 @@
1
+ // Exported on its own because the platform needs it for cached accessories,
2
+ // which Homebridge restores before the characteristics below are created
3
+ export const currentConsumptionUUID = 'E863F10D-079E-48FF-8F27-9C2605A29F52'
4
+
1
5
  export default class {
2
6
  constructor(api) {
3
7
  this.uuids = {
4
- currentConsumption: 'E863F10D-079E-48FF-8F27-9C2605A29F52',
8
+ currentConsumption: currentConsumptionUUID,
5
9
  totalConsumption: 'E863F10C-079E-48FF-8F27-9C2605A29F52',
6
10
  voltage: 'E863F10A-079E-48FF-8F27-9C2605A29F52',
7
11
  electricCurrent: 'E863F126-079E-48FF-8F27-9C2605A29F52',
@@ -17,12 +21,13 @@ export default class {
17
21
  this.CurrentConsumption = class extends api.hap.Characteristic {
18
22
  constructor() {
19
23
  super('Current Consumption', uuids.currentConsumption)
24
+ // decimal, like Eve's own plugs: whole watts read 5.5W as 6W
20
25
  this.setProps({
21
- format: api.hap.Formats.UINT16,
26
+ format: api.hap.Formats.FLOAT,
22
27
  unit: 'W',
23
28
  maxValue: 100000,
24
29
  minValue: 0,
25
- minStep: 1,
30
+ minStep: 0.01,
26
31
  perms: [api.hap.Perms.PAIRED_READ, api.hap.Perms.NOTIFY],
27
32
  })
28
33
  this.value = this.getDefaultValue()
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.2",
5
+ "version": "7.7.4-beta.0",
6
6
  "description": "Homebridge plugin to integrate Wemo devices into HomeKit.",
7
7
  "author": {
8
8
  "name": "bwp91",
@@ -60,16 +60,16 @@
60
60
  "changelog:sync": "node .github/scripts/sync-changelog.mjs"
61
61
  },
62
62
  "dependencies": {
63
- "@homebridge/plugin-ui-utils": "^2.2.5",
64
- "axios": "^1.19.0",
63
+ "@homebridge/plugin-ui-utils": "^2.2.6",
64
+ "axios": "^1.20.0",
65
65
  "node-ssdp": "^4.0.1",
66
- "p-queue": "^9.3.3",
66
+ "p-queue": "^10.0.0",
67
67
  "xml2js": "^0.6.2",
68
68
  "xmlbuilder": "^15.1.1"
69
69
  },
70
70
  "devDependencies": {
71
- "@antfu/eslint-config": "^9.3.0",
72
- "@vitest/coverage-v8": "^4.1.10",
73
- "vitest": "^4.1.10"
71
+ "@antfu/eslint-config": "^9.5.1",
72
+ "@vitest/coverage-v8": "^5.0.5",
73
+ "vitest": "^5.0.5"
74
74
  }
75
75
  }