@camstack/types 1.2.437 → 1.2.439
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/CHANGELOG.md +14 -0
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/capabilities/alerts.cap.d.ts +36 -0
- package/dist/capabilities/index.d.ts +3 -1
- package/dist/capabilities/ir-transmitter.cap.d.ts +84 -0
- package/dist/capabilities/pet-feeder.cap.d.ts +12 -0
- package/dist/client.js +5 -0
- package/dist/client.mjs +5 -0
- package/dist/{composition-WNkEpwkF.js → composition-DCmtFE-X.js} +1 -1
- package/dist/{composition-DwA0uVW5.mjs → composition-DpFv_J6D.mjs} +1 -1
- package/dist/device/cap-vocabulary/entries/actuators.d.ts +1 -1
- package/dist/device/device-type.d.ts +4 -1
- package/dist/{err-msg-DIorGYeC.mjs → err-msg-BCdlR2Li.mjs} +3 -0
- package/dist/{err-msg-U7lLUMNz.js → err-msg-COHgq7Mb.js} +3 -0
- package/dist/generated/addon-api.d.ts +22 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/device-proxy.d.ts +2 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +320 -5
- package/dist/index.mjs +308 -6
- package/dist/ir/index.d.ts +5 -0
- package/dist/ir/ir-error.d.ts +6 -0
- package/dist/ir/ir-payload.d.ts +23 -0
- package/dist/ir/ir-timings.d.ts +17 -0
- package/dist/ir/pronto.d.ts +10 -0
- package/dist/ir/smartir.d.ts +31 -0
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-Crlmu_tO.mjs → sleep-BAvUCi_2.mjs} +13 -1
- package/dist/{sleep-DHitF_e4.js → sleep-g6ZjBHBL.js} +13 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-g6ZjBHBL.js");
|
|
3
3
|
const require_event_category = require("./event-category-E17zaHjN.js");
|
|
4
|
-
const require_composition = require("./composition-
|
|
4
|
+
const require_composition = require("./composition-DCmtFE-X.js");
|
|
5
5
|
const require_node_color = require("./node-color.js");
|
|
6
|
-
const require_err_msg = require("./err-msg-
|
|
6
|
+
const require_err_msg = require("./err-msg-COHgq7Mb.js");
|
|
7
7
|
const require_enums = require("./enums.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/media/media-owner-key.ts
|
|
@@ -11180,9 +11180,21 @@ var AlertSeveritySchema = zod.z.enum([
|
|
|
11180
11180
|
"error",
|
|
11181
11181
|
"critical"
|
|
11182
11182
|
]);
|
|
11183
|
+
/**
|
|
11184
|
+
* An action that RUNS something instead of going somewhere: the admin UI calls
|
|
11185
|
+
* the addon's custom action (`addons.custom`) with exactly these fields. The
|
|
11186
|
+
* producer owns the meaning; the UI knows nothing about the addon or the kind.
|
|
11187
|
+
*/
|
|
11188
|
+
var AlertActionInvokeSchema = zod.z.object({
|
|
11189
|
+
addonId: zod.z.string().min(1),
|
|
11190
|
+
action: zod.z.string().min(1),
|
|
11191
|
+
input: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
11192
|
+
});
|
|
11193
|
+
/** An action has `href` (a link) OR `invoke` (a button that runs a custom action). */
|
|
11183
11194
|
var AlertActionSchema = zod.z.object({
|
|
11184
11195
|
label: zod.z.string(),
|
|
11185
11196
|
href: zod.z.string().optional(),
|
|
11197
|
+
invoke: AlertActionInvokeSchema.optional(),
|
|
11186
11198
|
/**
|
|
11187
11199
|
* How `href` is followed. Absent / `app`: an admin-ui route (client-side).
|
|
11188
11200
|
* `server`: a route the HUB serves (an addon HTTP route such as an OAuth
|
|
@@ -65208,6 +65220,83 @@ var buttonCapability = {
|
|
|
65208
65220
|
}) }
|
|
65209
65221
|
};
|
|
65210
65222
|
//#endregion
|
|
65223
|
+
//#region src/ir/ir-timings.ts
|
|
65224
|
+
/** Maximum number of mark/space entries one pulse train may carry. */
|
|
65225
|
+
var IR_TIMINGS_MAX = 1024;
|
|
65226
|
+
/**
|
|
65227
|
+
* A pulse train in signed microseconds: mark (+) first, then space (-), strictly
|
|
65228
|
+
* alternating, no zeros, 2..1024 entries.
|
|
65229
|
+
*/
|
|
65230
|
+
var IrTimingsSchema = zod.z.array(zod.z.number().int()).min(2).max(IR_TIMINGS_MAX).superRefine((timings, ctx) => {
|
|
65231
|
+
timings.forEach((value, index) => {
|
|
65232
|
+
const expectMark = index % 2 === 0;
|
|
65233
|
+
if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
|
|
65234
|
+
code: "custom",
|
|
65235
|
+
message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
|
|
65236
|
+
path: [index]
|
|
65237
|
+
});
|
|
65238
|
+
});
|
|
65239
|
+
});
|
|
65240
|
+
/** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
|
|
65241
|
+
var TransmitSettingsSchema = zod.z.object({
|
|
65242
|
+
carrierHz: zod.z.number().int().positive().optional(),
|
|
65243
|
+
dutyCyclePercent: zod.z.number().int().min(1).max(100).optional(),
|
|
65244
|
+
repeat: zod.z.number().int().min(0).max(20).optional(),
|
|
65245
|
+
repeatDelayMs: zod.z.number().int().min(0).optional()
|
|
65246
|
+
});
|
|
65247
|
+
//#endregion
|
|
65248
|
+
//#region src/capabilities/ir-transmitter.cap.ts
|
|
65249
|
+
/** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
|
|
65250
|
+
var TransmitSettingKeySchema = zod.z.enum([
|
|
65251
|
+
"carrierHz",
|
|
65252
|
+
"dutyCyclePercent",
|
|
65253
|
+
"repeat",
|
|
65254
|
+
"repeatDelayMs"
|
|
65255
|
+
]);
|
|
65256
|
+
var IrMediumSchema = zod.z.enum(["ir", "rf"]);
|
|
65257
|
+
var IrSendResultSchema = zod.z.object({
|
|
65258
|
+
ok: zod.z.literal(true),
|
|
65259
|
+
/** Settings the transmitter could not apply; the train was still sent. */
|
|
65260
|
+
ignoredSettings: zod.z.array(zod.z.string())
|
|
65261
|
+
});
|
|
65262
|
+
var IrTransmitterInfoSchema = zod.z.object({
|
|
65263
|
+
media: zod.z.array(IrMediumSchema),
|
|
65264
|
+
settable: zod.z.array(TransmitSettingKeySchema),
|
|
65265
|
+
maxTimings: zod.z.number().int().positive()
|
|
65266
|
+
});
|
|
65267
|
+
/**
|
|
65268
|
+
* ir-transmitter — emit a pulse train (infrared or RF) with settings. One cap
|
|
65269
|
+
* for both media: everything medium-specific is a per-call setting, validated
|
|
65270
|
+
* against what the transmitter declares in `getInfo`.
|
|
65271
|
+
*
|
|
65272
|
+
* `send` refuses with a typed user error: `ir-transmitter.offline` (the
|
|
65273
|
+
* transmitter cannot be reached) and `ir-transmitter.too-long` (more pulses
|
|
65274
|
+
* than the transmitter's `maxTimings`). A setting the transmitter cannot apply
|
|
65275
|
+
* is NOT a refusal: the train is sent and the key comes back in
|
|
65276
|
+
* `ignoredSettings`.
|
|
65277
|
+
*/
|
|
65278
|
+
var irTransmitterCapability = {
|
|
65279
|
+
name: "ir-transmitter",
|
|
65280
|
+
scope: "device",
|
|
65281
|
+
deviceNative: true,
|
|
65282
|
+
mode: "singleton",
|
|
65283
|
+
deviceTypes: [require_err_msg.DeviceType.Generic],
|
|
65284
|
+
methods: {
|
|
65285
|
+
send: require_sleep.method(zod.z.object({
|
|
65286
|
+
deviceId: zod.z.number().int().nonnegative(),
|
|
65287
|
+
timings: IrTimingsSchema,
|
|
65288
|
+
settings: TransmitSettingsSchema.optional()
|
|
65289
|
+
}), IrSendResultSchema, {
|
|
65290
|
+
kind: "mutation",
|
|
65291
|
+
auth: "protected"
|
|
65292
|
+
}),
|
|
65293
|
+
getInfo: require_sleep.method(zod.z.object({ deviceId: zod.z.number().int().nonnegative() }), IrTransmitterInfoSchema, {
|
|
65294
|
+
kind: "query",
|
|
65295
|
+
auth: "protected"
|
|
65296
|
+
})
|
|
65297
|
+
}
|
|
65298
|
+
};
|
|
65299
|
+
//#endregion
|
|
65211
65300
|
//#region src/capabilities/calendar-source.cap.ts
|
|
65212
65301
|
/**
|
|
65213
65302
|
* `calendar-source` — collection cap exposing per-provider calendars and
|
|
@@ -72357,9 +72446,14 @@ var PetFeederStatusSchema = zod.z.object({
|
|
|
72357
72446
|
* (`device_class: problem`, on = low). True when the tank reports empty,
|
|
72358
72447
|
* or, on a dual-hopper model, when EITHER hopper is empty. */
|
|
72359
72448
|
lowFood: zod.z.boolean(),
|
|
72360
|
-
/** Battery charge 0..100 (%).
|
|
72361
|
-
*
|
|
72449
|
+
/** Battery charge 0..100 (%). On a feeder running on `mains` this is the
|
|
72450
|
+
* BACKUP battery's charge, not the power source. Null when the device has
|
|
72451
|
+
* no battery reading. */
|
|
72362
72452
|
batteryPower: zod.z.number().min(0).max(100).nullable().meta(require_sleep.readingMeta("percentage")),
|
|
72453
|
+
/** What the feeder is powered from right now: `mains` (plugged in, the
|
|
72454
|
+
* battery is only a backup) or `battery`. Null when the device does not
|
|
72455
|
+
* report it. */
|
|
72456
|
+
powerSource: zod.z.enum(["mains", "battery"]).nullable(),
|
|
72363
72457
|
/**
|
|
72364
72458
|
* Desiccant life remaining, stored in seconds (duration base, D944).
|
|
72365
72459
|
* Providers convert from the days the feeder reports. Null when the
|
|
@@ -90859,6 +90953,20 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
90859
90953
|
access: "create",
|
|
90860
90954
|
role: "viewer"
|
|
90861
90955
|
},
|
|
90956
|
+
"irTransmitter.getInfo": {
|
|
90957
|
+
capName: "ir-transmitter",
|
|
90958
|
+
capScope: "device",
|
|
90959
|
+
addonId: null,
|
|
90960
|
+
access: "view",
|
|
90961
|
+
role: "viewer"
|
|
90962
|
+
},
|
|
90963
|
+
"irTransmitter.send": {
|
|
90964
|
+
capName: "ir-transmitter",
|
|
90965
|
+
capScope: "device",
|
|
90966
|
+
addonId: null,
|
|
90967
|
+
access: "create",
|
|
90968
|
+
role: "viewer"
|
|
90969
|
+
},
|
|
90862
90970
|
"keychain.delete": {
|
|
90863
90971
|
capName: "keychain",
|
|
90864
90972
|
capScope: "system",
|
|
@@ -97227,6 +97335,7 @@ var KNOWN_CAP_NAMES = [
|
|
|
97227
97335
|
"image-settings",
|
|
97228
97336
|
"integrations",
|
|
97229
97337
|
"intercom",
|
|
97338
|
+
"ir-transmitter",
|
|
97230
97339
|
"keychain",
|
|
97231
97340
|
"keychain-admin",
|
|
97232
97341
|
"lawn-mower-control",
|
|
@@ -97378,6 +97487,7 @@ var DEVICE_CAP_NAMES = [
|
|
|
97378
97487
|
"image",
|
|
97379
97488
|
"image-settings",
|
|
97380
97489
|
"intercom",
|
|
97490
|
+
"ir-transmitter",
|
|
97381
97491
|
"lawn-mower-control",
|
|
97382
97492
|
"lock-control",
|
|
97383
97493
|
"media-player",
|
|
@@ -98869,6 +98979,11 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
98869
98979
|
icon: "circle-dot"
|
|
98870
98980
|
}]
|
|
98871
98981
|
},
|
|
98982
|
+
"ir-transmitter": {
|
|
98983
|
+
scope: "device",
|
|
98984
|
+
noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
|
|
98985
|
+
notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
|
|
98986
|
+
},
|
|
98872
98987
|
control: {
|
|
98873
98988
|
scope: "device",
|
|
98874
98989
|
noun: t("Control", "Controllo"),
|
|
@@ -103315,6 +103430,7 @@ var CAPABILITY_NAMES = {
|
|
|
103315
103430
|
imageSettings: "image-settings",
|
|
103316
103431
|
integrations: "integrations",
|
|
103317
103432
|
intercom: "intercom",
|
|
103433
|
+
irTransmitter: "ir-transmitter",
|
|
103318
103434
|
keychain: "keychain",
|
|
103319
103435
|
keychainAdmin: "keychain-admin",
|
|
103320
103436
|
lawnMowerControl: "lawn-mower-control",
|
|
@@ -103763,6 +103879,10 @@ var CAPABILITY_ROUTER_KEYS = [
|
|
|
103763
103879
|
key: "intercom",
|
|
103764
103880
|
name: "intercom"
|
|
103765
103881
|
},
|
|
103882
|
+
{
|
|
103883
|
+
key: "irTransmitter",
|
|
103884
|
+
name: "ir-transmitter"
|
|
103885
|
+
},
|
|
103766
103886
|
{
|
|
103767
103887
|
key: "keychain",
|
|
103768
103888
|
name: "keychain"
|
|
@@ -104264,6 +104384,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
104264
104384
|
imageSettingsCapability,
|
|
104265
104385
|
integrationsCapability,
|
|
104266
104386
|
intercomCapability,
|
|
104387
|
+
irTransmitterCapability,
|
|
104267
104388
|
keychainCapability,
|
|
104268
104389
|
keychainAdminCapability,
|
|
104269
104390
|
lawnMowerControlCapability,
|
|
@@ -105459,6 +105580,16 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
|
|
|
105459
105580
|
form: "single",
|
|
105460
105581
|
optional: false
|
|
105461
105582
|
}],
|
|
105583
|
+
"irTransmitter.getInfo": [{
|
|
105584
|
+
name: "deviceId",
|
|
105585
|
+
form: "single",
|
|
105586
|
+
optional: false
|
|
105587
|
+
}],
|
|
105588
|
+
"irTransmitter.send": [{
|
|
105589
|
+
name: "deviceId",
|
|
105590
|
+
form: "single",
|
|
105591
|
+
optional: false
|
|
105592
|
+
}],
|
|
105462
105593
|
"keychain.deleteDeviceScope": [{
|
|
105463
105594
|
name: "deviceId",
|
|
105464
105595
|
form: "single",
|
|
@@ -119719,6 +119850,177 @@ function armRemovalReconcile(opts) {
|
|
|
119719
119850
|
return () => clearInterval(timer);
|
|
119720
119851
|
}
|
|
119721
119852
|
//#endregion
|
|
119853
|
+
//#region src/ir/ir-error.ts
|
|
119854
|
+
var IrCodecError = class extends Error {
|
|
119855
|
+
code;
|
|
119856
|
+
constructor(code, message) {
|
|
119857
|
+
super(message);
|
|
119858
|
+
this.name = "IrCodecError";
|
|
119859
|
+
this.code = code;
|
|
119860
|
+
}
|
|
119861
|
+
};
|
|
119862
|
+
//#endregion
|
|
119863
|
+
//#region src/ir/pronto.ts
|
|
119864
|
+
/** One Pronto frequency-word unit, in microseconds, per unit of the word. */
|
|
119865
|
+
var PRONTO_CLOCK_US = .241246;
|
|
119866
|
+
var LEARNED_FORM = 0;
|
|
119867
|
+
/**
|
|
119868
|
+
* Decode a learned (0000 form) Pronto hex string. The intro burst is followed by
|
|
119869
|
+
* the repeat burst once; a different form is refused with `pronto-unsupported-form`.
|
|
119870
|
+
*/
|
|
119871
|
+
function decodePronto(code) {
|
|
119872
|
+
const words = code.trim().split(/\s+/).filter((w) => w.length > 0);
|
|
119873
|
+
if (words.length < 4) throw new IrCodecError("pronto-malformed", `Pronto code needs at least 4 words, got ${words.length}`);
|
|
119874
|
+
const values = words.map((w) => /^[0-9a-fA-F]{1,4}$/.test(w) ? parseInt(w, 16) : NaN);
|
|
119875
|
+
if (values.some((v) => Number.isNaN(v))) throw new IrCodecError("pronto-malformed", "Pronto code must be 4-digit hexadecimal words");
|
|
119876
|
+
const [form, freqWord, introCount, repeatCount] = values;
|
|
119877
|
+
if (form === void 0 || freqWord === void 0 || introCount === void 0 || repeatCount === void 0) throw new IrCodecError("pronto-malformed", "Pronto header incomplete");
|
|
119878
|
+
if (form !== LEARNED_FORM) throw new IrCodecError("pronto-unsupported-form", `Pronto form ${words[0] ?? ""} is not supported, only the learned 0000 form`);
|
|
119879
|
+
if (freqWord === 0) throw new IrCodecError("pronto-malformed", "Pronto frequency word is zero");
|
|
119880
|
+
const pairs = introCount + repeatCount;
|
|
119881
|
+
if (pairs === 0 || values.length !== 4 + pairs * 2) throw new IrCodecError("pronto-malformed", `Pronto declares ${pairs} burst pairs but carries ${(values.length - 4) / 2} word pairs`);
|
|
119882
|
+
const unitUs = freqWord * PRONTO_CLOCK_US;
|
|
119883
|
+
const timings = values.slice(4).map((count, index) => {
|
|
119884
|
+
const us = Math.max(1, Math.round(count * unitUs));
|
|
119885
|
+
return index % 2 === 0 ? us : -us;
|
|
119886
|
+
});
|
|
119887
|
+
const checked = IrTimingsSchema.safeParse(timings);
|
|
119888
|
+
if (!checked.success) throw new IrCodecError("invalid-timings", `Pronto decoded to invalid timings: ${checked.error.message}`);
|
|
119889
|
+
return {
|
|
119890
|
+
timings: checked.data,
|
|
119891
|
+
carrierHz: Math.round(1e6 / unitUs)
|
|
119892
|
+
};
|
|
119893
|
+
}
|
|
119894
|
+
//#endregion
|
|
119895
|
+
//#region src/ir/ir-payload.ts
|
|
119896
|
+
/** What a remote command stores: a raw pulse train, or a learned Pronto code. */
|
|
119897
|
+
var IrPayloadSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
|
|
119898
|
+
kind: zod.z.literal("raw"),
|
|
119899
|
+
timings: zod.z.array(zod.z.number().int()),
|
|
119900
|
+
settings: TransmitSettingsSchema.optional()
|
|
119901
|
+
}), zod.z.object({
|
|
119902
|
+
kind: zod.z.literal("pronto"),
|
|
119903
|
+
code: zod.z.string()
|
|
119904
|
+
})]);
|
|
119905
|
+
/** Resolve a payload to what `ir-transmitter.send` takes. Throws `IrCodecError`. */
|
|
119906
|
+
function toTimings(payload) {
|
|
119907
|
+
if (payload.kind === "pronto") {
|
|
119908
|
+
const decoded = decodePronto(payload.code);
|
|
119909
|
+
return {
|
|
119910
|
+
timings: decoded.timings,
|
|
119911
|
+
settings: { carrierHz: decoded.carrierHz }
|
|
119912
|
+
};
|
|
119913
|
+
}
|
|
119914
|
+
const checked = IrTimingsSchema.safeParse(payload.timings);
|
|
119915
|
+
if (!checked.success) throw new IrCodecError("invalid-timings", checked.error.message);
|
|
119916
|
+
return {
|
|
119917
|
+
timings: checked.data,
|
|
119918
|
+
settings: payload.settings ?? {}
|
|
119919
|
+
};
|
|
119920
|
+
}
|
|
119921
|
+
//#endregion
|
|
119922
|
+
//#region src/ir/smartir.ts
|
|
119923
|
+
/** SmartIR's own default pause between two commands, in seconds. */
|
|
119924
|
+
var DEFAULT_DELAY_S = .5;
|
|
119925
|
+
var SOURCES_KEY = "sources";
|
|
119926
|
+
var SmartIrDocumentSchema = zod.z.object({
|
|
119927
|
+
manufacturer: zod.z.string().optional(),
|
|
119928
|
+
supportedModels: zod.z.array(zod.z.string()).optional(),
|
|
119929
|
+
supportedController: zod.z.string().optional(),
|
|
119930
|
+
commandsEncoding: zod.z.string(),
|
|
119931
|
+
delay: zod.z.number().nonnegative().optional(),
|
|
119932
|
+
commands: zod.z.record(zod.z.string(), zod.z.unknown())
|
|
119933
|
+
});
|
|
119934
|
+
function describe(error) {
|
|
119935
|
+
return error instanceof Error ? error.message : "unknown error";
|
|
119936
|
+
}
|
|
119937
|
+
function rawPayload(value) {
|
|
119938
|
+
let parsed;
|
|
119939
|
+
try {
|
|
119940
|
+
parsed = JSON.parse(value);
|
|
119941
|
+
} catch (error) {
|
|
119942
|
+
throw new IrCodecError("invalid-raw", `Raw command is not a JSON array: ${describe(error)}`);
|
|
119943
|
+
}
|
|
119944
|
+
const checked = IrTimingsSchema.safeParse(parsed);
|
|
119945
|
+
if (!checked.success) throw new IrCodecError("invalid-timings", checked.error.message);
|
|
119946
|
+
return {
|
|
119947
|
+
kind: "raw",
|
|
119948
|
+
timings: checked.data
|
|
119949
|
+
};
|
|
119950
|
+
}
|
|
119951
|
+
function prontoPayload(value) {
|
|
119952
|
+
decodePronto(value);
|
|
119953
|
+
return {
|
|
119954
|
+
kind: "pronto",
|
|
119955
|
+
code: value
|
|
119956
|
+
};
|
|
119957
|
+
}
|
|
119958
|
+
/** Parse a SmartIR media_player JSON. Raw and Pronto are imported; other encodings are reported in `skipped`. */
|
|
119959
|
+
function parseSmartIr(document) {
|
|
119960
|
+
const parsed = SmartIrDocumentSchema.safeParse(document);
|
|
119961
|
+
if (!parsed.success) throw new IrCodecError("smartir-malformed", `Not a SmartIR document: ${parsed.error.message}`);
|
|
119962
|
+
const doc = parsed.data;
|
|
119963
|
+
const encoding = doc.commandsEncoding;
|
|
119964
|
+
const entries = [];
|
|
119965
|
+
for (const [name, value] of Object.entries(doc.commands)) if (name === SOURCES_KEY && typeof value === "object" && value !== null && !Array.isArray(value)) for (const [sourceName, sourceValue] of Object.entries(value)) entries.push({
|
|
119966
|
+
name: sourceName,
|
|
119967
|
+
group: "source",
|
|
119968
|
+
value: sourceValue
|
|
119969
|
+
});
|
|
119970
|
+
else entries.push({
|
|
119971
|
+
name,
|
|
119972
|
+
group: "command",
|
|
119973
|
+
value
|
|
119974
|
+
});
|
|
119975
|
+
const commands = [];
|
|
119976
|
+
const skipped = [];
|
|
119977
|
+
const supported = encoding === "Raw" || encoding === "Pronto";
|
|
119978
|
+
for (const { name, group, value } of entries) {
|
|
119979
|
+
if (!supported) {
|
|
119980
|
+
skipped.push({
|
|
119981
|
+
name,
|
|
119982
|
+
group,
|
|
119983
|
+
reason: `${encoding} encoding is not supported`
|
|
119984
|
+
});
|
|
119985
|
+
continue;
|
|
119986
|
+
}
|
|
119987
|
+
if (typeof value !== "string") {
|
|
119988
|
+
skipped.push({
|
|
119989
|
+
name,
|
|
119990
|
+
group,
|
|
119991
|
+
reason: "command is not a string"
|
|
119992
|
+
});
|
|
119993
|
+
continue;
|
|
119994
|
+
}
|
|
119995
|
+
try {
|
|
119996
|
+
commands.push({
|
|
119997
|
+
name,
|
|
119998
|
+
group,
|
|
119999
|
+
payload: encoding === "Raw" ? rawPayload(value) : prontoPayload(value)
|
|
120000
|
+
});
|
|
120001
|
+
} catch (error) {
|
|
120002
|
+
skipped.push({
|
|
120003
|
+
name,
|
|
120004
|
+
group,
|
|
120005
|
+
reason: describe(error)
|
|
120006
|
+
});
|
|
120007
|
+
}
|
|
120008
|
+
}
|
|
120009
|
+
return {
|
|
120010
|
+
table: {
|
|
120011
|
+
commands,
|
|
120012
|
+
interCommandDelayMs: Math.round((doc.delay ?? DEFAULT_DELAY_S) * 1e3),
|
|
120013
|
+
origin: {
|
|
120014
|
+
format: "smartir",
|
|
120015
|
+
manufacturer: doc.manufacturer,
|
|
120016
|
+
models: doc.supportedModels,
|
|
120017
|
+
controller: doc.supportedController
|
|
120018
|
+
}
|
|
120019
|
+
},
|
|
120020
|
+
skipped
|
|
120021
|
+
};
|
|
120022
|
+
}
|
|
120023
|
+
//#endregion
|
|
119722
120024
|
exports.ACCESSORY_LABEL = ACCESSORY_LABEL;
|
|
119723
120025
|
exports.ACCESS_ROLES = ACCESS_ROLES;
|
|
119724
120026
|
exports.ACTIVE_CRITERIA = require_composition.ACTIVE_CRITERIA;
|
|
@@ -120551,6 +120853,7 @@ exports.INITIAL_SPAN = INITIAL_SPAN;
|
|
|
120551
120853
|
exports.INTEGRAL_OUTPUTS = require_composition.INTEGRAL_OUTPUTS;
|
|
120552
120854
|
exports.INTERNAL_ACTION_PREFIX = INTERNAL_ACTION_PREFIX;
|
|
120553
120855
|
exports.INVERTIBLE_CAPS = INVERTIBLE_CAPS;
|
|
120856
|
+
exports.IR_TIMINGS_MAX = IR_TIMINGS_MAX;
|
|
120554
120857
|
exports.IconKeySchema = IconKeySchema;
|
|
120555
120858
|
exports.ImageContractSchema = ImageContractSchema;
|
|
120556
120859
|
exports.ImageContractStateSchema = ImageContractStateSchema;
|
|
@@ -120571,6 +120874,12 @@ exports.IntegrationWithStateSchema = IntegrationWithStateSchema;
|
|
|
120571
120874
|
exports.IntercomAbilitySchema = IntercomAbilitySchema;
|
|
120572
120875
|
exports.IntercomStatusSchema = IntercomStatusSchema;
|
|
120573
120876
|
exports.InvalidRecordError = require_sleep.InvalidRecordError;
|
|
120877
|
+
exports.IrCodecError = IrCodecError;
|
|
120878
|
+
exports.IrMediumSchema = IrMediumSchema;
|
|
120879
|
+
exports.IrPayloadSchema = IrPayloadSchema;
|
|
120880
|
+
exports.IrSendResultSchema = IrSendResultSchema;
|
|
120881
|
+
exports.IrTimingsSchema = IrTimingsSchema;
|
|
120882
|
+
exports.IrTransmitterInfoSchema = IrTransmitterInfoSchema;
|
|
120574
120883
|
exports.KEYCHAIN_MAX_REFS_PER_CALL = KEYCHAIN_MAX_REFS_PER_CALL;
|
|
120575
120884
|
exports.KEYCHAIN_RESET_CONFIRMATION = KEYCHAIN_RESET_CONFIRMATION;
|
|
120576
120885
|
exports.KEYCHAIN_RESET_TRIGGER_ACTOR = KEYCHAIN_RESET_TRIGGER_ACTOR;
|
|
@@ -121722,6 +122031,8 @@ exports.TrainingResultSchema = TrainingResultSchema;
|
|
|
121722
122031
|
exports.TrainingSplitPlanSchema = TrainingSplitPlanSchema;
|
|
121723
122032
|
exports.TrainingStageSchema = TrainingStageSchema;
|
|
121724
122033
|
exports.TransactRefusedError = require_sleep.TransactRefusedError;
|
|
122034
|
+
exports.TransmitSettingKeySchema = TransmitSettingKeySchema;
|
|
122035
|
+
exports.TransmitSettingsSchema = TransmitSettingsSchema;
|
|
121725
122036
|
exports.TransportPlaneCountsSchema = TransportPlaneCountsSchema;
|
|
121726
122037
|
exports.TransportPlaneSchema = TransportPlaneSchema;
|
|
121727
122038
|
exports.TurnServerSchema = TurnServerSchema;
|
|
@@ -122067,6 +122378,7 @@ exports.declareLogChannel = declareLogChannel;
|
|
|
122067
122378
|
exports.declaredSeriesKind = declaredSeriesKind;
|
|
122068
122379
|
exports.decodeCompositionToCards = decodeCompositionToCards;
|
|
122069
122380
|
exports.decodeKeyedArrayOverride = decodeKeyedArrayOverride;
|
|
122381
|
+
exports.decodePronto = decodePronto;
|
|
122070
122382
|
exports.decodePulseOverride = decodePulseOverride;
|
|
122071
122383
|
exports.decodeScalarOverride = decodeScalarOverride;
|
|
122072
122384
|
exports.decodeVectorBase64 = decodeVectorBase64;
|
|
@@ -122282,6 +122594,7 @@ exports.interpretStoredClusterModel = interpretStoredClusterModel;
|
|
|
122282
122594
|
exports.invalidClusterStepModelEntries = invalidClusterStepModelEntries;
|
|
122283
122595
|
exports.invertPresetFeature = invertPresetFeature;
|
|
122284
122596
|
exports.invocationFromEncodeProfile = require_composition.invocationFromEncodeProfile;
|
|
122597
|
+
exports.irTransmitterCapability = irTransmitterCapability;
|
|
122285
122598
|
exports.isAgentOnlyPlacement = isAgentOnlyPlacement;
|
|
122286
122599
|
exports.isAlarmControllableCap = isAlarmControllableCap;
|
|
122287
122600
|
exports.isAlertEpisodeOpen = isAlertEpisodeOpen;
|
|
@@ -122520,6 +122833,7 @@ exports.parseSecretRef = require_sleep.parseSecretRef;
|
|
|
122520
122833
|
exports.parseSecretStatePath = require_sleep.parseSecretStatePath;
|
|
122521
122834
|
exports.parseSessionPlacementPolicy = parseSessionPlacementPolicy;
|
|
122522
122835
|
exports.parseShareSource = parseShareSource;
|
|
122836
|
+
exports.parseSmartIr = parseSmartIr;
|
|
122523
122837
|
exports.parseStreamParamsFormPatch = parseStreamParamsFormPatch;
|
|
122524
122838
|
exports.parseTrainingEventLine = parseTrainingEventLine;
|
|
122525
122839
|
exports.patchAudio = patchAudio;
|
|
@@ -122856,6 +123170,7 @@ exports.toNodeId = require_sleep.toNodeId;
|
|
|
122856
123170
|
exports.toPercentShares = toPercentShares;
|
|
122857
123171
|
exports.toSecretFieldView = require_sleep.toSecretFieldView;
|
|
122858
123172
|
exports.toStreamSourceEntry = toStreamSourceEntry;
|
|
123173
|
+
exports.toTimings = toTimings;
|
|
122859
123174
|
exports.toastCapability = toastCapability;
|
|
122860
123175
|
exports.toggleAudioLabel = toggleAudioLabel;
|
|
122861
123176
|
exports.tokenize = require_composition.tokenize;
|