@homebridge-plugins/homebridge-ewelink 12.19.1-beta.0 → 12.19.1-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
@@ -8,6 +8,8 @@ All notable changes to `@homebridge-plugins/homebridge-ewelink` will be document
8
8
 
9
9
  - feat(fan): add an option to show ifan speed as a percentage, so siri's levels work (#551)
10
10
  - fix(api): send fan speeds on the fan's own scale, so medium no longer turns it off
11
+ - ci: update github actions to their latest versions (#809)
12
+ - fix: keep the decimals of a power reading, so 5.5w is no longer shown as 6w
11
13
 
12
14
  ## v12.19.0 (2026-10-18)
13
15
 
package/lib/platform.js CHANGED
@@ -14,7 +14,7 @@ import deviceTypes from './device/index.js'
14
14
  import eveService from './fakegato/fakegato-history.js'
15
15
  import platformConsts from './utils/constants.js'
16
16
  import platformChars from './utils/custom-chars.js'
17
- import eveChars from './utils/eve-chars.js'
17
+ import eveChars, { currentConsumptionUUID } from './utils/eve-chars.js'
18
18
  import { parseDeviceId, parseError } from './utils/functions.js'
19
19
  import platformLang from './utils/lang.js'
20
20
 
@@ -2071,6 +2071,22 @@ export default class {
2071
2071
  )
2072
2072
  }
2073
2073
 
2074
+ // A cached accessory comes back with the characteristic props it was saved
2075
+ // with, so a power reading made before it became decimal would stay whole
2076
+ // watts and keep rounding. Every restored accessory passes through here
2077
+ // before any device handler runs, so this one place covers all of them.
2078
+ // eveChar is not created until launch, hence the uuid on its own.
2079
+ if (this.api) {
2080
+ accessory.services.forEach((service) => {
2081
+ service.characteristics
2082
+ .filter(characteristic => characteristic.UUID === currentConsumptionUUID)
2083
+ .forEach(characteristic => characteristic.setProps({
2084
+ format: this.api.hap.Formats.FLOAT,
2085
+ minStep: 0.01,
2086
+ }))
2087
+ })
2088
+ }
2089
+
2074
2090
  // Add the configured accessory to our global map
2075
2091
  devicesInHB.set(accessory.UUID, accessory)
2076
2092
  }
@@ -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
@@ -3,7 +3,7 @@
3
3
  "displayName": "Homebridge eWeLink",
4
4
  "alias": "eWeLink",
5
5
  "type": "module",
6
- "version": "12.19.1-beta.0",
6
+ "version": "12.19.1-beta.2",
7
7
  "description": "Homebridge plugin to integrate eWeLink devices into HomeKit.",
8
8
  "author": {
9
9
  "name": "bwp91",