homebridge-lib 7.0.4 → 7.0.5
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.
|
@@ -48,29 +48,25 @@ class CustomHomeKitTypes {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/** Valid HomeKit admin-only access.
|
|
51
|
-
* <br>See {@link Characteristic.Access}.
|
|
52
51
|
* @type {Object<string, Characteristic.Access>}
|
|
53
52
|
* @readonly
|
|
54
53
|
*/
|
|
55
54
|
get Access () { return Object.freeze(Object.assign({}, hap.Access)) }
|
|
56
55
|
|
|
57
56
|
/** Valid HomeKit characteristic formats.
|
|
58
|
-
*
|
|
59
|
-
* @type {Object<string, Characteristic.Format>}
|
|
57
|
+
* @type {Object<string, Format>}
|
|
60
58
|
* @readonly
|
|
61
59
|
*/
|
|
62
60
|
get Formats () { return Object.freeze(Object.assign({}, hap.Formats)) }
|
|
63
61
|
|
|
64
62
|
/** Valid HomeKit characteristic permissions.
|
|
65
|
-
*
|
|
66
|
-
* @type {Object<string, Characteristic.Perm>}
|
|
63
|
+
* @type {Object<string, Perm>}
|
|
67
64
|
* @readonly
|
|
68
65
|
*/
|
|
69
66
|
get Perms () { return Object.freeze(Object.assign({}, hap.Perms)) }
|
|
70
67
|
|
|
71
68
|
/** Standard HomeKit characteristic units.
|
|
72
|
-
*
|
|
73
|
-
* @type {Object<string, Characteristic.Unit>}
|
|
69
|
+
* @type {Object<string, Unit>}
|
|
74
70
|
* @readonly
|
|
75
71
|
*/
|
|
76
72
|
get Units () { return Object.freeze(Object.assign({}, hap.Units)) }
|
|
@@ -90,7 +86,6 @@ class CustomHomeKitTypes {
|
|
|
90
86
|
get Services () { return this._Services }
|
|
91
87
|
|
|
92
88
|
/** @link Characteristic} subclasses for standard HomeKit characteristics.
|
|
93
|
-
* <br>See {@link module:hap-nodejs}.
|
|
94
89
|
* @type {Object<string, Class>}
|
|
95
90
|
* @readonly
|
|
96
91
|
*/
|
|
@@ -108,7 +103,6 @@ class CustomHomeKitTypes {
|
|
|
108
103
|
}
|
|
109
104
|
|
|
110
105
|
/** {@link Service} subclasses for custom HomeKit services.
|
|
111
|
-
* <br>See {@link module:hap-nodejs}.
|
|
112
106
|
* @type {Object<string, Class>}
|
|
113
107
|
* @readonly
|
|
114
108
|
*/
|
package/lib/Delegate.js
CHANGED
|
@@ -50,7 +50,6 @@ class Delegate extends EventEmitter {
|
|
|
50
50
|
* @type {object}
|
|
51
51
|
* @property {Object<string, Accessory.Category>} Categories -
|
|
52
52
|
* Valid HomeKit accessory categories.
|
|
53
|
-
* <br>See {@link Accessory.Categories}.
|
|
54
53
|
* @readonly
|
|
55
54
|
*/
|
|
56
55
|
get Accessory () { return this._platform.Accessory }
|
|
@@ -58,15 +57,12 @@ class Delegate extends EventEmitter {
|
|
|
58
57
|
/** HomeKit characteristic property values.
|
|
59
58
|
*
|
|
60
59
|
* @type {object}
|
|
61
|
-
* @property {Object<string,
|
|
60
|
+
* @property {Object<string, Format>} Formats -
|
|
62
61
|
* Valid HomeKit characteristic formats.
|
|
63
|
-
* <
|
|
64
|
-
* @property {Object<string, Characteristic.Perm>} Perms -
|
|
62
|
+
* @property {Object<string, Perm>} Perms -
|
|
65
63
|
* Valid HomeKit characteristic permissions.
|
|
66
|
-
* <
|
|
67
|
-
* @property {Object<string, Characteristic.Unit>} Units -
|
|
64
|
+
* @property {Object<string, Unit>} Units -
|
|
68
65
|
* Standard HomeKit characteristic units.
|
|
69
|
-
* <br>See {@link Characteristic.Units}.
|
|
70
66
|
* @readonly
|
|
71
67
|
*/
|
|
72
68
|
get Characteristic () { return this._platform.Characteristic }
|
|
@@ -78,7 +74,6 @@ class Delegate extends EventEmitter {
|
|
|
78
74
|
* <br>See {@link EveHomeKitTypes#Characteristics}.
|
|
79
75
|
* @property {Object<string, Class>} hap - Subclasses for standard HomeKit
|
|
80
76
|
* characteristic types.
|
|
81
|
-
* <br>See {@link module:hap-nodejs}
|
|
82
77
|
* @property {Object<string, Class>} my - Subclasses for my custom HomeKit
|
|
83
78
|
* characteristic typess.
|
|
84
79
|
* <br>See {@link MyHomeKitTypes#Characteristics}.
|
|
@@ -93,7 +88,6 @@ class Delegate extends EventEmitter {
|
|
|
93
88
|
* <br>See {@link EveHomeKitTypes#Services}.
|
|
94
89
|
* @property {Object<string, Class>} hap - Subclasses for standard HomeKit
|
|
95
90
|
* service types.
|
|
96
|
-
* <br>See {@link module:hap-nodejs}
|
|
97
91
|
* @property {Object<string, Class>} my - Subclasses for my custom HomeKit
|
|
98
92
|
* characteristic typess.
|
|
99
93
|
* <br>See {@link MyHomeKitTypes#Services}.
|
|
@@ -51,7 +51,7 @@ class Battery extends ServiceDelegate {
|
|
|
51
51
|
*/
|
|
52
52
|
constructor (accessoryDelegate, params = {}) {
|
|
53
53
|
params.name = accessoryDelegate.name + ' Battery'
|
|
54
|
-
params.Service = accessoryDelegate.Services.hap.
|
|
54
|
+
params.Service = accessoryDelegate.Services.hap.Battery
|
|
55
55
|
super(accessoryDelegate, params)
|
|
56
56
|
if (params.batteryLevel !== undefined) {
|
|
57
57
|
this.addCharacteristicDelegate({
|
package/lib/ServiceDelegate.js
CHANGED
|
@@ -73,7 +73,7 @@ class ServiceDelegate extends Delegate {
|
|
|
73
73
|
// Get or create associated Service.
|
|
74
74
|
this._service = params.subtype == null
|
|
75
75
|
? this._accessory.getService(params.Service)
|
|
76
|
-
: this._accessory.
|
|
76
|
+
: this._accessory.getServiceById(params.Service, params.subtype)
|
|
77
77
|
if (this._service == null) {
|
|
78
78
|
this._service = this._accessory.addService(
|
|
79
79
|
new params.Service(null, params.subtype)
|
package/package.json
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
"name": "homebridge-lib",
|
|
3
3
|
"description": "Library for homebridge plugins",
|
|
4
4
|
"author": "Erik Baauw",
|
|
5
|
+
"maintainers": [
|
|
6
|
+
"ebaauw"
|
|
7
|
+
],
|
|
5
8
|
"license": "Apache-2.0",
|
|
6
|
-
"version": "7.0.
|
|
9
|
+
"version": "7.0.5",
|
|
7
10
|
"keywords": [
|
|
8
11
|
"homekit",
|
|
9
12
|
"homebridge"
|
|
@@ -26,12 +29,12 @@
|
|
|
26
29
|
"upnp": "cli/upnp.js"
|
|
27
30
|
},
|
|
28
31
|
"engines": {
|
|
29
|
-
"homebridge": "^1.8.
|
|
30
|
-
"node": "20.
|
|
32
|
+
"homebridge": "^1.8.4||^2.0.0-beta",
|
|
33
|
+
"node": "20.16.0||^20||^18"
|
|
31
34
|
},
|
|
32
35
|
"dependencies": {
|
|
33
36
|
"@homebridge/plugin-ui-utils": "~1.0.3",
|
|
34
|
-
"hb-lib-tools": "~2.0.
|
|
37
|
+
"hb-lib-tools": "~2.0.4"
|
|
35
38
|
},
|
|
36
39
|
"scripts": {
|
|
37
40
|
"prepare": "standard && rm -rf out && jsdoc -c jsdoc.json",
|