@camstack/types 1.2.420 → 1.2.421
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/composer.cap.d.ts +36 -0
- package/dist/capabilities/core-blocks.cap.d.ts +252 -0
- package/dist/capabilities/power-meter.cap.d.ts +1 -1
- package/dist/capabilities/running-state.cap.d.ts +1 -1
- package/dist/client.js +9 -1
- package/dist/client.mjs +9 -1
- package/dist/composition/composition.d.ts +12 -0
- package/dist/composition/helpers/appliance.d.ts +28 -0
- package/dist/composition/helpers/compile.d.ts +1 -1
- package/dist/composition/helpers/index.d.ts +2 -1
- package/dist/composition/helpers/save.d.ts +1 -1
- package/dist/composition/helpers/spec.d.ts +21 -1
- package/dist/{composition-OhpuespA.mjs → composition-B2rw5L29.mjs} +88 -3
- package/dist/{composition-re1aezX9.js → composition-B3Hkb6v7.js} +135 -2
- package/dist/device/appliance-export.d.ts +25 -0
- package/dist/device/cap-vocabulary/types.d.ts +10 -0
- package/dist/device/device-type.d.ts +8 -2
- package/dist/{err-msg-BXKzRBwg.mjs → err-msg-DIorGYeC.mjs} +7 -1
- package/dist/{err-msg-BhVbr0NX.js → err-msg-U7lLUMNz.js} +7 -1
- package/dist/generated/customize-catalog.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -118
- package/dist/index.mjs +307 -119
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* features are a projection; the editor never edits the expression.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
+
import { APPLIANCE_TEMPLATE_ID } from './appliance.js';
|
|
6
7
|
import { CompositionSourceRefSchema } from '../source-ref.js';
|
|
7
8
|
/** A group may name more members than an expression call (the 16-arg cap). */
|
|
8
9
|
export declare const MAX_HELPER_MEMBERS: number;
|
|
@@ -39,5 +40,24 @@ export declare const GroupHelperSpecSchema: z.ZodObject<{
|
|
|
39
40
|
active: z.ZodOptional<typeof ActiveCriterionSchema>;
|
|
40
41
|
}>;
|
|
41
42
|
export type GroupHelperSpec = z.infer<typeof GroupHelperSpecSchema>;
|
|
42
|
-
export declare const
|
|
43
|
+
export declare const ApplianceHelperSpecSchema: z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<'appliance'>;
|
|
45
|
+
templateId: z.ZodLiteral<typeof APPLIANCE_TEMPLATE_ID>;
|
|
46
|
+
appliance: z.ZodEnum<{
|
|
47
|
+
washer: 'washer';
|
|
48
|
+
dryer: 'dryer';
|
|
49
|
+
dishwasher: 'dishwasher';
|
|
50
|
+
}>;
|
|
51
|
+
thresholdWatts: z.ZodNumber;
|
|
52
|
+
startDwellMs: z.ZodNumber;
|
|
53
|
+
stopDwellMs: z.ZodNumber;
|
|
54
|
+
member: typeof HelperMemberSchema;
|
|
55
|
+
}>;
|
|
56
|
+
export type ApplianceHelperSpec = z.infer<typeof ApplianceHelperSpecSchema>;
|
|
57
|
+
export declare const HelperSpecSchema: z.ZodDiscriminatedUnion<[
|
|
58
|
+
typeof GroupHelperSpecSchema,
|
|
59
|
+
typeof ApplianceHelperSpecSchema
|
|
60
|
+
], 'kind'>;
|
|
43
61
|
export type HelperSpec = z.infer<typeof HelperSpecSchema>;
|
|
62
|
+
/** Every member a helper reads. An appliance has one. */
|
|
63
|
+
export declare function helperMembers(spec: HelperSpec): readonly HelperMember[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DeviceType, i as DeviceRole } from "./err-msg-
|
|
1
|
+
import { a as DeviceType, i as DeviceRole } from "./err-msg-DIorGYeC.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
//#region src/ffmpeg/invocation.ts
|
|
@@ -2160,6 +2160,78 @@ function evaluateExpressionSource(expr, bindingValues, now, opts) {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
|
+
//#region src/composition/helpers/appliance.ts
|
|
2164
|
+
/**
|
|
2165
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
2166
|
+
*
|
|
2167
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
2168
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
2169
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
2170
|
+
*
|
|
2171
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
2172
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
2173
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
2174
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
2175
|
+
* can move later without moving the others.
|
|
2176
|
+
*/
|
|
2177
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
2178
|
+
var APPLIANCE_KINDS = [
|
|
2179
|
+
"washer",
|
|
2180
|
+
"dryer",
|
|
2181
|
+
"dishwasher"
|
|
2182
|
+
];
|
|
2183
|
+
var START_DWELL_MS = 3e4;
|
|
2184
|
+
var STOP_DWELL_MS = 6e5;
|
|
2185
|
+
var THRESHOLD_WATTS = 5;
|
|
2186
|
+
var APPLIANCE_DEFAULTS = {
|
|
2187
|
+
washer: {
|
|
2188
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2189
|
+
startDwellMs: START_DWELL_MS,
|
|
2190
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2191
|
+
},
|
|
2192
|
+
dryer: {
|
|
2193
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2194
|
+
startDwellMs: START_DWELL_MS,
|
|
2195
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2196
|
+
},
|
|
2197
|
+
dishwasher: {
|
|
2198
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2199
|
+
startDwellMs: START_DWELL_MS,
|
|
2200
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
var DEVICE_TYPE = {
|
|
2204
|
+
washer: DeviceType.Washer,
|
|
2205
|
+
dryer: DeviceType.Dryer,
|
|
2206
|
+
dishwasher: DeviceType.Dishwasher
|
|
2207
|
+
};
|
|
2208
|
+
function applianceDeviceType(kind) {
|
|
2209
|
+
return DEVICE_TYPE[kind];
|
|
2210
|
+
}
|
|
2211
|
+
function isApplianceKind(value) {
|
|
2212
|
+
return APPLIANCE_KINDS.some((kind) => kind === value);
|
|
2213
|
+
}
|
|
2214
|
+
/** The member step: one watts reading, from a sensor or from the plug itself. */
|
|
2215
|
+
function sourcePickForAppliance() {
|
|
2216
|
+
return {
|
|
2217
|
+
purpose: "reading",
|
|
2218
|
+
multiple: false,
|
|
2219
|
+
max: 1,
|
|
2220
|
+
deviceTypes: [DeviceType.Sensor, DeviceType.Switch],
|
|
2221
|
+
accept: [{
|
|
2222
|
+
cap: "power-meter",
|
|
2223
|
+
fieldPath: "watts",
|
|
2224
|
+
valueKind: "number"
|
|
2225
|
+
}],
|
|
2226
|
+
history: {
|
|
2227
|
+
required: false,
|
|
2228
|
+
minRetentionMs: null
|
|
2229
|
+
},
|
|
2230
|
+
mustBindCaps: [],
|
|
2231
|
+
exclude: []
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
//#endregion
|
|
2163
2235
|
//#region src/composition/source-ref.ts
|
|
2164
2236
|
/**
|
|
2165
2237
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
@@ -2237,7 +2309,20 @@ var GroupHelperSpecSchema = z.object({
|
|
|
2237
2309
|
/** Actuator groups only. Readings leave this unset. */
|
|
2238
2310
|
active: ActiveCriterionSchema.optional()
|
|
2239
2311
|
});
|
|
2240
|
-
var
|
|
2312
|
+
var ApplianceHelperSpecSchema = z.object({
|
|
2313
|
+
kind: z.literal("appliance"),
|
|
2314
|
+
templateId: z.literal(APPLIANCE_TEMPLATE_ID),
|
|
2315
|
+
appliance: z.enum(APPLIANCE_KINDS),
|
|
2316
|
+
thresholdWatts: z.number().positive(),
|
|
2317
|
+
startDwellMs: z.number().int().nonnegative(),
|
|
2318
|
+
stopDwellMs: z.number().int().nonnegative(),
|
|
2319
|
+
member: HelperMemberSchema
|
|
2320
|
+
});
|
|
2321
|
+
var HelperSpecSchema = z.discriminatedUnion("kind", [GroupHelperSpecSchema, ApplianceHelperSpecSchema]);
|
|
2322
|
+
/** Every member a helper reads. An appliance has one. */
|
|
2323
|
+
function helperMembers(spec) {
|
|
2324
|
+
return spec.kind === "group" ? spec.members : [spec.member];
|
|
2325
|
+
}
|
|
2241
2326
|
//#endregion
|
|
2242
2327
|
//#region src/composition/composition.ts
|
|
2243
2328
|
/**
|
|
@@ -2497,4 +2582,4 @@ function featureSources(feature) {
|
|
|
2497
2582
|
return featureFieldEntries(feature).map((e) => e.source);
|
|
2498
2583
|
}
|
|
2499
2584
|
//#endregion
|
|
2500
|
-
export {
|
|
2585
|
+
export { APPLIANCE_DEFAULTS as $, audioPlanFromEncodeProfile as $t, compositionFeatureEnabled as A, evaluateRose as At, ActiveCriterionSchema as B, evaluateSensorLevelEdge as Bt, CompositionTargetSchema as C, MAX_EXPRESSION_EVAL_STEPS as Ct, MAX_COMPOSITION_ITEMS as D, EXPRESSION_BUILTIN_NAMES as Dt, MAX_COMPOSITION_FIELDS_PER_FEATURE as E, EXPRESSION_BUILTINS as Et, featureFieldEntries as F, SOURCE_CAPS as Ft, GroupHelperSpecSchema as G, chooseFfmpegBinary as Gt, ApplianceHelperSpecSchema as H, sliceActiveValue as Ht, featureSources as I, SOURCE_CAP_ACTIVE_FIELD as It, HelperSpecSchema as J, getFfmpegArtifact as Jt, GroupTemplateIdSchema as K, ffmpegBinaryName as Kt, fieldReads as L, SOURCE_CAP_CHANGED_AT_FIELD as Lt, compositionReadKey as M, ExpressionEvalError as Mt, compositionSliceKey as N, ExpressionParseError as Nt, composedDeviceRef as O, disarmRoseMemory as Ot, compositionSourceKey as P, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Pt, CompositionSourceRefSchema as Q, AUDIO_PRESETS as Qt, ACTIVE_CRITERIA as R, SOURCE_DEVICE_TYPES as Rt, CompositionSchema as S, MAX_EXPRESSION_CALL_ARGS as St, MAX_COMPOSITION_FEATURES as T, RESERVED_BINDING_NAMES as Tt, BINARY_AGGREGATES as U, sliceChangedAt as Ut, AggregateReducerSchema as V, isSourceCap as Vt, GROUP_TEMPLATE_IDS as W, FFMPEG_PATH_ENV as Wt, NUMERIC_AGGREGATES as X, canonicalHash as Xt, MAX_HELPER_MEMBERS as Y, getFfmpegDownloadUrl as Yt, helperMembers as Z, Fmp4BoxSplitter as Zt, CompositionFromSourceSchema as _, tokenize as _t, CUSTOMIZATION_BLOCK_NAME_PREFIX as a, isSoftwareDecode as an, EXPRESSION_INJECTED_NOW as at, CompositionNewTargetSchema as b, MAX_EXPRESSION_AST_NODES as bt, CompositionCodeSourceSchema as c, resolveStreamMaps as cn, evaluateExpressionSource as ct, CompositionExpressionSourceSchema as d, validateExpressionSource as dt, buildAudioArgs as en, APPLIANCE_KINDS as et, CompositionFeatureSchema as f, createExpressionScope as ft, CompositionForwardCommandSchema as g, parseExpression as gt, CompositionFieldsFeatureSchema as h, compileExpressionSafe as ht, COMPOSITION_ITEM_KEY_RE as i, invocationFromEncodeProfile as in, sourcePickForAppliance as it, compositionItemFieldPath as j, isStatefulBuiltin as jt, composedDeviceStableId as k, evaluateCount as kt, CompositionCommandTargetSchema as l, evaluateStatefulExpressionCall as lt, CompositionFieldSourceSchema as m, compileExpression as mt, COMPOSER_ADDON_ID as n, buildInputArgs as nn, applianceDeviceType as nt, CompositionAggregateSourceSchema as o, logBannerArgs as on, cloneStatefulExpressionMemory as ot, CompositionFieldReadSchema as p, evaluateAst as pt, HelperMemberSchema as q, FFMPEG_RELEASE as qt, COMPOSITION_ITEM_ARRAY_PATH as r, buildVideoArgs as rn, isApplianceKind as rt, CompositionBindingSchema as s, pickVideoEncoder as sn, createStatefulExpressionMemory as st, COMPOSED_DEVICE_STABLE_ID_PREFIX as t, buildFfmpegArgs as tn, APPLIANCE_TEMPLATE_ID as tt, CompositionExistingTargetSchema as u, toExpressionValue as ut, CompositionItemEntrySchema as v, EXPRESSION_COMPILE_CACHE_CAPACITY as vt, MAX_COMPOSITION_CODE_LENGTH as w, MAX_EXPRESSION_SOURCE_LENGTH as wt, CompositionPassthroughFeatureSchema as x, MAX_EXPRESSION_BINDINGS as xt, CompositionLiteralBindingSchema as y, EXPRESSION_IDENTIFIER_RE as yt, AGGREGATE_REDUCERS as z, evaluateSensorEdge as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_err_msg = require("./err-msg-
|
|
1
|
+
const require_err_msg = require("./err-msg-U7lLUMNz.js");
|
|
2
2
|
let zod = require("zod");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
//#region src/ffmpeg/invocation.ts
|
|
@@ -2160,6 +2160,78 @@ function evaluateExpressionSource(expr, bindingValues, now, opts) {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
}
|
|
2162
2162
|
//#endregion
|
|
2163
|
+
//#region src/composition/helpers/appliance.ts
|
|
2164
|
+
/**
|
|
2165
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
2166
|
+
*
|
|
2167
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
2168
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
2169
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
2170
|
+
*
|
|
2171
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
2172
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
2173
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
2174
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
2175
|
+
* can move later without moving the others.
|
|
2176
|
+
*/
|
|
2177
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
2178
|
+
var APPLIANCE_KINDS = [
|
|
2179
|
+
"washer",
|
|
2180
|
+
"dryer",
|
|
2181
|
+
"dishwasher"
|
|
2182
|
+
];
|
|
2183
|
+
var START_DWELL_MS = 3e4;
|
|
2184
|
+
var STOP_DWELL_MS = 6e5;
|
|
2185
|
+
var THRESHOLD_WATTS = 5;
|
|
2186
|
+
var APPLIANCE_DEFAULTS = {
|
|
2187
|
+
washer: {
|
|
2188
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2189
|
+
startDwellMs: START_DWELL_MS,
|
|
2190
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2191
|
+
},
|
|
2192
|
+
dryer: {
|
|
2193
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2194
|
+
startDwellMs: START_DWELL_MS,
|
|
2195
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2196
|
+
},
|
|
2197
|
+
dishwasher: {
|
|
2198
|
+
thresholdWatts: THRESHOLD_WATTS,
|
|
2199
|
+
startDwellMs: START_DWELL_MS,
|
|
2200
|
+
stopDwellMs: STOP_DWELL_MS
|
|
2201
|
+
}
|
|
2202
|
+
};
|
|
2203
|
+
var DEVICE_TYPE = {
|
|
2204
|
+
washer: require_err_msg.DeviceType.Washer,
|
|
2205
|
+
dryer: require_err_msg.DeviceType.Dryer,
|
|
2206
|
+
dishwasher: require_err_msg.DeviceType.Dishwasher
|
|
2207
|
+
};
|
|
2208
|
+
function applianceDeviceType(kind) {
|
|
2209
|
+
return DEVICE_TYPE[kind];
|
|
2210
|
+
}
|
|
2211
|
+
function isApplianceKind(value) {
|
|
2212
|
+
return APPLIANCE_KINDS.some((kind) => kind === value);
|
|
2213
|
+
}
|
|
2214
|
+
/** The member step: one watts reading, from a sensor or from the plug itself. */
|
|
2215
|
+
function sourcePickForAppliance() {
|
|
2216
|
+
return {
|
|
2217
|
+
purpose: "reading",
|
|
2218
|
+
multiple: false,
|
|
2219
|
+
max: 1,
|
|
2220
|
+
deviceTypes: [require_err_msg.DeviceType.Sensor, require_err_msg.DeviceType.Switch],
|
|
2221
|
+
accept: [{
|
|
2222
|
+
cap: "power-meter",
|
|
2223
|
+
fieldPath: "watts",
|
|
2224
|
+
valueKind: "number"
|
|
2225
|
+
}],
|
|
2226
|
+
history: {
|
|
2227
|
+
required: false,
|
|
2228
|
+
minRetentionMs: null
|
|
2229
|
+
},
|
|
2230
|
+
mustBindCaps: [],
|
|
2231
|
+
exclude: []
|
|
2232
|
+
};
|
|
2233
|
+
}
|
|
2234
|
+
//#endregion
|
|
2163
2235
|
//#region src/composition/source-ref.ts
|
|
2164
2236
|
/**
|
|
2165
2237
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
@@ -2237,7 +2309,20 @@ var GroupHelperSpecSchema = zod.z.object({
|
|
|
2237
2309
|
/** Actuator groups only. Readings leave this unset. */
|
|
2238
2310
|
active: ActiveCriterionSchema.optional()
|
|
2239
2311
|
});
|
|
2240
|
-
var
|
|
2312
|
+
var ApplianceHelperSpecSchema = zod.z.object({
|
|
2313
|
+
kind: zod.z.literal("appliance"),
|
|
2314
|
+
templateId: zod.z.literal(APPLIANCE_TEMPLATE_ID),
|
|
2315
|
+
appliance: zod.z.enum(APPLIANCE_KINDS),
|
|
2316
|
+
thresholdWatts: zod.z.number().positive(),
|
|
2317
|
+
startDwellMs: zod.z.number().int().nonnegative(),
|
|
2318
|
+
stopDwellMs: zod.z.number().int().nonnegative(),
|
|
2319
|
+
member: HelperMemberSchema
|
|
2320
|
+
});
|
|
2321
|
+
var HelperSpecSchema = zod.z.discriminatedUnion("kind", [GroupHelperSpecSchema, ApplianceHelperSpecSchema]);
|
|
2322
|
+
/** Every member a helper reads. An appliance has one. */
|
|
2323
|
+
function helperMembers(spec) {
|
|
2324
|
+
return spec.kind === "group" ? spec.members : [spec.member];
|
|
2325
|
+
}
|
|
2241
2326
|
//#endregion
|
|
2242
2327
|
//#region src/composition/composition.ts
|
|
2243
2328
|
/**
|
|
@@ -2509,6 +2594,24 @@ Object.defineProperty(exports, "AGGREGATE_REDUCERS", {
|
|
|
2509
2594
|
return AGGREGATE_REDUCERS;
|
|
2510
2595
|
}
|
|
2511
2596
|
});
|
|
2597
|
+
Object.defineProperty(exports, "APPLIANCE_DEFAULTS", {
|
|
2598
|
+
enumerable: true,
|
|
2599
|
+
get: function() {
|
|
2600
|
+
return APPLIANCE_DEFAULTS;
|
|
2601
|
+
}
|
|
2602
|
+
});
|
|
2603
|
+
Object.defineProperty(exports, "APPLIANCE_KINDS", {
|
|
2604
|
+
enumerable: true,
|
|
2605
|
+
get: function() {
|
|
2606
|
+
return APPLIANCE_KINDS;
|
|
2607
|
+
}
|
|
2608
|
+
});
|
|
2609
|
+
Object.defineProperty(exports, "APPLIANCE_TEMPLATE_ID", {
|
|
2610
|
+
enumerable: true,
|
|
2611
|
+
get: function() {
|
|
2612
|
+
return APPLIANCE_TEMPLATE_ID;
|
|
2613
|
+
}
|
|
2614
|
+
});
|
|
2512
2615
|
Object.defineProperty(exports, "AUDIO_PRESETS", {
|
|
2513
2616
|
enumerable: true,
|
|
2514
2617
|
get: function() {
|
|
@@ -2527,6 +2630,12 @@ Object.defineProperty(exports, "AggregateReducerSchema", {
|
|
|
2527
2630
|
return AggregateReducerSchema;
|
|
2528
2631
|
}
|
|
2529
2632
|
});
|
|
2633
|
+
Object.defineProperty(exports, "ApplianceHelperSpecSchema", {
|
|
2634
|
+
enumerable: true,
|
|
2635
|
+
get: function() {
|
|
2636
|
+
return ApplianceHelperSpecSchema;
|
|
2637
|
+
}
|
|
2638
|
+
});
|
|
2530
2639
|
Object.defineProperty(exports, "BINARY_AGGREGATES", {
|
|
2531
2640
|
enumerable: true,
|
|
2532
2641
|
get: function() {
|
|
@@ -2869,6 +2978,12 @@ Object.defineProperty(exports, "SOURCE_DEVICE_TYPES", {
|
|
|
2869
2978
|
return SOURCE_DEVICE_TYPES;
|
|
2870
2979
|
}
|
|
2871
2980
|
});
|
|
2981
|
+
Object.defineProperty(exports, "applianceDeviceType", {
|
|
2982
|
+
enumerable: true,
|
|
2983
|
+
get: function() {
|
|
2984
|
+
return applianceDeviceType;
|
|
2985
|
+
}
|
|
2986
|
+
});
|
|
2872
2987
|
Object.defineProperty(exports, "audioPlanFromEncodeProfile", {
|
|
2873
2988
|
enumerable: true,
|
|
2874
2989
|
get: function() {
|
|
@@ -3067,12 +3182,24 @@ Object.defineProperty(exports, "getFfmpegDownloadUrl", {
|
|
|
3067
3182
|
return getFfmpegDownloadUrl;
|
|
3068
3183
|
}
|
|
3069
3184
|
});
|
|
3185
|
+
Object.defineProperty(exports, "helperMembers", {
|
|
3186
|
+
enumerable: true,
|
|
3187
|
+
get: function() {
|
|
3188
|
+
return helperMembers;
|
|
3189
|
+
}
|
|
3190
|
+
});
|
|
3070
3191
|
Object.defineProperty(exports, "invocationFromEncodeProfile", {
|
|
3071
3192
|
enumerable: true,
|
|
3072
3193
|
get: function() {
|
|
3073
3194
|
return invocationFromEncodeProfile;
|
|
3074
3195
|
}
|
|
3075
3196
|
});
|
|
3197
|
+
Object.defineProperty(exports, "isApplianceKind", {
|
|
3198
|
+
enumerable: true,
|
|
3199
|
+
get: function() {
|
|
3200
|
+
return isApplianceKind;
|
|
3201
|
+
}
|
|
3202
|
+
});
|
|
3076
3203
|
Object.defineProperty(exports, "isSoftwareDecode", {
|
|
3077
3204
|
enumerable: true,
|
|
3078
3205
|
get: function() {
|
|
@@ -3127,6 +3254,12 @@ Object.defineProperty(exports, "sliceChangedAt", {
|
|
|
3127
3254
|
return sliceChangedAt;
|
|
3128
3255
|
}
|
|
3129
3256
|
});
|
|
3257
|
+
Object.defineProperty(exports, "sourcePickForAppliance", {
|
|
3258
|
+
enumerable: true,
|
|
3259
|
+
get: function() {
|
|
3260
|
+
return sourcePickForAppliance;
|
|
3261
|
+
}
|
|
3262
|
+
});
|
|
3130
3263
|
Object.defineProperty(exports, "toExpressionValue", {
|
|
3131
3264
|
enumerable: true,
|
|
3132
3265
|
get: function() {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a washer, dryer or dishwasher leaves CamStack.
|
|
3
|
+
*
|
|
4
|
+
* Home Assistant has no laundry domain: the device is offered, and what
|
|
5
|
+
* travels is its power reading. The others have a laundry type that this
|
|
6
|
+
* export cannot honour yet, so they are named and withheld.
|
|
7
|
+
*/
|
|
8
|
+
import { DeviceType } from './device-type.js';
|
|
9
|
+
export type PlugApplianceType = DeviceType.Washer | DeviceType.Dryer | DeviceType.Dishwasher;
|
|
10
|
+
export declare const PLUG_APPLIANCE_TYPES: readonly PlugApplianceType[];
|
|
11
|
+
export interface ApplianceExported {
|
|
12
|
+
readonly exported: true;
|
|
13
|
+
/** What the other ecosystem actually receives. */
|
|
14
|
+
readonly as: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ApplianceNotExported {
|
|
17
|
+
readonly exported: false;
|
|
18
|
+
readonly reason: string;
|
|
19
|
+
}
|
|
20
|
+
export type ApplianceExportDecision = ApplianceExported | ApplianceNotExported;
|
|
21
|
+
export type ApplianceExportEcosystem = 'ha' | 'homekit' | 'alexa' | 'google' | 'matter';
|
|
22
|
+
export declare const APPLIANCE_EXPORT: Readonly<Record<ApplianceExportEcosystem, Readonly<Record<PlugApplianceType, ApplianceExportDecision>>>>;
|
|
23
|
+
export declare function isPlugApplianceType(deviceType: string): deviceType is PlugApplianceType;
|
|
24
|
+
/** The decision for this ecosystem, or null when the type is not an appliance. */
|
|
25
|
+
export declare function applianceExport(ecosystem: ApplianceExportEcosystem, deviceType: string): ApplianceExportDecision | null;
|
|
@@ -238,6 +238,12 @@ export interface VocabStateWording {
|
|
|
238
238
|
readonly quantity?: L10n;
|
|
239
239
|
readonly icon?: VocabIcon;
|
|
240
240
|
}
|
|
241
|
+
/** Re-wording of one declared event for a kind of device. */
|
|
242
|
+
export interface VocabEventWording {
|
|
243
|
+
readonly label?: L10n;
|
|
244
|
+
readonly phrase?: L10n;
|
|
245
|
+
readonly icon?: VocabIcon;
|
|
246
|
+
}
|
|
241
247
|
/** Wording that differs for a device type or role (a switch that is a siren). */
|
|
242
248
|
export interface VocabWording<C extends VocabCapName> {
|
|
243
249
|
/** Keyed by action id. */
|
|
@@ -245,6 +251,9 @@ export interface VocabWording<C extends VocabCapName> {
|
|
|
245
251
|
readonly state?: {
|
|
246
252
|
readonly [F in CapStatusField<C>]?: VocabStateWording;
|
|
247
253
|
};
|
|
254
|
+
readonly events?: {
|
|
255
|
+
readonly [E in CapEventName<C>]?: VocabEventWording;
|
|
256
|
+
};
|
|
248
257
|
}
|
|
249
258
|
/** Overrides, keyed in the same map: a role beats a type. */
|
|
250
259
|
export interface VocabOverrides<C extends VocabCapName> {
|
|
@@ -378,6 +387,7 @@ export type LooseVocabStateTrigger = LooseBooleanStateTrigger | LooseNumericStat
|
|
|
378
387
|
export interface LooseVocabWording {
|
|
379
388
|
readonly actions?: Readonly<Record<string, VocabActionWording>>;
|
|
380
389
|
readonly state?: Readonly<Record<string, VocabStateWording | undefined>>;
|
|
390
|
+
readonly events?: Readonly<Record<string, VocabEventWording | undefined>>;
|
|
381
391
|
}
|
|
382
392
|
/** Overrides as a consumer reads them. */
|
|
383
393
|
export interface LooseVocabOverrides {
|
|
@@ -91,8 +91,14 @@ export declare enum DeviceType {
|
|
|
91
91
|
PetFeeder = "pet-feeder",
|
|
92
92
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
93
93
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
94
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
95
|
-
|
|
94
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
95
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
96
|
+
Dishwasher = "dishwasher",
|
|
97
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
98
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
99
|
+
Washer = "washer",
|
|
100
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
101
|
+
Dryer = "dryer"
|
|
96
102
|
}
|
|
97
103
|
export declare enum DeviceFeature {
|
|
98
104
|
BatteryOperated = "battery-operated",
|
|
@@ -92,8 +92,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
92
92
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
93
93
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
94
94
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
95
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
95
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
96
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
96
97
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
98
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
99
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
100
|
+
DeviceType["Washer"] = "washer";
|
|
101
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
102
|
+
DeviceType["Dryer"] = "dryer";
|
|
97
103
|
return DeviceType;
|
|
98
104
|
}({});
|
|
99
105
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -92,8 +92,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
92
92
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
93
93
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
94
94
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
95
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
95
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
96
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
96
97
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
98
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
99
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
100
|
+
DeviceType["Washer"] = "washer";
|
|
101
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
102
|
+
DeviceType["Dryer"] = "dryer";
|
|
97
103
|
return DeviceType;
|
|
98
104
|
}({});
|
|
99
105
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -56,7 +56,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
56
56
|
readonly targets: readonly [{
|
|
57
57
|
readonly id: 'items';
|
|
58
58
|
readonly cardinality: 'keyedArray';
|
|
59
|
-
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher];
|
|
59
|
+
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer];
|
|
60
60
|
readonly apply: 'add';
|
|
61
61
|
readonly vocabularyCap: 'consumables';
|
|
62
62
|
readonly sources: readonly [];
|
|
@@ -211,7 +211,7 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
|
|
|
211
211
|
readonly targets: readonly [{
|
|
212
212
|
readonly id: 'running';
|
|
213
213
|
readonly cardinality: 'scalar';
|
|
214
|
-
readonly deviceTypes: readonly [DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder];
|
|
214
|
+
readonly deviceTypes: readonly [DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder];
|
|
215
215
|
readonly apply: 'add';
|
|
216
216
|
readonly vocabularyCap: 'running-state';
|
|
217
217
|
readonly vocabularyStateField: 'running';
|
package/dist/index.d.ts
CHANGED
|
@@ -217,6 +217,7 @@ export { DeviceRuntimeState } from './device/device-runtime-state.js';
|
|
|
217
217
|
export type { SliceEventBus, SliceHandle, SliceHandleApi, SliceHandleSource, } from './device/device-state-handle.js';
|
|
218
218
|
export { createEventBusSliceSource, createLazyTrpcSource, createMirrorSource, createSliceHandle, } from './device/device-state-handle.js';
|
|
219
219
|
export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType } from './device/device-type.js';
|
|
220
|
+
export { APPLIANCE_EXPORT, type ApplianceExportDecision, type ApplianceExportEcosystem, type ApplianceExported, type ApplianceNotExported, type PlugApplianceType, PLUG_APPLIANCE_TYPES, applianceExport, isPlugApplianceType, } from './device/appliance-export.js';
|
|
220
221
|
export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './device/features.js';
|
|
221
222
|
export type { IconCategoryId, IconEntry, IconHit, IconKey, } from './device/icon-catalog.js';
|
|
222
223
|
export { ICON_CATALOG_SOURCE, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, canonicalIconKey, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, resolveIconKey, searchIcons, } from './device/icon-catalog.js';
|