@camstack/types 1.2.548 → 1.2.550
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 +33 -0
- package/dist/addon/addon-instance.d.ts +24 -0
- package/dist/addon/build-addon-route-provider.d.ts +2 -0
- package/dist/addon.js +5 -5
- package/dist/addon.mjs +5 -5
- package/dist/automation/index.d.ts +4 -3
- package/dist/automation/recipe.d.ts +12105 -604
- package/dist/automation/scheduler.d.ts +7 -0
- package/dist/automation/step-runner.d.ts +70 -0
- package/dist/automation/trace.d.ts +252 -145
- package/dist/automation/wait-until.d.ts +32 -0
- package/dist/automation/when-site.d.ts +1 -1
- package/dist/capabilities/accessories.cap.d.ts +1 -1
- package/dist/capabilities/actions.cap.d.ts +1 -178
- package/dist/capabilities/addon-routes.cap.d.ts +3 -0
- package/dist/capabilities/battery.cap.d.ts +2 -2
- package/dist/capabilities/capability-definition.d.ts +47 -1
- package/dist/capabilities/climate-control.cap.d.ts +8 -1
- package/dist/capabilities/core-blocks.cap.d.ts +119 -8723
- package/dist/capabilities/customize-catalog.d.ts +3 -1
- package/dist/capabilities/customize-spec.d.ts +26 -2
- package/dist/capabilities/device-manager.cap.d.ts +6 -0
- package/dist/capabilities/event-emitter.cap.d.ts +99 -3
- package/dist/capabilities/event-vocabulary.d.ts +99 -0
- package/dist/capabilities/fan-control.cap.d.ts +248 -0
- package/dist/capabilities/fan-presets.cap.d.ts +172 -536
- package/dist/capabilities/group-active.cap.d.ts +1 -1
- package/dist/capabilities/group-commands.cap.d.ts +1 -1
- package/dist/capabilities/group-status.cap.d.ts +1 -1
- package/dist/capabilities/heating-valve.cap.d.ts +1 -1
- package/dist/capabilities/hero-layout.cap.d.ts +2 -0
- package/dist/capabilities/humidifier.cap.d.ts +5 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +1 -1
- package/dist/capabilities/index.d.ts +5 -4
- package/dist/capabilities/media-player.cap.d.ts +7 -0
- package/dist/capabilities/oauth-integration.cap.d.ts +8 -0
- package/dist/capabilities/pet-fountain.cap.d.ts +5 -0
- package/dist/capabilities/power-meter.cap.d.ts +5 -5
- package/dist/capabilities/power-source.cap.d.ts +5 -0
- package/dist/capabilities/running-state.cap.d.ts +2 -2
- package/dist/capabilities/schedulers.cap.d.ts +1 -178
- package/dist/capabilities/sso-bridge.cap.d.ts +3 -0
- package/dist/capabilities/switch.cap.d.ts +1 -1
- package/dist/capabilities/temperature-sensor.cap.d.ts +1 -1
- package/dist/capabilities/timed-run.cap.d.ts +19 -5
- package/dist/capabilities/user-management.cap.d.ts +4 -0
- package/dist/capabilities/water-heater.cap.d.ts +7 -0
- package/dist/client.js +7 -11
- package/dist/client.mjs +7 -11
- package/dist/{composed-stable-id-DrGLxjVF.js → composed-stable-id-CDNLq7Y8.js} +27 -10
- package/dist/{composed-stable-id-DFNyOFzz.mjs → composed-stable-id-CPp3votu.mjs} +27 -10
- package/dist/composition/composition-report.d.ts +6 -0
- package/dist/composition/evaluate-field.d.ts +7 -0
- package/dist/composition/field-kinds.d.ts +12 -1
- package/dist/composition/helpers/index.d.ts +1 -1
- package/dist/composition/helpers/source-pick.d.ts +0 -5
- package/dist/composition/power-source-link.d.ts +15 -0
- package/dist/composition/state-fields.d.ts +2 -0
- package/dist/composition/validate-composition.d.ts +15 -1
- package/dist/device/base-device-provider.d.ts +13 -0
- package/dist/device/device-control-resolution.d.ts +1 -33
- package/dist/device/device-kind.d.ts +36 -0
- package/dist/device/device-management.d.ts +3 -0
- package/dist/device/device-type.d.ts +27 -10
- package/dist/device/hero/hero-fragment.d.ts +2 -0
- package/dist/device/hero/hero-layout.d.ts +1 -3
- package/dist/device/hero/hero-look.d.ts +18 -12
- package/dist/device/hero/hero-scene.d.ts +9 -3
- package/dist/device/index.d.ts +2 -1
- package/dist/device/power-switch.d.ts +82 -0
- package/dist/device/schema-fields.d.ts +10 -1
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-input-defaults.d.ts +1 -1
- package/dist/generated/collection-array-methods.d.ts +1 -1
- package/dist/generated/customize-catalog.d.ts +257 -8
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-device-selectors.d.ts +1 -1
- package/dist/{implemented-methods-M5aguGon.mjs → implemented-methods-5YMDeE3f.mjs} +1 -1
- package/dist/{implemented-methods-8AU92riC.js → implemented-methods-Cj65uy2F.js} +1 -1
- package/dist/index.d.ts +11 -6
- package/dist/index.js +2386 -494
- package/dist/index.mjs +2312 -488
- package/dist/interfaces/addon-routes.d.ts +13 -0
- package/dist/interfaces/config-ui.d.ts +15 -24
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-D_NpiLFP.mjs → sleep-D0roI_CZ.mjs} +50 -1
- package/dist/{sleep-vzHEmsrO.js → sleep-dcR4vBFG.js} +50 -1
- package/package.json +1 -1
|
@@ -270,184 +270,7 @@ export declare const actionsCapability: {
|
|
|
270
270
|
readonly getTraces: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
271
271
|
actionId: z.ZodString;
|
|
272
272
|
}, z.core.$strip>, z.ZodObject<{
|
|
273
|
-
traces: z.ZodArray<z.
|
|
274
|
-
runId: z.ZodString;
|
|
275
|
-
startedAt: z.ZodNumber;
|
|
276
|
-
endedAt: z.ZodNumber;
|
|
277
|
-
trigger: z.ZodObject<{
|
|
278
|
-
kind: z.ZodString;
|
|
279
|
-
path: z.ZodOptional<z.ZodString>;
|
|
280
|
-
outcome: z.ZodEnum<{
|
|
281
|
-
fail: "fail";
|
|
282
|
-
pass: "pass";
|
|
283
|
-
}>;
|
|
284
|
-
reason: z.ZodString;
|
|
285
|
-
vars: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
|
|
286
|
-
hold: z.ZodOptional<z.ZodObject<{
|
|
287
|
-
phase: z.ZodEnum<{
|
|
288
|
-
cancelled: "cancelled";
|
|
289
|
-
fired: "fired";
|
|
290
|
-
pending: "pending";
|
|
291
|
-
reseeded: "reseeded";
|
|
292
|
-
}>;
|
|
293
|
-
ms: z.ZodNumber;
|
|
294
|
-
mode: z.ZodEnum<{
|
|
295
|
-
held: "held";
|
|
296
|
-
stable: "stable";
|
|
297
|
-
}>;
|
|
298
|
-
since: z.ZodOptional<z.ZodNumber>;
|
|
299
|
-
deadline: z.ZodOptional<z.ZodNumber>;
|
|
300
|
-
}, z.core.$strip>>;
|
|
301
|
-
}, z.core.$strip>;
|
|
302
|
-
conditions: z.ZodArray<z.ZodObject<{
|
|
303
|
-
path: z.ZodString;
|
|
304
|
-
kind: z.ZodEnum<{
|
|
305
|
-
all: "all";
|
|
306
|
-
any: "any";
|
|
307
|
-
condition: "condition";
|
|
308
|
-
detection: "detection";
|
|
309
|
-
"device-becomes": "device-becomes";
|
|
310
|
-
"device-event": "device-event";
|
|
311
|
-
"device-is": "device-is";
|
|
312
|
-
expression: "expression";
|
|
313
|
-
interval: "interval";
|
|
314
|
-
manual: "manual";
|
|
315
|
-
not: "not";
|
|
316
|
-
schedule: "schedule";
|
|
317
|
-
stationary: "stationary";
|
|
318
|
-
"stationary-present": "stationary-present";
|
|
319
|
-
"time-is": "time-is";
|
|
320
|
-
"triggered-by": "triggered-by";
|
|
321
|
-
}>;
|
|
322
|
-
outcome: z.ZodEnum<{
|
|
323
|
-
fail: "fail";
|
|
324
|
-
"not-evaluated": "not-evaluated";
|
|
325
|
-
pass: "pass";
|
|
326
|
-
}>;
|
|
327
|
-
reason: z.ZodString;
|
|
328
|
-
deviceId: z.ZodOptional<z.ZodNumber>;
|
|
329
|
-
cap: z.ZodOptional<z.ZodString>;
|
|
330
|
-
fieldPath: z.ZodOptional<z.ZodString>;
|
|
331
|
-
operator: z.ZodOptional<z.ZodString>;
|
|
332
|
-
expected: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
|
|
333
|
-
observed: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>;
|
|
334
|
-
}, z.core.$strip>>;
|
|
335
|
-
verdict: z.ZodOptional<z.ZodObject<{
|
|
336
|
-
mode: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
337
|
-
mode: z.ZodLiteral<"single">;
|
|
338
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
339
|
-
mode: z.ZodLiteral<"restart">;
|
|
340
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
341
|
-
mode: z.ZodLiteral<"queued">;
|
|
342
|
-
max: z.ZodNumber;
|
|
343
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
344
|
-
mode: z.ZodLiteral<"parallel">;
|
|
345
|
-
max: z.ZodNumber;
|
|
346
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
347
|
-
mode: z.ZodLiteral<"cooldown">;
|
|
348
|
-
minutes: z.ZodNumber;
|
|
349
|
-
}, z.core.$strip>], "mode">;
|
|
350
|
-
decision: z.ZodEnum<{
|
|
351
|
-
bypass: "bypass";
|
|
352
|
-
cooldown: "cooldown";
|
|
353
|
-
drop: "drop";
|
|
354
|
-
queued: "queued";
|
|
355
|
-
restart: "restart";
|
|
356
|
-
run: "run";
|
|
357
|
-
}>;
|
|
358
|
-
reason: z.ZodString;
|
|
359
|
-
}, z.core.$strip>>;
|
|
360
|
-
steps: z.ZodArray<z.ZodObject<{
|
|
361
|
-
path: z.ZodString;
|
|
362
|
-
kind: z.ZodString;
|
|
363
|
-
cap: z.ZodOptional<z.ZodString>;
|
|
364
|
-
method: z.ZodOptional<z.ZodString>;
|
|
365
|
-
actionId: z.ZodOptional<z.ZodString>;
|
|
366
|
-
deviceId: z.ZodOptional<z.ZodNumber>;
|
|
367
|
-
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
368
|
-
deviceId: z.ZodNumber;
|
|
369
|
-
outcome: z.ZodEnum<{
|
|
370
|
-
error: "error";
|
|
371
|
-
ok: "ok";
|
|
372
|
-
}>;
|
|
373
|
-
message: z.ZodOptional<z.ZodString>;
|
|
374
|
-
}, z.core.$strip>>>;
|
|
375
|
-
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
376
|
-
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
377
|
-
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>>;
|
|
378
|
-
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
379
|
-
condition: z.ZodOptional<z.ZodEnum<{
|
|
380
|
-
false: "false";
|
|
381
|
-
true: "true";
|
|
382
|
-
unknown: "unknown";
|
|
383
|
-
}>>;
|
|
384
|
-
conditionReason: z.ZodOptional<z.ZodString>;
|
|
385
|
-
outcome: z.ZodEnum<{
|
|
386
|
-
empty: "empty";
|
|
387
|
-
error: "error";
|
|
388
|
-
"not-run": "not-run";
|
|
389
|
-
ok: "ok";
|
|
390
|
-
skipped: "skipped";
|
|
391
|
-
}>;
|
|
392
|
-
message: z.ZodOptional<z.ZodString>;
|
|
393
|
-
else: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
394
|
-
path: z.ZodString;
|
|
395
|
-
kind: z.ZodString;
|
|
396
|
-
cap: z.ZodOptional<z.ZodString>;
|
|
397
|
-
method: z.ZodOptional<z.ZodString>;
|
|
398
|
-
actionId: z.ZodOptional<z.ZodString>;
|
|
399
|
-
deviceId: z.ZodOptional<z.ZodNumber>;
|
|
400
|
-
devices: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
401
|
-
deviceId: z.ZodNumber;
|
|
402
|
-
outcome: z.ZodEnum<{
|
|
403
|
-
error: "error";
|
|
404
|
-
ok: "ok";
|
|
405
|
-
}>;
|
|
406
|
-
message: z.ZodOptional<z.ZodString>;
|
|
407
|
-
}, z.core.$strip>>>;
|
|
408
|
-
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
409
|
-
endedAt: z.ZodOptional<z.ZodNumber>;
|
|
410
|
-
args: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>]>>>;
|
|
411
|
-
templates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
412
|
-
condition: z.ZodOptional<z.ZodEnum<{
|
|
413
|
-
false: "false";
|
|
414
|
-
true: "true";
|
|
415
|
-
unknown: "unknown";
|
|
416
|
-
}>>;
|
|
417
|
-
conditionReason: z.ZodOptional<z.ZodString>;
|
|
418
|
-
outcome: z.ZodEnum<{
|
|
419
|
-
empty: "empty";
|
|
420
|
-
error: "error";
|
|
421
|
-
"not-run": "not-run";
|
|
422
|
-
ok: "ok";
|
|
423
|
-
skipped: "skipped";
|
|
424
|
-
}>;
|
|
425
|
-
message: z.ZodOptional<z.ZodString>;
|
|
426
|
-
}, z.core.$strip>>>;
|
|
427
|
-
}, z.core.$strip>>;
|
|
428
|
-
outcome: z.ZodEnum<{
|
|
429
|
-
aborted: "aborted";
|
|
430
|
-
failed: "failed";
|
|
431
|
-
ran: "ran";
|
|
432
|
-
"skipped-conditions": "skipped-conditions";
|
|
433
|
-
"skipped-cooldown": "skipped-cooldown";
|
|
434
|
-
"skipped-overlap": "skipped-overlap";
|
|
435
|
-
"skipped-trigger": "skipped-trigger";
|
|
436
|
-
}>;
|
|
437
|
-
repeat: z.ZodNumber;
|
|
438
|
-
lastAt: z.ZodNumber;
|
|
439
|
-
scheduler: z.ZodOptional<z.ZodEnum<{
|
|
440
|
-
"condition-false": "condition-false";
|
|
441
|
-
done: "done";
|
|
442
|
-
failed: "failed";
|
|
443
|
-
"gave-up": "gave-up";
|
|
444
|
-
held: "held";
|
|
445
|
-
inactive: "inactive";
|
|
446
|
-
missed: "missed";
|
|
447
|
-
overridden: "overridden";
|
|
448
|
-
"suspended-manual": "suspended-manual";
|
|
449
|
-
}>>;
|
|
450
|
-
}, z.core.$strip>>;
|
|
273
|
+
traces: z.ZodArray<z.ZodType<import("../index.js").AutomationRunTrace, unknown, z.core.$ZodTypeInternals<import("../index.js").AutomationRunTrace, unknown>>>;
|
|
451
274
|
}, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
452
275
|
/**
|
|
453
276
|
* Internal actions only; a read-only (addon) entry is refused with `[read-only]`.
|
|
@@ -15,6 +15,7 @@ declare const InvokeRequestSchema: z.ZodObject<{
|
|
|
15
15
|
query: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
16
16
|
body: z.ZodUnknown;
|
|
17
17
|
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
18
|
+
instanceId: z.ZodOptional<z.ZodString>;
|
|
18
19
|
user: z.ZodOptional<z.ZodObject<{
|
|
19
20
|
id: z.ZodString;
|
|
20
21
|
username: z.ZodString;
|
|
@@ -53,6 +54,7 @@ export declare const addonRoutesCapability: {
|
|
|
53
54
|
rateLimit: z.ZodOptional<z.ZodEnum<{
|
|
54
55
|
auth: "auth";
|
|
55
56
|
}>>;
|
|
57
|
+
perInstance: z.ZodOptional<z.ZodBoolean>;
|
|
56
58
|
}, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
|
|
57
59
|
/**
|
|
58
60
|
* Cross-process dispatch entry point. Forked addons implement this
|
|
@@ -69,6 +71,7 @@ export declare const addonRoutesCapability: {
|
|
|
69
71
|
query: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
70
72
|
body: z.ZodUnknown;
|
|
71
73
|
headers: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
74
|
+
instanceId: z.ZodOptional<z.ZodString>;
|
|
72
75
|
user: z.ZodOptional<z.ZodObject<{
|
|
73
76
|
id: z.ZodString;
|
|
74
77
|
username: z.ZodString;
|
|
@@ -29,7 +29,7 @@ export declare const batteryCapability: {
|
|
|
29
29
|
readonly scope: 'device';
|
|
30
30
|
readonly deviceNative: true;
|
|
31
31
|
readonly mode: 'singleton';
|
|
32
|
-
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.
|
|
32
|
+
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter];
|
|
33
33
|
readonly methods: {
|
|
34
34
|
/**
|
|
35
35
|
* Explicitly wake the camera from low-power sleep ahead of a
|
|
@@ -177,7 +177,7 @@ export declare const batteryCapability: {
|
|
|
177
177
|
readonly cap: 'battery';
|
|
178
178
|
readonly stateField: 'level';
|
|
179
179
|
};
|
|
180
|
-
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.
|
|
180
|
+
readonly deviceTypes: readonly [DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter];
|
|
181
181
|
readonly apply: 'add';
|
|
182
182
|
readonly path: 'level';
|
|
183
183
|
readonly sources: readonly [{
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
13
13
|
*/
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import { DeviceType } from '../device/device-type.js';
|
|
15
|
+
import { type DeviceRole, DeviceType } from '../device/device-type.js';
|
|
16
16
|
import type { ConfigUISchemaWithValues } from '../interfaces/config-ui.js';
|
|
17
17
|
import type { ExtensionSlotDescriptor } from '../device-extension/slot-descriptor.js';
|
|
18
18
|
import type { MethodRoleDecl } from '../auth/viewer-access.js';
|
|
@@ -531,6 +531,37 @@ export type ComposedMethodAnswer = {
|
|
|
531
531
|
readonly kind: 'slice';
|
|
532
532
|
readonly field: string;
|
|
533
533
|
};
|
|
534
|
+
/** A boolean slice field and its setter, e.g. `humidifier.on` + `setOn({ on })`. */
|
|
535
|
+
export interface PowerHintField {
|
|
536
|
+
readonly kind: 'field';
|
|
537
|
+
readonly field: string;
|
|
538
|
+
readonly set: string;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* A state field read as on unless it is one of `offValues`, and two argument-
|
|
542
|
+
* less methods, e.g. `media-player.state` + `turnOn` / `turnOff`.
|
|
543
|
+
*/
|
|
544
|
+
export interface PowerHintMethods {
|
|
545
|
+
readonly kind: 'methods';
|
|
546
|
+
readonly field: string;
|
|
547
|
+
readonly offValues: readonly string[];
|
|
548
|
+
readonly on: string;
|
|
549
|
+
readonly off: string;
|
|
550
|
+
}
|
|
551
|
+
/**
|
|
552
|
+
* A mode whose `offValue` is off, e.g. `climate-control.mode` + `setMode({ mode })`.
|
|
553
|
+
* On restores `lastField`, the last non-off mode kept in the same slice by
|
|
554
|
+
* `registerPowerSwitch`; with none it refuses (`no-last-mode`), never guesses.
|
|
555
|
+
*/
|
|
556
|
+
export interface PowerHintMode {
|
|
557
|
+
readonly kind: 'mode';
|
|
558
|
+
readonly field: string;
|
|
559
|
+
readonly offValue: string;
|
|
560
|
+
readonly set: string;
|
|
561
|
+
readonly lastField: string;
|
|
562
|
+
}
|
|
563
|
+
/** Which field and method of a cap are the device's own power (#462). */
|
|
564
|
+
export type CapabilityPowerHint = PowerHintField | PowerHintMethods | PowerHintMode;
|
|
534
565
|
/**
|
|
535
566
|
* Full definition of a capability — the single source of truth for the
|
|
536
567
|
* functional contract (methods + events).
|
|
@@ -701,8 +732,23 @@ export interface CapabilityDefinition<TName extends string = string, TMethods ex
|
|
|
701
732
|
* vendor providers carry NO contribution methods.
|
|
702
733
|
*/
|
|
703
734
|
readonly deviceConfig?: DeviceConfigSpec;
|
|
735
|
+
/**
|
|
736
|
+
* Which field and method of THIS cap are the device's own power (#462). The
|
|
737
|
+
* owner registers `switch` for such a device through `registerPowerSwitch`,
|
|
738
|
+
* which reads `switch.on` from this cap's slice and routes `setState` here.
|
|
739
|
+
* Behavioural metadata, so it lives here and only here (D4).
|
|
740
|
+
* `scripts/check-power-hint.ts` refuses another on/off field or setter.
|
|
741
|
+
*/
|
|
742
|
+
readonly power?: CapabilityPowerHint;
|
|
704
743
|
/** For `scope: 'device'` caps — allowed device types. Omit → applies to every type. */
|
|
705
744
|
readonly deviceTypes?: readonly DeviceType[];
|
|
745
|
+
/**
|
|
746
|
+
* Narrows `deviceTypes` by role (D1033): for a type named here, the cap is
|
|
747
|
+
* offered only on a device carrying one of these roles. A type absent from
|
|
748
|
+
* this map keeps every role. `timed-run` is offered on a `switch` only when
|
|
749
|
+
* it is a `switch-heater`.
|
|
750
|
+
*/
|
|
751
|
+
readonly deviceRoles?: Readonly<Partial<Record<DeviceType, readonly DeviceRole[]>>>;
|
|
706
752
|
/**
|
|
707
753
|
* Extension slots this capability OWNS (D648): the ways a device of this
|
|
708
754
|
* kind can be extended by other devices, served by this cap's owner over
|
|
@@ -92,7 +92,14 @@ export declare const climateControlCapability: {
|
|
|
92
92
|
readonly scope: 'device';
|
|
93
93
|
readonly deviceNative: true;
|
|
94
94
|
readonly mode: 'singleton';
|
|
95
|
-
readonly deviceTypes: readonly [DeviceType.
|
|
95
|
+
readonly deviceTypes: readonly [DeviceType.Climate];
|
|
96
|
+
readonly power: {
|
|
97
|
+
readonly kind: 'mode';
|
|
98
|
+
readonly field: 'mode';
|
|
99
|
+
readonly offValue: 'off';
|
|
100
|
+
readonly set: 'setMode';
|
|
101
|
+
readonly lastField: 'lastActiveMode';
|
|
102
|
+
};
|
|
96
103
|
readonly methods: {
|
|
97
104
|
readonly setMode: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
|
|
98
105
|
deviceId: z.ZodNumber;
|