homebridge-plugin-utils 1.16.0 → 1.18.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/dist/ffmpeg/record.d.ts +13 -6
- package/dist/ffmpeg/record.js +22 -14
- package/dist/ffmpeg/record.js.map +1 -1
- package/dist/service.d.ts +54 -16
- package/dist/service.js +55 -17
- package/dist/service.js.map +1 -1
- package/package.json +4 -4
package/dist/ffmpeg/record.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { FfmpegProcess } from "./process.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for configuring an fMP4 recording or livestream session.
|
|
7
7
|
*
|
|
8
|
+
* @property codec - The codec for the input video stream. Valid values are `h264` and `hevc`. Defaults to `h264`.
|
|
8
9
|
* @property fps - The video frames per second for the session.
|
|
9
10
|
* @property livestream - Indicates if this is a livestream session (`true`) or a recording (`false`).
|
|
10
11
|
* @property probesize - Number of bytes to analyze for stream information.
|
|
@@ -12,6 +13,7 @@ import { FfmpegProcess } from "./process.js";
|
|
|
12
13
|
* @property url - Source URL for livestreaming (RTSP).
|
|
13
14
|
*/
|
|
14
15
|
interface Fmp4OptionsConfig {
|
|
16
|
+
codec: string;
|
|
15
17
|
fps: number;
|
|
16
18
|
livestream: boolean;
|
|
17
19
|
probesize: number;
|
|
@@ -62,7 +64,8 @@ declare class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
62
64
|
* @param ffmpegOptions - FFmpeg configuration options.
|
|
63
65
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
64
66
|
* @param isAudioActive - If `true`, enables audio stream processing.
|
|
65
|
-
* @param fmp4Options -
|
|
67
|
+
* @param fmp4Options - Configuration for the fMP4 session (fps, type, url, etc.).
|
|
68
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
66
69
|
*
|
|
67
70
|
* @example
|
|
68
71
|
*
|
|
@@ -70,7 +73,7 @@ declare class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
70
73
|
* const process = new FfmpegFmp4Process(ffmpegOptions, recordingConfig, true, { fps: 30 });
|
|
71
74
|
* ```
|
|
72
75
|
*/
|
|
73
|
-
constructor(ffmpegOptions: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, isAudioActive: boolean, fmp4Options?: Partial<Fmp4OptionsConfig
|
|
76
|
+
constructor(ffmpegOptions: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, isAudioActive: boolean, fmp4Options?: Partial<Fmp4OptionsConfig>, isVerbose?: boolean);
|
|
74
77
|
/**
|
|
75
78
|
* Prepares and configures the FFmpeg process for reading and parsing output fMP4 data.
|
|
76
79
|
*
|
|
@@ -181,11 +184,13 @@ export declare class FfmpegRecordingProcess extends FfmpegFmp4Process {
|
|
|
181
184
|
* @param options - FFmpeg configuration options.
|
|
182
185
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
183
186
|
* @param fps - Video frames per second.
|
|
184
|
-
* @param
|
|
187
|
+
* @param processAudio - If `true`, enables audio stream processing.
|
|
185
188
|
* @param probesize - Stream analysis size, in bytes.
|
|
186
189
|
* @param timeshift - Timeshift offset for event-based recording, in milliseconds.
|
|
190
|
+
* @param codec - Codec for the video stream input. Valid values are: `h264` and `hevc`. Defaults to `h264`.
|
|
191
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
187
192
|
*/
|
|
188
|
-
constructor(options: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, fps: number,
|
|
193
|
+
constructor(options: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, fps: number, processAudio: boolean, probesize: number, timeshift: number, codec?: string, isVerbose?: boolean);
|
|
189
194
|
}
|
|
190
195
|
/**
|
|
191
196
|
* Manages a HomeKit livestream FFmpeg process for generating fMP4 segments.
|
|
@@ -211,9 +216,11 @@ export declare class FfmpegLivestreamProcess extends FfmpegFmp4Process {
|
|
|
211
216
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
212
217
|
* @param url - Source RTSP or livestream URL.
|
|
213
218
|
* @param fps - Video frames per second.
|
|
214
|
-
* @param
|
|
219
|
+
* @param processAudio - If `true`, enables audio stream processing. Defaults to `true`.
|
|
220
|
+
* @param codec - Codec for the video stream input. Valid values are: `h264` and `hevc`. Defaults to `h264`.
|
|
221
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
215
222
|
*/
|
|
216
|
-
constructor(options: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, url: string, fps: number,
|
|
223
|
+
constructor(options: FfmpegOptions, recordingConfig: CameraRecordingConfiguration, url: string, fps: number, processAudio?: boolean, codec?: string, isVerbose?: boolean);
|
|
217
224
|
/**
|
|
218
225
|
* Gets the fMP4 initialization segment generated by FFmpeg for the livestream.
|
|
219
226
|
*
|
package/dist/ffmpeg/record.js
CHANGED
|
@@ -69,7 +69,8 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
69
69
|
* @param ffmpegOptions - FFmpeg configuration options.
|
|
70
70
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
71
71
|
* @param isAudioActive - If `true`, enables audio stream processing.
|
|
72
|
-
* @param fmp4Options -
|
|
72
|
+
* @param fmp4Options - Configuration for the fMP4 session (fps, type, url, etc.).
|
|
73
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
73
74
|
*
|
|
74
75
|
* @example
|
|
75
76
|
*
|
|
@@ -77,7 +78,7 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
77
78
|
* const process = new FfmpegFmp4Process(ffmpegOptions, recordingConfig, true, { fps: 30 });
|
|
78
79
|
* ```
|
|
79
80
|
*/
|
|
80
|
-
constructor(ffmpegOptions, recordingConfig, isAudioActive, fmp4Options = {}) {
|
|
81
|
+
constructor(ffmpegOptions, recordingConfig, isAudioActive, fmp4Options = {}, isVerbose = false) {
|
|
81
82
|
// Initialize our parent.
|
|
82
83
|
super(ffmpegOptions);
|
|
83
84
|
// We want to log errors when they occur.
|
|
@@ -89,6 +90,7 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
89
90
|
// Initialize our state.
|
|
90
91
|
this.isLivestream = fmp4Options.livestream ?? false;
|
|
91
92
|
this.isTimedOut = false;
|
|
93
|
+
fmp4Options.codec ??= "h264";
|
|
92
94
|
fmp4Options.fps ??= 30;
|
|
93
95
|
fmp4Options.url ??= "";
|
|
94
96
|
// Save our recording configuration.
|
|
@@ -107,8 +109,9 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
107
109
|
this.commandLineArgs = [
|
|
108
110
|
"-hide_banner",
|
|
109
111
|
"-nostats",
|
|
110
|
-
"-fflags", "+discardcorrupt
|
|
111
|
-
"-err_detect", "ignore_err"
|
|
112
|
+
"-fflags", "+discardcorrupt",
|
|
113
|
+
"-err_detect", "ignore_err",
|
|
114
|
+
...this.options.videoDecoder(fmp4Options.codec)
|
|
112
115
|
];
|
|
113
116
|
if (this.isLivestream) {
|
|
114
117
|
this.commandLineArgs.push("-avioflags", "direct", "-rtsp_transport", "tcp", "-i", fmp4Options.url);
|
|
@@ -133,10 +136,11 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
133
136
|
if (this.isLivestream) {
|
|
134
137
|
this.commandLineArgs.push("-frag_duration", "1000000");
|
|
135
138
|
}
|
|
136
|
-
// -movflags flags In the generated fMP4 stream:
|
|
139
|
+
// -movflags flags In the generated fMP4 stream: set the default-base-is-moof flag in the header, write an initial empty MOOV box, start a new fragment
|
|
140
|
+
// at each keyframe, skip creating a segment index (SIDX) box in fragments, and skip writing the final MOOV trailer since it's unneeded.
|
|
137
141
|
// -reset_timestamps Reset timestamps at the beginning of each segment.
|
|
138
142
|
// -metadata Set the metadata to the name of the camera to distinguish between FFmpeg sessions.
|
|
139
|
-
this.commandLineArgs.push("-movflags", "
|
|
143
|
+
this.commandLineArgs.push("-movflags", "default_base_moof+empty_moov+frag_keyframe+skip_sidx+skip_trailer", "-reset_timestamps", "1", "-metadata", "comment=" + this.options.name() + " " + (this.isLivestream ? "Livestream Buffer" : "HKSV Event"));
|
|
140
144
|
if (isAudioActive) {
|
|
141
145
|
// Configure the audio portion of the command line. Options we use are:
|
|
142
146
|
//
|
|
@@ -148,9 +152,9 @@ class FfmpegFmp4Process extends FfmpegProcess {
|
|
|
148
152
|
//
|
|
149
153
|
// -f mp4 Tell ffmpeg that it should create an MP4-encoded output stream.
|
|
150
154
|
// pipe:1 Output the stream to standard output.
|
|
151
|
-
this.commandLineArgs.push("-f", "mp4", "pipe:1");
|
|
155
|
+
this.commandLineArgs.push("-f", "mp4", "-avioflags", "direct", "pipe:1");
|
|
152
156
|
// Additional logging, but only if we're debugging.
|
|
153
|
-
if (
|
|
157
|
+
if (isVerbose || this.isVerbose) {
|
|
154
158
|
this.commandLineArgs.unshift("-loglevel", "level+verbose");
|
|
155
159
|
}
|
|
156
160
|
}
|
|
@@ -449,12 +453,14 @@ export class FfmpegRecordingProcess extends FfmpegFmp4Process {
|
|
|
449
453
|
* @param options - FFmpeg configuration options.
|
|
450
454
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
451
455
|
* @param fps - Video frames per second.
|
|
452
|
-
* @param
|
|
456
|
+
* @param processAudio - If `true`, enables audio stream processing.
|
|
453
457
|
* @param probesize - Stream analysis size, in bytes.
|
|
454
458
|
* @param timeshift - Timeshift offset for event-based recording, in milliseconds.
|
|
459
|
+
* @param codec - Codec for the video stream input. Valid values are: `h264` and `hevc`. Defaults to `h264`.
|
|
460
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
455
461
|
*/
|
|
456
|
-
constructor(options, recordingConfig, fps,
|
|
457
|
-
super(options, recordingConfig,
|
|
462
|
+
constructor(options, recordingConfig, fps, processAudio, probesize, timeshift, codec = "h264", isVerbose = false) {
|
|
463
|
+
super(options, recordingConfig, processAudio, { codec: codec, fps: fps, probesize: probesize, timeshift: timeshift }, isVerbose);
|
|
458
464
|
}
|
|
459
465
|
}
|
|
460
466
|
/**
|
|
@@ -481,10 +487,12 @@ export class FfmpegLivestreamProcess extends FfmpegFmp4Process {
|
|
|
481
487
|
* @param recordingConfig - HomeKit recording configuration for the session.
|
|
482
488
|
* @param url - Source RTSP or livestream URL.
|
|
483
489
|
* @param fps - Video frames per second.
|
|
484
|
-
* @param
|
|
490
|
+
* @param processAudio - If `true`, enables audio stream processing. Defaults to `true`.
|
|
491
|
+
* @param codec - Codec for the video stream input. Valid values are: `h264` and `hevc`. Defaults to `h264`.
|
|
492
|
+
* @param isVerbose - If `true`, enables more verbose logging for debugging purposes. Defaults to `false`.
|
|
485
493
|
*/
|
|
486
|
-
constructor(options, recordingConfig, url, fps,
|
|
487
|
-
super(options, recordingConfig,
|
|
494
|
+
constructor(options, recordingConfig, url, fps, processAudio = true, codec = "h264", isVerbose = false) {
|
|
495
|
+
super(options, recordingConfig, processAudio, { codec: codec, fps: fps, livestream: true, url: url }, isVerbose);
|
|
488
496
|
}
|
|
489
497
|
/**
|
|
490
498
|
* Gets the fMP4 initialization segment generated by FFmpeg for the livestream.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/ffmpeg/record.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAiB,cAAc,EAAE,MAAM,YAAY,CAAC;AAG3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../src/ffmpeg/record.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,iBAAi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OAAO,KAAK,CAAC,cAAc,EAAE,CAAC;IAChC,CAAC;CACF"}
|
package/dist/service.d.ts
CHANGED
|
@@ -6,35 +6,73 @@
|
|
|
6
6
|
import type { HAP, PlatformAccessory, Service, WithUUID } from "homebridge";
|
|
7
7
|
import { type Nullable } from "./util.js";
|
|
8
8
|
/**
|
|
9
|
-
* Utility method that either creates a new service on an accessory
|
|
10
|
-
*
|
|
9
|
+
* Utility method that either creates a new service on an accessory if needed, or returns an existing one. Optionally, it executes a callback to initialize a new
|
|
10
|
+
* service instance. Additionally, the various name characteristics of the service are set to the specified name, and optionally added if necessary.
|
|
11
11
|
*
|
|
12
12
|
* @param hap - HAP instance associated with the Homebridge plugin.
|
|
13
|
-
* @param accessory - Homebridge accessory to check.
|
|
14
|
-
* @param serviceType -
|
|
13
|
+
* @param accessory - The Homebridge accessory to check or modify.
|
|
14
|
+
* @param serviceType - The type of service to instantiate or retrieve.
|
|
15
15
|
* @param name - Name to be displayed to the end user for this service.
|
|
16
|
-
* @param subtype -
|
|
17
|
-
* @param onServiceCreate -
|
|
16
|
+
* @param subtype - Optional service subtype to uniquely identify the service.
|
|
17
|
+
* @param onServiceCreate - Optional callback invoked only when a new service is created, receiving the new service as its argument.
|
|
18
18
|
*
|
|
19
|
-
* @returns Returns the created or retrieved service, `null`
|
|
19
|
+
* @returns Returns the created or retrieved service, or `null` if service creation failed.
|
|
20
20
|
*
|
|
21
|
-
* @remarks
|
|
21
|
+
* @remarks
|
|
22
|
+
* This method ensures that the service's display name and available name characteristics are updated to the specified name. If `onServiceCreate` is provided,
|
|
23
|
+
* it will only be called for newly created services, not for existing ones.
|
|
24
|
+
*
|
|
25
|
+
* The `ConfiguredName` and `Name` characteristics are conditionally added or updated based on the type of service, in accordance with HomeKit requirements.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* // Example: Ensure a Lightbulb service exists with a user-friendly name, and initialize it if newly created.
|
|
30
|
+
* const lightbulbService = acquireService(hap, accessory, hap.Service.Lightbulb, "Living Room Lamp", undefined, (svc: Service): void => {
|
|
31
|
+
*
|
|
32
|
+
* // Called only if the service is newly created.
|
|
33
|
+
* svc.setCharacteristic(hap.Characteristic.On, false);
|
|
34
|
+
* });
|
|
35
|
+
*
|
|
36
|
+
* if(lightbulbService) {
|
|
37
|
+
*
|
|
38
|
+
* // Service is now available, with display name set and optional characteristics managed.
|
|
39
|
+
* lightbulbService.updateCharacteristic(hap.Characteristic.Brightness, 75);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
22
42
|
*
|
|
23
43
|
* @category Accessory
|
|
24
44
|
*/
|
|
25
45
|
export declare function acquireService(hap: HAP, accessory: PlatformAccessory, serviceType: WithUUID<typeof Service>, name: string, subtype?: string, onServiceCreate?: (svc: Service) => void): Nullable<Service>;
|
|
26
46
|
/**
|
|
27
|
-
*
|
|
47
|
+
* Validates whether a specific service should exist on the given accessory, removing the service if it fails validation.
|
|
48
|
+
*
|
|
49
|
+
* @param accessory - The Homebridge accessory to inspect and potentially modify.
|
|
50
|
+
* @param serviceType - The type of Homebridge service being checked or instantiated.
|
|
51
|
+
* @param validate - A boolean or a function that determines if the service should exist. If a function is provided, it receives a boolean indicating whether the
|
|
52
|
+
* service currently exists, and should return `true` to keep the service, or `false` to remove it.
|
|
53
|
+
* @param subtype - Optional service subtype to uniquely identify the service.
|
|
54
|
+
*
|
|
55
|
+
* @returns `true` if the service is valid (and kept), or `false` if it was removed.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* The `validate` parameter can be either:
|
|
59
|
+
* - a boolean (where `true` means keep the service, `false` means remove it).
|
|
60
|
+
* - a function (which is called with `hasService: boolean` and returns whether to keep the service).
|
|
61
|
+
*
|
|
62
|
+
* If the service should not exist according to `validate`, and it is currently present, this function will remove it from the accessory.
|
|
28
63
|
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* // Remove a service if it exists
|
|
67
|
+
* validService(accessory, Service.Switch, false);
|
|
33
68
|
*
|
|
34
|
-
*
|
|
69
|
+
* // Only keep a service if a configuration flag is true
|
|
70
|
+
* validService(accessory, Service.Switch, config.enableSwitch);
|
|
35
71
|
*
|
|
36
|
-
*
|
|
72
|
+
* // Keep a service if it currently exists, or add it if a certain condition is met
|
|
73
|
+
* validService(accessory, Service.Switch, (hasService) => hasService || config.enableSwitch);
|
|
74
|
+
* ```
|
|
37
75
|
*
|
|
38
76
|
* @category Accessory
|
|
39
77
|
*/
|
|
40
|
-
export declare function validService(accessory: PlatformAccessory, serviceType: WithUUID<typeof Service>, validate: (hasService: boolean) => boolean, subtype?: string): boolean;
|
|
78
|
+
export declare function validService(accessory: PlatformAccessory, serviceType: WithUUID<typeof Service>, validate: boolean | ((hasService: boolean) => boolean), subtype?: string): boolean;
|
package/dist/service.js
CHANGED
|
@@ -4,19 +4,39 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { validateName } from "./util.js";
|
|
6
6
|
/**
|
|
7
|
-
* Utility method that either creates a new service on an accessory
|
|
8
|
-
*
|
|
7
|
+
* Utility method that either creates a new service on an accessory if needed, or returns an existing one. Optionally, it executes a callback to initialize a new
|
|
8
|
+
* service instance. Additionally, the various name characteristics of the service are set to the specified name, and optionally added if necessary.
|
|
9
9
|
*
|
|
10
10
|
* @param hap - HAP instance associated with the Homebridge plugin.
|
|
11
|
-
* @param accessory - Homebridge accessory to check.
|
|
12
|
-
* @param serviceType -
|
|
11
|
+
* @param accessory - The Homebridge accessory to check or modify.
|
|
12
|
+
* @param serviceType - The type of service to instantiate or retrieve.
|
|
13
13
|
* @param name - Name to be displayed to the end user for this service.
|
|
14
|
-
* @param subtype -
|
|
15
|
-
* @param onServiceCreate -
|
|
14
|
+
* @param subtype - Optional service subtype to uniquely identify the service.
|
|
15
|
+
* @param onServiceCreate - Optional callback invoked only when a new service is created, receiving the new service as its argument.
|
|
16
16
|
*
|
|
17
|
-
* @returns Returns the created or retrieved service, `null`
|
|
17
|
+
* @returns Returns the created or retrieved service, or `null` if service creation failed.
|
|
18
18
|
*
|
|
19
|
-
* @remarks
|
|
19
|
+
* @remarks
|
|
20
|
+
* This method ensures that the service's display name and available name characteristics are updated to the specified name. If `onServiceCreate` is provided,
|
|
21
|
+
* it will only be called for newly created services, not for existing ones.
|
|
22
|
+
*
|
|
23
|
+
* The `ConfiguredName` and `Name` characteristics are conditionally added or updated based on the type of service, in accordance with HomeKit requirements.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // Example: Ensure a Lightbulb service exists with a user-friendly name, and initialize it if newly created.
|
|
28
|
+
* const lightbulbService = acquireService(hap, accessory, hap.Service.Lightbulb, "Living Room Lamp", undefined, (svc: Service): void => {
|
|
29
|
+
*
|
|
30
|
+
* // Called only if the service is newly created.
|
|
31
|
+
* svc.setCharacteristic(hap.Characteristic.On, false);
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* if(lightbulbService) {
|
|
35
|
+
*
|
|
36
|
+
* // Service is now available, with display name set and optional characteristics managed.
|
|
37
|
+
* lightbulbService.updateCharacteristic(hap.Characteristic.Brightness, 75);
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
20
40
|
*
|
|
21
41
|
* @category Accessory
|
|
22
42
|
*/
|
|
@@ -72,24 +92,42 @@ export function acquireService(hap, accessory, serviceType, name, subtype, onSer
|
|
|
72
92
|
return service;
|
|
73
93
|
}
|
|
74
94
|
/**
|
|
75
|
-
*
|
|
95
|
+
* Validates whether a specific service should exist on the given accessory, removing the service if it fails validation.
|
|
76
96
|
*
|
|
77
|
-
* @param accessory
|
|
78
|
-
* @param serviceType
|
|
79
|
-
* @param validate
|
|
80
|
-
*
|
|
97
|
+
* @param accessory - The Homebridge accessory to inspect and potentially modify.
|
|
98
|
+
* @param serviceType - The type of Homebridge service being checked or instantiated.
|
|
99
|
+
* @param validate - A boolean or a function that determines if the service should exist. If a function is provided, it receives a boolean indicating whether the
|
|
100
|
+
* service currently exists, and should return `true` to keep the service, or `false` to remove it.
|
|
101
|
+
* @param subtype - Optional service subtype to uniquely identify the service.
|
|
81
102
|
*
|
|
82
|
-
* @returns
|
|
103
|
+
* @returns `true` if the service is valid (and kept), or `false` if it was removed.
|
|
83
104
|
*
|
|
84
|
-
* @remarks
|
|
105
|
+
* @remarks
|
|
106
|
+
* The `validate` parameter can be either:
|
|
107
|
+
* - a boolean (where `true` means keep the service, `false` means remove it).
|
|
108
|
+
* - a function (which is called with `hasService: boolean` and returns whether to keep the service).
|
|
109
|
+
*
|
|
110
|
+
* If the service should not exist according to `validate`, and it is currently present, this function will remove it from the accessory.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```typescript
|
|
114
|
+
* // Remove a service if it exists
|
|
115
|
+
* validService(accessory, Service.Switch, false);
|
|
116
|
+
*
|
|
117
|
+
* // Only keep a service if a configuration flag is true
|
|
118
|
+
* validService(accessory, Service.Switch, config.enableSwitch);
|
|
119
|
+
*
|
|
120
|
+
* // Keep a service if it currently exists, or add it if a certain condition is met
|
|
121
|
+
* validService(accessory, Service.Switch, (hasService) => hasService || config.enableSwitch);
|
|
122
|
+
* ```
|
|
85
123
|
*
|
|
86
124
|
* @category Accessory
|
|
87
125
|
*/
|
|
88
126
|
export function validService(accessory, serviceType, validate, subtype) {
|
|
89
|
-
// Find the
|
|
127
|
+
// Find the service, if it exists.
|
|
90
128
|
const service = subtype ? accessory.getServiceById(serviceType, subtype) : accessory.getService(serviceType);
|
|
91
129
|
// Validate whether we should have the service. If not, remove it.
|
|
92
|
-
if (!validate(!!service)) {
|
|
130
|
+
if (!((typeof validate === "function") ? validate(!!service) : validate)) {
|
|
93
131
|
if (service) {
|
|
94
132
|
accessory.removeService(service);
|
|
95
133
|
}
|
package/dist/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot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1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge-plugin-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
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": {
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"main": "dist/index.js",
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@stylistic/eslint-plugin": "4.
|
|
44
|
-
"@types/node": "22.15.
|
|
43
|
+
"@stylistic/eslint-plugin": "4.4.0",
|
|
44
|
+
"@types/node": "22.15.21",
|
|
45
45
|
"@types/ws": "^8.18.1",
|
|
46
46
|
"eslint": "^9.27.0",
|
|
47
47
|
"homebridge": "1.9.0",
|
|
48
48
|
"shx": "0.4.0",
|
|
49
|
-
"typedoc": "0.28.
|
|
49
|
+
"typedoc": "0.28.5",
|
|
50
50
|
"typedoc-plugin-markdown": "4.6.3",
|
|
51
51
|
"typescript": "5.8.3",
|
|
52
52
|
"typescript-eslint": "^8.32.1"
|