homebridge-plugin-utils 1.5.0 → 1.6.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.
- package/build/eslint-rules.mjs +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mqttclient.d.ts +1 -2
- package/dist/rtp.d.ts +10 -3
- package/dist/rtp.js +1 -1
- package/dist/service.d.ts +31 -0
- package/dist/service.js +91 -0
- package/dist/service.js.map +1 -0
- package/dist/{utils.d.ts → util.d.ts} +0 -1
- package/dist/{utils.js → util.js} +2 -2
- package/dist/util.js.map +1 -0
- package/package.json +8 -7
- package/dist/utils.js.map +0 -1
package/build/eslint-rules.mjs
CHANGED
|
@@ -213,9 +213,10 @@ const commonRules = {
|
|
|
213
213
|
"eqeqeq": "warn",
|
|
214
214
|
"no-await-in-loop": "warn",
|
|
215
215
|
"no-console": "warn",
|
|
216
|
+
"no-restricted-syntax": ["warn", "TemplateLiteral"],
|
|
216
217
|
"prefer-arrow-callback": "warn",
|
|
217
218
|
"prefer-const": "warn",
|
|
218
|
-
"quotes": ["warn", "double", { "avoidEscape":
|
|
219
|
+
"quotes": ["warn", "double", { "allowTemplateLiterals": false, "avoidEscape": false }],
|
|
219
220
|
"sort-imports": "warn",
|
|
220
221
|
"sort-keys": "warn",
|
|
221
222
|
"sort-vars": "warn"
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/dist/mqttclient.d.ts
CHANGED
package/dist/rtp.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
1
|
import { EventEmitter } from "node:events";
|
|
4
|
-
import { HomebridgePluginLogging } from "./
|
|
2
|
+
import { HomebridgePluginLogging } from "./util.js";
|
|
3
|
+
/**
|
|
4
|
+
* Here's the problem this class solves: FFmpeg doesn't support multiplexing RTP and RTCP data on a single UDP port (RFC 5761). If it did, we wouldn't need this
|
|
5
|
+
* workaround for HomeKit compatibility, which does multiplex RTP and RTCP over a single UDP port.
|
|
6
|
+
*
|
|
7
|
+
* This class inspects all packets coming in from inputPort and demultiplexes RTP and RTCP traffic to rtpPort and rtcpPort, respectively.
|
|
8
|
+
*
|
|
9
|
+
* Credit to @dgreif and @brandawg93 who graciously shared their code as a starting point, and their collaboration in answering the questions needed to bring all this
|
|
10
|
+
* together. A special thank you to @Sunoo for the many hours of discussion and brainstorming on this and other topics.
|
|
11
|
+
*/
|
|
5
12
|
export declare class RtpDemuxer extends EventEmitter {
|
|
6
13
|
private heartbeatTimer;
|
|
7
14
|
private heartbeatMsg;
|
package/dist/rtp.js
CHANGED
|
@@ -8,7 +8,7 @@ import { EventEmitter, once } from "node:events";
|
|
|
8
8
|
import { createSocket } from "node:dgram";
|
|
9
9
|
// How often, in seconds, should we heartbeat FFmpeg in two-way audio sessions. This should be less than 5 seconds, which is FFmpeg's input timeout interval.
|
|
10
10
|
const TWOWAY_HEARTBEAT_INTERVAL = 3;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
12
|
* Here's the problem this class solves: FFmpeg doesn't support multiplexing RTP and RTCP data on a single UDP port (RFC 5761). If it did, we wouldn't need this
|
|
13
13
|
* workaround for HomeKit compatibility, which does multiplex RTP and RTCP over a single UDP port.
|
|
14
14
|
*
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HAP, PlatformAccessory, Service, WithUUID } from "homebridge";
|
|
2
|
+
/**
|
|
3
|
+
* Utility method that either creates a new service on an accessory, if needed, or returns an existing one. It optionally executes a callback to initialize a new
|
|
4
|
+
* instance of a service, if needed. Additionally, the various name characteristics of the service will be set to the specified name, optionally adding them as needed.
|
|
5
|
+
* @param hap - HAP instance associated with the Homebridge plugin.
|
|
6
|
+
* @param accessory - Homebridge accessory to check.
|
|
7
|
+
* @param serviceType - Service type that is being instantiated or retrieved.
|
|
8
|
+
* @param subtype - Service subtype, if needed.
|
|
9
|
+
* @param onServiceCreate - Callback to be used when a new service is created. It is not called when an existing service is found.
|
|
10
|
+
*
|
|
11
|
+
* @returns Returns the created or retrieved service, `null` otherwise.
|
|
12
|
+
*
|
|
13
|
+
* @remarks `onServiceCreate` is called with the newly created service as an argument to allow the caller to optionally configure it.
|
|
14
|
+
*
|
|
15
|
+
* @category Accessory
|
|
16
|
+
*/
|
|
17
|
+
export declare function acquireService(hap: HAP, accessory: PlatformAccessory, serviceType: WithUUID<typeof Service>, name: string, subtype?: string, onServiceCreate?: (svc: Service) => void): Service | null;
|
|
18
|
+
/**
|
|
19
|
+
* Validate whether a service should exist, removing it if needed.
|
|
20
|
+
* @param accessory - Homebridge accessory to check.
|
|
21
|
+
* @param serviceType - Service type that is being instantiated or retrieved.
|
|
22
|
+
* @param validate - Function to be used to test whether a service should exist or not.
|
|
23
|
+
* @param subtype - Service subtype, if needed.
|
|
24
|
+
*
|
|
25
|
+
* @returns Returns `true` if the service is valid, will remove the service and return `false` otherwise.
|
|
26
|
+
*
|
|
27
|
+
* @remarks `validate` is called with an argument of `true` if the service currently exists on the accessory and `false` otherwise.
|
|
28
|
+
*
|
|
29
|
+
* @category Accessory
|
|
30
|
+
*/
|
|
31
|
+
export declare function validService(accessory: PlatformAccessory, serviceType: WithUUID<typeof Service>, validate: (hasService: boolean) => boolean, subtype?: string): boolean;
|
package/dist/service.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility method that either creates a new service on an accessory, if needed, or returns an existing one. It optionally executes a callback to initialize a new
|
|
3
|
+
* instance of a service, if needed. Additionally, the various name characteristics of the service will be set to the specified name, optionally adding them as needed.
|
|
4
|
+
* @param hap - HAP instance associated with the Homebridge plugin.
|
|
5
|
+
* @param accessory - Homebridge accessory to check.
|
|
6
|
+
* @param serviceType - Service type that is being instantiated or retrieved.
|
|
7
|
+
* @param subtype - Service subtype, if needed.
|
|
8
|
+
* @param onServiceCreate - Callback to be used when a new service is created. It is not called when an existing service is found.
|
|
9
|
+
*
|
|
10
|
+
* @returns Returns the created or retrieved service, `null` otherwise.
|
|
11
|
+
*
|
|
12
|
+
* @remarks `onServiceCreate` is called with the newly created service as an argument to allow the caller to optionally configure it.
|
|
13
|
+
*
|
|
14
|
+
* @category Accessory
|
|
15
|
+
*/
|
|
16
|
+
export function acquireService(hap, accessory, serviceType, name, subtype, onServiceCreate) {
|
|
17
|
+
// Services that do not need the Name characteristic added as an optional characteristic.
|
|
18
|
+
const configuredNameRequiredServices = [hap.Service.InputSource, hap.Service.Television, hap.Service.WiFiRouter];
|
|
19
|
+
// Services that need the ConfiguredName characteristic added and maintained.
|
|
20
|
+
const configuredNameServices = [hap.Service.AccessoryInformation, hap.Service.ContactSensor, hap.Service.Lightbulb, hap.Service.MotionSensor,
|
|
21
|
+
hap.Service.OccupancySensor, hap.Service.SmartSpeaker, hap.Service.Switch, hap.Service.Valve];
|
|
22
|
+
// Services that do not need the Name characteristic added as an optional characteristic.
|
|
23
|
+
const nameRequiredServices = [hap.Service.AccessoryInformation, hap.Service.Assistant, hap.Service.InputSource];
|
|
24
|
+
// Services that need the Name characteristic maintained.
|
|
25
|
+
const nameServices = [hap.Service.AirPurifier, hap.Service.AirQualitySensor, hap.Service.Battery, hap.Service.CarbonDioxideSensor,
|
|
26
|
+
hap.Service.CarbonMonoxideSensor, hap.Service.ContactSensor, hap.Service.Door, hap.Service.Doorbell, hap.Service.Fan, hap.Service.Fanv2, hap.Service.Faucet,
|
|
27
|
+
hap.Service.FilterMaintenance, hap.Service.GarageDoorOpener, hap.Service.HeaterCooler, hap.Service.HumidifierDehumidifier, hap.Service.HumiditySensor,
|
|
28
|
+
hap.Service.IrrigationSystem, hap.Service.LeakSensor, hap.Service.Lightbulb, hap.Service.LightSensor, hap.Service.LockMechanism, hap.Service.MotionSensor,
|
|
29
|
+
hap.Service.OccupancySensor, hap.Service.Outlet, hap.Service.SecuritySystem, hap.Service.Slats, hap.Service.SmartSpeaker, hap.Service.SmokeSensor,
|
|
30
|
+
hap.Service.StatefulProgrammableSwitch, hap.Service.StatelessProgrammableSwitch, hap.Service.Switch, hap.Service.TargetControl, hap.Service.Television,
|
|
31
|
+
hap.Service.TemperatureSensor, hap.Service.Thermostat, hap.Service.Valve, hap.Service.Window, hap.Service.WindowCovering];
|
|
32
|
+
// Find the service, if it exists.
|
|
33
|
+
let service = subtype ? accessory.getServiceById(serviceType, subtype) : accessory.getService(serviceType);
|
|
34
|
+
// Add the service to the accessory, if needed.
|
|
35
|
+
if (!service) {
|
|
36
|
+
service = new serviceType(name, subtype);
|
|
37
|
+
if (!service) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
// Add the Configured Name characteristic if we don't already have it and it's available to us.
|
|
41
|
+
if (!configuredNameRequiredServices.includes(serviceType) && configuredNameServices.includes(serviceType) &&
|
|
42
|
+
!service.optionalCharacteristics.some(x => (x.UUID === hap.Characteristic.ConfiguredName.UUID))) {
|
|
43
|
+
service.addOptionalCharacteristic(hap.Characteristic.ConfiguredName);
|
|
44
|
+
}
|
|
45
|
+
// Add the Name characteristic if we don't already have it and it's available to us.
|
|
46
|
+
if (!nameRequiredServices.includes(serviceType) && nameServices.includes(serviceType) &&
|
|
47
|
+
!service.optionalCharacteristics.some(x => (x.UUID === hap.Characteristic.Name.UUID))) {
|
|
48
|
+
service.addOptionalCharacteristic(hap.Characteristic.Name);
|
|
49
|
+
}
|
|
50
|
+
accessory.addService(service);
|
|
51
|
+
if (onServiceCreate) {
|
|
52
|
+
onServiceCreate(service);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
// Update our name.
|
|
56
|
+
service.displayName = name;
|
|
57
|
+
if (configuredNameServices.includes(serviceType)) {
|
|
58
|
+
service.updateCharacteristic(hap.Characteristic.ConfiguredName, name);
|
|
59
|
+
}
|
|
60
|
+
if (nameServices.includes(serviceType)) {
|
|
61
|
+
service.updateCharacteristic(hap.Characteristic.Name, name);
|
|
62
|
+
}
|
|
63
|
+
return service;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Validate whether a service should exist, removing it if needed.
|
|
67
|
+
* @param accessory - Homebridge accessory to check.
|
|
68
|
+
* @param serviceType - Service type that is being instantiated or retrieved.
|
|
69
|
+
* @param validate - Function to be used to test whether a service should exist or not.
|
|
70
|
+
* @param subtype - Service subtype, if needed.
|
|
71
|
+
*
|
|
72
|
+
* @returns Returns `true` if the service is valid, will remove the service and return `false` otherwise.
|
|
73
|
+
*
|
|
74
|
+
* @remarks `validate` is called with an argument of `true` if the service currently exists on the accessory and `false` otherwise.
|
|
75
|
+
*
|
|
76
|
+
* @category Accessory
|
|
77
|
+
*/
|
|
78
|
+
export function validService(accessory, serviceType, validate, subtype) {
|
|
79
|
+
// Find the switch service, if it exists.
|
|
80
|
+
const service = subtype ? accessory.getServiceById(serviceType, subtype) : accessory.getService(serviceType);
|
|
81
|
+
// Validate whether we should have the service. If not, remove it.
|
|
82
|
+
if (!validate(!!service)) {
|
|
83
|
+
if (service) {
|
|
84
|
+
accessory.removeService(service);
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
// We have a valid service.
|
|
89
|
+
return true;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,cAAc,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;IAED,IAAG,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QAEtC,OAAO,CAAC,oBAAoB,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,YAAY,CAAC,SAA4B,EAAE,WAAqC,EAAE,QAA0C,EAAE,OAAgB;IAE5J,yCAAyC;IACzC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAE7G,kEAAkE;IAClE,IAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAExB,IAAG,OAAO,EAAE,CAAC;YAEX,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED,2BAA2B;IAC3B,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* Copyright(C) 2017-2024, HJD (https://github.com/hjdhjd). All rights reserved.
|
|
2
2
|
*
|
|
3
|
-
*
|
|
3
|
+
* util.ts: Useful utility functions when writing TypeScript.
|
|
4
4
|
*/
|
|
5
5
|
// Retry an operation until we're successful.
|
|
6
6
|
export async function retry(operation, retryInterval, totalRetries) {
|
|
@@ -25,4 +25,4 @@ export async function runWithTimeout(promise, timeout) {
|
|
|
25
25
|
export async function sleep(sleepTimer) {
|
|
26
26
|
return new Promise(resolve => setTimeout(resolve, sleepTimer));
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAqCH,6CAA6C;AAC7C,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,SAAiC,EAAE,aAAqB,EAAE,YAAqB;IAEzG,IAAG,CAAC,YAAY,KAAK,SAAS,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,CAAC,EAAE,CAAC;QAEtD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,wCAAwC;IACxC,IAAG,CAAC,CAAC,MAAM,SAAS,EAAE,CAAC,EAAE,CAAC;QAExB,4FAA4F;QAC5F,MAAM,KAAK,CAAC,aAAa,CAAC,CAAC;QAE3B,OAAO,KAAK,CAAC,SAAS,EAAE,aAAa,EAAE,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,mCAAmC;IACnC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,uDAAuD;AACvD,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,OAAmB,EAAE,OAAe;IAE1E,MAAM,cAAc,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;IAEhG,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;AACjD,CAAC;AAED,4BAA4B;AAC5B,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,UAAkB;IAE5C,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;AACjE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-plugin-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"displayName": "Homebridge Plugin Utilities",
|
|
5
5
|
"description": "Opinionated utilities to provide common capabilities and create rich configuration webUI experiences for Homebridge plugins.",
|
|
6
6
|
"author": {
|
|
@@ -33,20 +33,21 @@
|
|
|
33
33
|
"build": "npm run clean && tsc && shx cp dist/featureoptions.js{,.map} dist/ui",
|
|
34
34
|
"build-ui": "shx mkdir -p dist/ui && shx cp ui/**.mjs dist/ui",
|
|
35
35
|
"clean": "shx rm -rf dist && npm run build-ui",
|
|
36
|
-
"lint": "eslint eslint.config.mjs build/**.mjs src/**.ts \"ui/**/*.@(js|mjs)\"",
|
|
36
|
+
"lint": "eslint --max-warnings=${ESLINT_MAX_WARNINGS:-\"-1\"} eslint.config.mjs build/**.mjs src/**.ts \"ui/**/*.@(js|mjs)\"",
|
|
37
37
|
"postpublish": "npm run clean",
|
|
38
38
|
"prepublishOnly": "npm run lint && npm run build"
|
|
39
39
|
},
|
|
40
40
|
"main": "dist/index.js",
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@stylistic/eslint-plugin": "2.
|
|
43
|
-
"@types/node": "20.14.
|
|
42
|
+
"@stylistic/eslint-plugin": "2.3.0",
|
|
43
|
+
"@types/node": "20.14.11",
|
|
44
44
|
"eslint": "8.57.0",
|
|
45
|
+
"homebridge": "^1.8.4",
|
|
45
46
|
"shx": "^0.3.4",
|
|
46
|
-
"typescript": "5.
|
|
47
|
-
"typescript-eslint": "^7.
|
|
47
|
+
"typescript": "5.5.3",
|
|
48
|
+
"typescript-eslint": "^7.16.1"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
|
-
"mqtt": "^5.
|
|
51
|
+
"mqtt": "^5.8.1"
|
|
51
52
|
}
|
|
52
53
|
}
|
package/dist/utils.js.map
DELETED
|
@@ -1 +0,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