homebridge-lib 5.1.23 → 5.1.24-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/lib/AccessoryDelegate.js +1 -2
- package/lib/HttpClient.js +4 -5
- package/lib/MyHomeKitTypes.js +37 -0
- package/lib/ServiceDelegate.js +2 -2
- package/package.json +1 -1
package/lib/AccessoryDelegate.js
CHANGED
|
@@ -103,8 +103,7 @@ class AccessoryDelegate extends homebridgeLib.Delegate {
|
|
|
103
103
|
|
|
104
104
|
// Remove associated accessory from platform
|
|
105
105
|
destroy () {
|
|
106
|
-
this.removeAllListeners(
|
|
107
|
-
this.removeAllListeners('shutdown')
|
|
106
|
+
this.removeAllListeners()
|
|
108
107
|
this._platform._removeAccessory(this._accessory)
|
|
109
108
|
}
|
|
110
109
|
|
package/lib/HttpClient.js
CHANGED
|
@@ -19,8 +19,7 @@ const https = require('https')
|
|
|
19
19
|
class HttpError extends Error {
|
|
20
20
|
constructor (message, request, statusCode, statusMessage) {
|
|
21
21
|
super(message)
|
|
22
|
-
/** @member {HttpRequest} - The request that caused the error.
|
|
23
|
-
* See {@link HttpClient.HttpRequest HttpRequest}.
|
|
22
|
+
/** @member {HttpClient.HttpRequest} - The request that caused the error.
|
|
24
23
|
*/
|
|
25
24
|
this.request = request
|
|
26
25
|
|
|
@@ -76,8 +75,7 @@ class HttpRequest {
|
|
|
76
75
|
*/
|
|
77
76
|
class HttpResponse {
|
|
78
77
|
constructor (request, statusCode, statusMessage, headers, body, parsedBody) {
|
|
79
|
-
/** @member {HttpRequest} - The request that generated the response.
|
|
80
|
-
* See {@link HttpClient.HttpRequest HttpRequest}.
|
|
78
|
+
/** @member {HttpClient.HttpRequest} - The request that generated the response.
|
|
81
79
|
*/
|
|
82
80
|
this.request = request
|
|
83
81
|
|
|
@@ -423,7 +421,8 @@ class HttpClient extends events.EventEmitter {
|
|
|
423
421
|
request: requestInfo,
|
|
424
422
|
headers: response.headers,
|
|
425
423
|
statusCode: response.statusCode,
|
|
426
|
-
statusMessage: response.statusMessage
|
|
424
|
+
statusMessage: response.statusMessage,
|
|
425
|
+
body: null
|
|
427
426
|
}
|
|
428
427
|
if (buffer != null && buffer.length > 0) {
|
|
429
428
|
responseInfo.body = buffer
|
package/lib/MyHomeKitTypes.js
CHANGED
|
@@ -83,6 +83,8 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
|
|
|
83
83
|
* <br>Used by: homebridge-hue.
|
|
84
84
|
* @property {Class} Enabled - Enable/disable service.
|
|
85
85
|
* <br>Used by: homebridge-hue.
|
|
86
|
+
* @property {Class} Expose - Expose to HomeKit.
|
|
87
|
+
* <br>Used by: homebridge-deconz.
|
|
86
88
|
* @property {Class} Heartrate - Refresh rate.
|
|
87
89
|
* <br>Used by: homebridge-hue in HueBridge service,
|
|
88
90
|
* by Homebridge-soma, by Homebridge-rpi, by Homebridge-ws.
|
|
@@ -191,6 +193,8 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
|
|
|
191
193
|
* for lights.
|
|
192
194
|
* @property {Class} Unlatch - Unlatch the door.
|
|
193
195
|
* <br>Used by: homebridge-nb in the Smart Lock service.
|
|
196
|
+
* @property {Class} Unlock - Unlock gateway
|
|
197
|
+
* <br>Used by: homebridge-deconz.
|
|
194
198
|
* @property {Class} WaterPressure - Water pressure (in bar) of the central
|
|
195
199
|
* heating system.
|
|
196
200
|
* <br>Used by: homebridge-otgw.
|
|
@@ -698,6 +702,18 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
|
|
|
698
702
|
perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE]
|
|
699
703
|
}, 'Position Change')
|
|
700
704
|
|
|
705
|
+
this.createCharacteristicClass('Unlock', uuid('077'), {
|
|
706
|
+
format: this.Formats.BOOL,
|
|
707
|
+
perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
|
|
708
|
+
adminOnlyAccess: [this.Access.WRITE]
|
|
709
|
+
})
|
|
710
|
+
|
|
711
|
+
this.createCharacteristicClass('Expose', uuid('078'), {
|
|
712
|
+
format: this.Formats.BOOL,
|
|
713
|
+
perms: [this.Perms.READ, this.Perms.NOTIFY, this.Perms.WRITE],
|
|
714
|
+
adminOnlyAccess: [this.Access.WRITE]
|
|
715
|
+
})
|
|
716
|
+
|
|
701
717
|
// Characteristic for Unique ID, used by homebridge-hue.
|
|
702
718
|
// Source: as exposed by the Philips Hue bridge. This characteristic is
|
|
703
719
|
// used by the Hue app to select the accessories when syncing Hue bridge
|
|
@@ -726,6 +742,11 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
|
|
|
726
742
|
/** @member MyHomeKitTypes#Services
|
|
727
743
|
* @property {Class} Alarm - Service for an alarm clock.
|
|
728
744
|
* <br>Used by: homebridge-zp.
|
|
745
|
+
* @property {Class} DeconzGateway - Service for deCONZ gateway config.
|
|
746
|
+
* <br>Used by homebridge-deconz.
|
|
747
|
+
* @property {Class} DeconzDevice - Service for config of device exposed
|
|
748
|
+
* by deCONZ gateway.
|
|
749
|
+
* <br>Used by homebridge-deconz.
|
|
729
750
|
* @property {Class} HueBridge - Service for a Hue bridge.
|
|
730
751
|
* <br>Used by: homebridge-hue for a Hue bridge or deCONZ gateway.
|
|
731
752
|
* @property {Class} Resource - Generic service for resource.
|
|
@@ -760,6 +781,22 @@ class MyHomeKitTypes extends homebridgeLib.CustomHomeKitTypes {
|
|
|
760
781
|
this.Characteristics.Status
|
|
761
782
|
])
|
|
762
783
|
|
|
784
|
+
this.createServiceClass('DeconzGateway', uuid('014'), [
|
|
785
|
+
this.Characteristics.LogLevel,
|
|
786
|
+
this.Characteristics.Expose,
|
|
787
|
+
this.Characteristics.Heartrate,
|
|
788
|
+
this.Characteristics.LastUpdated,
|
|
789
|
+
this.Characteristics.Restart,
|
|
790
|
+
this.Characteristics.Search,
|
|
791
|
+
this.Characteristics.TransitionTime,
|
|
792
|
+
this.Characteristics.Unlock
|
|
793
|
+
])
|
|
794
|
+
|
|
795
|
+
this.createServiceClass('DeconzDevice', uuid('015'), [
|
|
796
|
+
this.Characteristics.Expose,
|
|
797
|
+
this.Characteristics.Resource
|
|
798
|
+
])
|
|
799
|
+
|
|
763
800
|
this.createServiceClass('Alarm', uuid('048'), [
|
|
764
801
|
this.Characteristics.Enabled,
|
|
765
802
|
this.Characteristics.CurrentTrack,
|
package/lib/ServiceDelegate.js
CHANGED
|
@@ -401,14 +401,14 @@ class AccessoryInformation extends ServiceDelegate {
|
|
|
401
401
|
Characteristic: this.Characteristics.hap.FirmwareRevision,
|
|
402
402
|
value: params.firmware
|
|
403
403
|
})
|
|
404
|
-
if (params.hardware != null) {
|
|
404
|
+
if (params.hardware != null || this._context.hardware != null) {
|
|
405
405
|
this.addCharacteristicDelegate({
|
|
406
406
|
key: 'hardware',
|
|
407
407
|
Characteristic: this.Characteristics.hap.HardwareRevision,
|
|
408
408
|
value: params.hardware
|
|
409
409
|
})
|
|
410
410
|
}
|
|
411
|
-
if (params.software != null) {
|
|
411
|
+
if (params.software != null || this._context.software != null) {
|
|
412
412
|
this.addCharacteristicDelegate({
|
|
413
413
|
key: 'software',
|
|
414
414
|
Characteristic: this.Characteristics.hap.SoftwareRevision,
|