homebridge-lib 5.6.8 → 5.7.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.
|
@@ -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 /
|
|
81
|
+
this._totalConsumption += Math.round(delta / 3600000.0) // kWh
|
|
82
82
|
}
|
|
83
83
|
this._power = value
|
|
84
84
|
this._time = 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('
|
|
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
|
+
"version": "5.7.0",
|
|
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.
|
|
25
|
-
"node": "^
|
|
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.
|
|
31
|
+
"semver": "^7.3.8"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"prepare": "standard && mocha && rm -rf out && jsdoc -c jsdoc.json",
|