homebridge-lib 5.6.8 → 5.7.1

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.
@@ -78,7 +78,7 @@ class Power extends History {
78
78
  if (this._time != null) {
79
79
  const delta = this._power * (now - this._time) // Ws
80
80
  this._runningConsumption += Math.round(delta / 600.0) // W * 10 min
81
- this._totalConsumption += Math.round(delta / 3600.0) // Wh
81
+ this._totalConsumption += Math.round(delta / 3600000.0) // kWh
82
82
  }
83
83
  this._power = value
84
84
  this._time = now
@@ -111,7 +111,7 @@ class Power extends History {
111
111
  if (this._time != null) {
112
112
  const delta = this._power * (now - this._time) // Ws
113
113
  this._runningConsumption += Math.round(delta / 600.0) // W * 10 min
114
- this._totalConsumption += Math.round(delta / 3600.0) // Wh
114
+ this._totalConsumption += Math.round(delta / 3600000.0) // kWh
115
115
  this._consumptionDelegate.value = this._totalConsumption
116
116
  this._entry.power = this._runningConsumption
117
117
  super._addEntry(now)
package/lib/SystemInfo.js CHANGED
@@ -98,7 +98,8 @@ const macOsInfo = {
98
98
  10.14: 'Mojave',
99
99
  10.15: 'Catalina',
100
100
  11: 'Big Sur',
101
- 12: 'Monterey'
101
+ 12: 'Monterey',
102
+ 13: 'Ventura'
102
103
  }
103
104
  }
104
105
 
@@ -340,20 +341,20 @@ class SystemInfo extends events.EventEmitter {
340
341
  const text = await this.exec('sw_vers')
341
342
  const lines = text.split('\n')
342
343
  for (const line of lines) {
343
- const fields = line.split(':\t')
344
+ const fields = line.split(':')
344
345
  if (fields.length === 2) {
345
346
  switch (fields[0]) {
346
347
  case 'ProductName': // e.g. 'macOS' or 'Mac OS X'
347
- name = fields[1]
348
+ name = fields[1].trim()
348
349
  break
349
350
  case 'ProductVersion': // e.g. '12.0.1' or '12.1'
350
- version = fields[1]
351
+ version = fields[1].trim()
351
352
  if (version.split('.').length === 2) {
352
353
  version += '.0'
353
354
  }
354
355
  break
355
356
  case 'BuildVersion': // e.g. '21A559'
356
- build = fields[1]
357
+ build = fields[1].trim()
357
358
  break
358
359
  default:
359
360
  break
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Library for homebridge plugins",
4
4
  "author": "Erik Baauw",
5
5
  "license": "Apache-2.0",
6
- "version": "5.6.8",
6
+ "version": "5.7.1",
7
7
  "keywords": [
8
8
  "homekit",
9
9
  "homebridge"
@@ -21,14 +21,14 @@
21
21
  "upnp": "cli/upnp.js"
22
22
  },
23
23
  "engines": {
24
- "homebridge": "^1.5.0",
25
- "node": "^16.17.1"
24
+ "homebridge": "^1.5.1",
25
+ "node": "^18.12.0"
26
26
  },
27
27
  "dependencies": {
28
28
  "@homebridge/plugin-ui-utils": "~0.0.19",
29
29
  "bonjour-hap": "^3.6.4",
30
30
  "chalk": "^4.1.2",
31
- "semver": "^7.3.7"
31
+ "semver": "^7.3.8"
32
32
  },
33
33
  "scripts": {
34
34
  "prepare": "standard && mocha && rm -rf out && jsdoc -c jsdoc.json",