forked from Koenkk/zigbee-herdsman-converters
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
675 lines (552 loc) · 24.3 KB
/
index.ts
File metadata and controls
675 lines (552 loc) · 24.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
import assert from "node:assert";
import {Zcl} from "zigbee-herdsman";
import * as fromZigbee from "./converters/fromZigbee";
import * as toZigbee from "./converters/toZigbee";
import * as exposesLib from "./lib/exposes";
import {
access,
Binary,
Climate,
Composite,
Cover,
Enum,
Enum as EnumClass,
Fan,
Feature,
Light,
List,
Lock,
Numeric,
Switch,
Text,
} from "./lib/exposes";
import {generateDefinition} from "./lib/generateDefinition";
import {logger} from "./lib/logger";
import {
type Configure,
Definition,
type DefinitionExposes,
type DefinitionExposesFunction,
DefinitionWithExtend,
Expose,
ExternalDefinitionWithExtend,
type Fingerprint,
type KeyValue,
type OnEvent,
type OnEventData,
type OnEventMeta,
OnEventType,
Option,
Tz,
type Zh,
} from "./lib/types";
import * as utils from "./lib/utils";
// @ts-expect-error dynamically built
import modelsIndexJson from "./models-index.json";
const NS = "zhc";
type ModelIndex = [module: string, index: number];
const MODELS_INDEX = modelsIndexJson as Record<string, ModelIndex[]>;
export type {Ota} from "./lib/types";
export {
DefinitionWithExtend,
ExternalDefinitionWithExtend,
access,
Definition,
OnEventType,
Feature,
Expose,
Option,
Numeric,
Binary,
Enum,
Text,
Composite,
List,
Light,
Climate,
Switch,
Lock,
Cover,
Fan,
toZigbee,
fromZigbee,
Tz,
};
export {getConfigureKey} from "./lib/configureKey";
export {setLogger} from "./lib/logger";
export * as ota from "./lib/ota";
export {clear as clearGlobalStore} from "./lib/store";
// key: zigbeeModel, value: array of definitions (most of the times 1)
const externalDefinitionsLookup = new Map<string, DefinitionWithExtend[]>();
export const externalDefinitions: DefinitionWithExtend[] = [];
// expected to be at the beginning of `definitions` array
let externalDefinitionsCount = 0;
function arrayEquals<T>(as: T[], bs: T[]): boolean {
if (as.length !== bs.length) {
return false;
}
for (const a of as) {
if (!bs.includes(a)) {
return false;
}
}
return true;
}
function addToExternalDefinitionsLookup(zigbeeModel: string | undefined, definition: DefinitionWithExtend): void {
const lookupModel = zigbeeModel ? zigbeeModel.toLowerCase() : "null";
if (!externalDefinitionsLookup.has(lookupModel)) {
externalDefinitionsLookup.set(lookupModel, []);
}
// key created above
// biome-ignore lint/style/noNonNullAssertion: ignored using `--suppress`
if (!externalDefinitionsLookup.get(lookupModel)!.includes(definition)) {
// biome-ignore lint/style/noNonNullAssertion: ignored using `--suppress`
externalDefinitionsLookup.get(lookupModel)!.splice(0, 0, definition);
}
}
function removeFromExternalDefinitionsLookup(zigbeeModel: string | undefined, definition: DefinitionWithExtend): void {
const lookupModel = zigbeeModel ? zigbeeModel.toLowerCase() : "null";
if (externalDefinitionsLookup.has(lookupModel)) {
// biome-ignore lint/style/noNonNullAssertion: ignored using `--suppress`
const i = externalDefinitionsLookup.get(lookupModel)!.indexOf(definition);
if (i > -1) {
// biome-ignore lint/style/noNonNullAssertion: ignored using `--suppress`
externalDefinitionsLookup.get(lookupModel)!.splice(i, 1);
}
// biome-ignore lint/style/noNonNullAssertion: ignored using `--suppress`
if (externalDefinitionsLookup.get(lookupModel)!.length === 0) {
externalDefinitionsLookup.delete(lookupModel);
}
}
}
function getFromExternalDefinitionsLookup(zigbeeModel: string | undefined): DefinitionWithExtend[] | undefined {
const lookupModel = zigbeeModel ? zigbeeModel.toLowerCase() : "null";
if (externalDefinitionsLookup.has(lookupModel)) {
return externalDefinitionsLookup.get(lookupModel);
}
return externalDefinitionsLookup.get(lookupModel.replace(/\0(.|\n)*$/g, "").trim());
}
export function removeExternalDefinitions(converterName?: string): void {
for (let i = 0; i < externalDefinitionsCount; i++) {
const definition = externalDefinitions[i];
if (converterName && definition.externalConverterName !== converterName) {
continue;
}
if (definition.zigbeeModel) {
for (const zigbeeModel of definition.zigbeeModel) {
removeFromExternalDefinitionsLookup(zigbeeModel, definition);
}
}
if (definition.fingerprint) {
for (const fingerprint of definition.fingerprint) {
removeFromExternalDefinitionsLookup(fingerprint.modelID, definition);
}
}
externalDefinitions.splice(i, 1);
externalDefinitionsCount--;
i--;
}
}
export function addExternalDefinition(definition: ExternalDefinitionWithExtend): void {
externalDefinitions.splice(0, 0, definition);
externalDefinitionsCount++;
if (definition.fingerprint) {
for (const fingerprint of definition.fingerprint) {
addToExternalDefinitionsLookup(fingerprint.modelID, definition);
}
}
if (definition.zigbeeModel) {
for (const zigbeeModel of definition.zigbeeModel) {
addToExternalDefinitionsLookup(zigbeeModel, definition);
}
}
}
async function getDefinitions(indexes: ModelIndex[]): Promise<DefinitionWithExtend[]> {
const indexedDefs: DefinitionWithExtend[] = [];
// local cache for models with lots of matches (tuya...)
const defs: Record<string, DefinitionWithExtend[]> = {};
for (const [moduleName, index] of indexes) {
if (!defs[moduleName]) {
// NOTE: modules are cached by nodejs until process is stopped
// currently using `commonjs`, so strip `.js` file extension, XXX: creates a warning with vitest (expects static `.js`)
const {definitions} = (await import(`./devices/${moduleName.slice(0, -3)}`)) as {definitions: DefinitionWithExtend[]};
defs[moduleName] = definitions;
}
indexedDefs.push(defs[moduleName][index]);
}
return indexedDefs;
}
async function getFromIndex(zigbeeModel: string | undefined): Promise<DefinitionWithExtend[] | undefined> {
const lookupModel = zigbeeModel ? zigbeeModel.toLowerCase() : "null";
let indexes = MODELS_INDEX[lookupModel];
if (indexes) {
logger.debug(`Getting definitions for: ${indexes}`, NS);
return await getDefinitions(indexes);
}
indexes = MODELS_INDEX[lookupModel.replace(/\0(.|\n)*$/g, "").trim()];
if (indexes) {
logger.debug(`Getting definitions for: ${indexes}`, NS);
return await getDefinitions(indexes);
}
}
const converterRequiredFields = {
model: "String",
vendor: "String",
description: "String",
fromZigbee: "Array",
toZigbee: "Array",
};
function validateDefinition(definition: Definition): asserts definition is Definition {
for (const [field, expectedType] of Object.entries(converterRequiredFields)) {
const val = definition[field as keyof Definition];
assert(val !== null, `Converter field ${field} is null`);
assert(val !== undefined, `Converter field ${field} is undefined`);
assert(val.constructor.name === expectedType, `Converter field ${field} expected type doenst match to ${val}`);
}
assert.ok(Array.isArray(definition.exposes) || typeof definition.exposes === "function", "Exposes incorrect");
}
function processExtensions(definition: DefinitionWithExtend): Definition {
if ("extend" in definition) {
if (!Array.isArray(definition.extend)) {
assert.fail(`'${definition.model}' has legacy extend which is not supported anymore`);
}
// Modern extend, merges properties, e.g. when both extend and definition has toZigbee, toZigbee will be combined
let {
extend,
toZigbee,
fromZigbee,
exposes: definitionExposes,
meta,
endpoint,
ota,
configure: definitionConfigure,
onEvent: definitionOnEvent,
...definitionWithoutExtend
} = definition;
// Exposes can be an Expose[] or DefinitionExposesFunction. In case it's only Expose[] we return an array
// Otherwise return a DefinitionExposesFunction.
const allExposesIsExposeOnly = (allExposes: (Expose | DefinitionExposesFunction)[]): allExposes is Expose[] => {
return !allExposes.find((e) => typeof e === "function");
};
let allExposes: (Expose | DefinitionExposesFunction)[] = [];
if (definitionExposes) {
if (typeof definitionExposes === "function") {
allExposes.push(definitionExposes);
} else {
allExposes.push(...definitionExposes);
}
}
toZigbee = [...(toZigbee ?? [])];
fromZigbee = [...(fromZigbee ?? [])];
const configures: Configure[] = definitionConfigure ? [definitionConfigure] : [];
const onEvents: OnEvent[] = definitionOnEvent ? [definitionOnEvent] : [];
for (const ext of extend) {
if (!ext.isModernExtend) {
assert.fail(`'${definition.model}' has legacy extend in modern extend`);
}
if (ext.toZigbee) {
toZigbee.push(...ext.toZigbee);
}
if (ext.fromZigbee) {
fromZigbee.push(...ext.fromZigbee);
}
if (ext.exposes) {
allExposes.push(...ext.exposes);
}
if (ext.meta) {
meta = Object.assign({}, ext.meta, meta);
}
// Filter `undefined` configures, e.g. returned by setupConfigureForReporting.
if (ext.configure) {
configures.push(...ext.configure.filter((c) => c !== undefined));
}
if (ext.onEvent) {
onEvents.push(...ext.onEvent.filter((c) => c !== undefined));
}
if (ext.ota) {
ota = ext.ota;
}
if (ext.endpoint) {
if (endpoint) {
assert.fail(`'${definition.model}' has multiple 'endpoint', this is not allowed`);
}
endpoint = ext.endpoint;
}
}
// Filtering out action exposes to combine them one
const actionExposes = allExposes.filter((e) => typeof e !== "function" && e.name === "action");
allExposes = allExposes.filter((e) => e.name !== "action");
if (actionExposes.length > 0) {
const actions: string[] = [];
for (const expose of actionExposes) {
if (expose instanceof EnumClass) {
for (const action of expose.values) {
actions.push(action.toString());
}
}
}
const uniqueActions = actions.filter((value, index, array) => array.indexOf(value) === index);
allExposes.push(exposesLib.presets.action(uniqueActions));
}
let configure: Configure | undefined;
if (configures.length !== 0) {
configure = async (device, coordinatorEndpoint, configureDefinition) => {
for (const func of configures) {
await func(device, coordinatorEndpoint, configureDefinition);
}
};
}
let onEvent: OnEvent | undefined;
if (onEvents.length !== 0) {
onEvent = async (type, data, device, settings, state) => {
for (const func of onEvents) {
await func(type, data, device, settings, state);
}
};
}
// In case there is a function in allExposes, return a function, otherwise just an array.
let exposes: DefinitionExposes;
if (allExposesIsExposeOnly(allExposes)) {
exposes = allExposes;
} else {
exposes = (device, options) => {
const result: Expose[] = [];
for (const item of allExposes) {
if (typeof item === "function") {
try {
const deviceExposes = item(device, options);
result.push(...deviceExposes);
} catch (error) {
const ieeeAddr = utils.isDummyDevice(device) ? "dummy-device" : device.ieeeAddr;
logger.error(`Failed to process exposes for '${ieeeAddr}' (${(error as Error).stack})`, NS);
}
} else {
result.push(item);
}
}
return result;
};
}
return {toZigbee, fromZigbee, exposes, meta, configure, endpoint, onEvent, ota, ...definitionWithoutExtend};
}
return {...definition};
}
export function prepareDefinition(definition: DefinitionWithExtend): Definition {
const finalDefinition = processExtensions(definition);
finalDefinition.toZigbee = [
...finalDefinition.toZigbee,
toZigbee.scene_store,
toZigbee.scene_recall,
toZigbee.scene_add,
toZigbee.scene_remove,
toZigbee.scene_remove_all,
toZigbee.scene_rename,
toZigbee.read,
toZigbee.write,
toZigbee.command,
toZigbee.factory_reset,
toZigbee.zcl_command,
];
if (definition.externalConverterName) {
validateDefinition(finalDefinition);
}
// Add all the options
finalDefinition.options = [...(finalDefinition.options ?? [])];
const optionKeys = finalDefinition.options.map((o) => o.name);
// Add calibration/precision options based on expose
for (const expose of Array.isArray(finalDefinition.exposes) ? finalDefinition.exposes : finalDefinition.exposes({isDummyDevice: true}, {})) {
if (
!optionKeys.includes(expose.name) &&
utils.isNumericExpose(expose) &&
expose.name in utils.calibrateAndPrecisionRoundOptionsDefaultPrecision
) {
// Battery voltage is not calibratable
if (expose.name === "voltage" && expose.unit === "mV") {
continue;
}
const type = utils.calibrateAndPrecisionRoundOptionsIsPercentual(expose.name) ? "percentual" : "absolute";
finalDefinition.options.push(exposesLib.options.calibration(expose.name, type).withValueStep(0.1));
if (utils.calibrateAndPrecisionRoundOptionsDefaultPrecision[expose.name] !== 0) {
finalDefinition.options.push(exposesLib.options.precision(expose.name));
}
optionKeys.push(expose.name);
}
}
for (const converter of [...finalDefinition.toZigbee, ...finalDefinition.fromZigbee]) {
if (converter.options) {
const options = typeof converter.options === "function" ? converter.options(finalDefinition) : converter.options;
for (const option of options) {
if (!optionKeys.includes(option.name)) {
finalDefinition.options.push(option);
optionKeys.push(option.name);
}
}
}
}
return finalDefinition;
}
export function postProcessConvertedFromZigbeeMessage(definition: Definition, payload: KeyValue, options: KeyValue): void {
// Apply calibration/precision options
for (const [key, value] of Object.entries(payload)) {
const definitionExposes = Array.isArray(definition.exposes) ? definition.exposes : definition.exposes({isDummyDevice: true}, {});
const expose = definitionExposes.find((e) => e.property === key);
if (expose?.name && expose.name in utils.calibrateAndPrecisionRoundOptionsDefaultPrecision && value !== "" && utils.isNumber(value)) {
try {
payload[key] = utils.calibrateAndPrecisionRoundOptions(value, options, expose.name);
} catch (error) {
logger.error(`Failed to apply calibration to '${expose.name}': ${(error as Error).message}`, NS);
}
}
}
}
export async function findByDevice(device: Zh.Device, generateForUnknown = false): Promise<Definition | undefined> {
let definition = await findDefinition(device, generateForUnknown);
if (definition) {
if (definition.whiteLabel) {
const match = definition.whiteLabel.find((w) => "fingerprint" in w && w.fingerprint.find((f) => isFingerprintMatch(f, device)));
if (match) {
definition = {
...definition,
model: match.model,
vendor: match.vendor,
description: match.description || definition.description,
};
}
}
return prepareDefinition(definition);
}
}
export async function findDefinition(device: Zh.Device, generateForUnknown = false): Promise<DefinitionWithExtend | undefined> {
if (!device) {
return undefined;
}
let candidates = await getFromIndex(device.modelID);
if (externalDefinitionsCount > 0) {
const extCandidates = getFromExternalDefinitionsLookup(device.modelID);
if (extCandidates) {
if (candidates) {
candidates.unshift(...extCandidates);
} else {
candidates = extCandidates;
}
}
}
if (candidates) {
if (candidates.length === 1 && candidates[0].zigbeeModel) {
return candidates[0];
}
logger.debug(() => `Candidates for ${device.ieeeAddr}/${device.modelID}: ${candidates.map((c) => `${c.model}/${c.vendor}`)}`, NS);
// First try to match based on fingerprint, return the first matching one.
const fingerprintMatch: {priority?: number; definition?: DefinitionWithExtend} = {priority: undefined, definition: undefined};
for (const candidate of candidates) {
if (candidate.fingerprint) {
for (const fingerprint of candidate.fingerprint) {
const priority = fingerprint.priority ?? 0;
if (
isFingerprintMatch(fingerprint, device) &&
(fingerprintMatch.priority === undefined || priority > fingerprintMatch.priority)
) {
fingerprintMatch.definition = candidate;
fingerprintMatch.priority = priority;
}
}
}
}
if (fingerprintMatch.definition) {
return fingerprintMatch.definition;
}
// Match based on fingerprint failed, return first matching definition based on zigbeeModel
for (const candidate of candidates) {
if (candidate.zigbeeModel && device.modelID && candidate.zigbeeModel.includes(device.modelID)) {
return candidate;
}
}
}
if (!generateForUnknown || device.type === "Coordinator") {
return undefined;
}
const {definition} = await generateDefinition(device);
return definition;
}
export async function generateExternalDefinitionSource(device: Zh.Device): Promise<string> {
return (await generateDefinition(device)).externalDefinitionSource;
}
export async function generateExternalDefinition(device: Zh.Device): Promise<Definition> {
const {definition} = await generateDefinition(device);
return prepareDefinition(definition);
}
function isFingerprintMatch(fingerprint: Fingerprint, device: Zh.Device): boolean {
let match =
(fingerprint.applicationVersion === undefined || device.applicationVersion === fingerprint.applicationVersion) &&
(fingerprint.manufacturerID === undefined || device.manufacturerID === fingerprint.manufacturerID) &&
(!fingerprint.type || device.type === fingerprint.type) &&
(!fingerprint.dateCode || device.dateCode === fingerprint.dateCode) &&
(fingerprint.hardwareVersion === undefined || device.hardwareVersion === fingerprint.hardwareVersion) &&
(!fingerprint.manufacturerName || device.manufacturerName === fingerprint.manufacturerName) &&
(!fingerprint.modelID || device.modelID === fingerprint.modelID) &&
(!fingerprint.powerSource || device.powerSource === fingerprint.powerSource) &&
(!fingerprint.softwareBuildID || device.softwareBuildID === fingerprint.softwareBuildID) &&
(fingerprint.stackVersion === undefined || device.stackVersion === fingerprint.stackVersion) &&
(fingerprint.zclVersion === undefined || device.zclVersion === fingerprint.zclVersion) &&
(!fingerprint.ieeeAddr || device.ieeeAddr.match(fingerprint.ieeeAddr) !== null) &&
(!fingerprint.endpoints ||
arrayEquals(
device.endpoints.map((e) => e.ID),
fingerprint.endpoints.map((e) => e.ID),
));
if (match && fingerprint.endpoints) {
for (const fingerprintEndpoint of fingerprint.endpoints) {
const deviceEndpoint = fingerprintEndpoint.ID !== undefined ? device.getEndpoint(fingerprintEndpoint.ID) : undefined;
match =
match &&
(fingerprintEndpoint.deviceID === undefined ||
(deviceEndpoint !== undefined && deviceEndpoint.deviceID === fingerprintEndpoint.deviceID)) &&
(fingerprintEndpoint.profileID === undefined ||
(deviceEndpoint !== undefined && deviceEndpoint.profileID === fingerprintEndpoint.profileID)) &&
(!fingerprintEndpoint.inputClusters ||
(deviceEndpoint !== undefined && arrayEquals(deviceEndpoint.inputClusters, fingerprintEndpoint.inputClusters))) &&
(!fingerprintEndpoint.outputClusters ||
(deviceEndpoint !== undefined && arrayEquals(deviceEndpoint.outputClusters, fingerprintEndpoint.outputClusters)));
}
}
return match;
}
// Can be used to handle events for devices which are not fully paired yet (no modelID).
// Example usecase: https://github.com/Koenkk/zigbee2mqtt/issues/2399#issuecomment-570583325
export function onEvent(type: OnEventType, data: OnEventData, device: Zh.Device, meta: OnEventMeta): Promise<void> {
// support Legrand security protocol
// when pairing, a powered device will send a read frame to every device on the network
// it expects at least one answer. The payload contains the number of seconds
// since when the device is powered. If the value is too high, it will leave & not pair
// 23 works, 200 doesn't
if (device.manufacturerID === Zcl.ManufacturerCode.LEGRAND_GROUP && !device.customReadResponse) {
device.customReadResponse = (frame, endpoint) => {
if (frame.isCluster("genBasic") && frame.payload.find((i: {attrId: number}) => i.attrId === 61440)) {
const options = {manufacturerCode: Zcl.ManufacturerCode.LEGRAND_GROUP, disableDefaultResponse: true};
const payload = {61440: {value: 23, type: 35}};
endpoint.readResponse("genBasic", frame.header.transactionSequenceNumber, payload, options).catch((e) => {
logger.warning(`Legrand security read response failed: ${e}`, NS);
});
return true;
}
return false;
};
}
// Aqara feeder C1 polls the time during the interview, need to send back the local time instead of the UTC.
// The device.definition has not yet been set - therefore the device.definition.onEvent method does not work.
if (device.modelID === "aqara.feeder.acn001" && !device.customReadResponse) {
device.customReadResponse = (frame, endpoint) => {
if (frame.isCluster("genTime")) {
const oneJanuary2000 = new Date("January 01, 2000 00:00:00 UTC+00:00").getTime();
const secondsUTC = Math.round((Date.now() - oneJanuary2000) / 1000);
const secondsLocal = secondsUTC - new Date().getTimezoneOffset() * 60;
endpoint.readResponse("genTime", frame.header.transactionSequenceNumber, {time: secondsLocal}).catch((e) => {
logger.warning(`ZNCWWSQ01LM custom time response failed: ${e}`, NS);
});
return true;
}
return false;
};
}
return Promise.resolve();
}