@camstack/types 1.2.560 → 1.2.562
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 +22 -0
- package/dist/addon/instances-of-cap.d.ts +7 -2
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/automation/codegen.d.ts +6 -0
- package/dist/automation/recipe-literal.d.ts +35 -0
- package/dist/automation/recipe.d.ts +166 -120
- package/dist/automation/template-link.d.ts +206 -0
- package/dist/capabilities/accessories.cap.d.ts +6 -0
- package/dist/capabilities/action-source.cap.d.ts +3 -0
- package/dist/capabilities/actions.cap.d.ts +3 -0
- package/dist/capabilities/addon-pages-source.cap.d.ts +3 -0
- package/dist/capabilities/addon-pages.cap.d.ts +3 -0
- package/dist/capabilities/addon-routes.cap.d.ts +3 -0
- package/dist/capabilities/addon-settings.cap.d.ts +3 -0
- package/dist/capabilities/addon-widgets-source.cap.d.ts +3 -0
- package/dist/capabilities/addon-widgets.cap.d.ts +3 -0
- package/dist/capabilities/addons.cap.d.ts +3 -0
- package/dist/capabilities/admin-ui.cap.d.ts +3 -0
- package/dist/capabilities/air-quality-sensor.cap.d.ts +39 -0
- package/dist/capabilities/alarm-panel.cap.d.ts +60 -14
- package/dist/capabilities/alerts.cap.d.ts +3 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +12 -0
- package/dist/capabilities/audio-analysis.cap.d.ts +4 -0
- package/dist/capabilities/audio-analyzer.cap.d.ts +3 -0
- package/dist/capabilities/audio-codec.cap.d.ts +3 -0
- package/dist/capabilities/audio-metrics.cap.d.ts +4 -0
- package/dist/capabilities/auth-provider.cap.d.ts +3 -0
- package/dist/capabilities/automation-control.cap.d.ts +19 -0
- package/dist/capabilities/backup.cap.d.ts +3 -0
- package/dist/capabilities/battery.cap.d.ts +53 -0
- package/dist/capabilities/binary.cap.d.ts +136 -0
- package/dist/capabilities/board-key-source.cap.d.ts +3 -0
- package/dist/capabilities/brightness.cap.d.ts +13 -0
- package/dist/capabilities/broker.cap.d.ts +3 -0
- package/dist/capabilities/button.cap.d.ts +4 -0
- package/dist/capabilities/calendar-source.cap.d.ts +3 -0
- package/dist/capabilities/calendars.cap.d.ts +3 -0
- package/dist/capabilities/camera-credentials.cap.d.ts +4 -0
- package/dist/capabilities/camera-grid-layout.cap.d.ts +4 -0
- package/dist/capabilities/camera-pipeline-config.cap.d.ts +4 -0
- package/dist/capabilities/camera-streams.cap.d.ts +4 -0
- package/dist/capabilities/capability-definition.d.ts +37 -8
- package/dist/capabilities/carbon-monoxide.cap.d.ts +12 -0
- package/dist/capabilities/climate-control.cap.d.ts +68 -12
- package/dist/capabilities/cluster-update.cap.d.ts +3 -0
- package/dist/capabilities/color.cap.d.ts +21 -0
- package/dist/capabilities/composer.cap.d.ts +3 -0
- package/dist/capabilities/connectivity.cap.d.ts +12 -0
- package/dist/capabilities/consumables.cap.d.ts +4 -0
- package/dist/capabilities/contact.cap.d.ts +12 -0
- package/dist/capabilities/control.cap.d.ts +15 -0
- package/dist/capabilities/core-blocks.cap.d.ts +3 -0
- package/dist/capabilities/cover.cap.d.ts +110 -0
- package/dist/capabilities/custom-model-registry.cap.d.ts +3 -0
- package/dist/capabilities/data-store-provider.cap.d.ts +3 -0
- package/dist/capabilities/database-snapshot.cap.d.ts +3 -0
- package/dist/capabilities/day-night.cap.d.ts +25 -0
- package/dist/capabilities/decoder.cap.d.ts +3 -0
- package/dist/capabilities/detection-pipeline.cap.d.ts +4 -0
- package/dist/capabilities/device-admin-link.cap.d.ts +4 -0
- package/dist/capabilities/device-adoption.cap.d.ts +3 -0
- package/dist/capabilities/device-credentials.cap.d.ts +3 -0
- package/dist/capabilities/device-export.cap.d.ts +3 -0
- package/dist/capabilities/device-extension.cap.d.ts +4 -0
- package/dist/capabilities/device-history.cap.d.ts +3 -0
- package/dist/capabilities/device-manager.cap.d.ts +3 -0
- package/dist/capabilities/device-ops.cap.d.ts +4 -0
- package/dist/capabilities/device-provider.cap.d.ts +3 -0
- package/dist/capabilities/device-removal-hook.cap.d.ts +3 -0
- package/dist/capabilities/device-runs.cap.d.ts +6 -0
- package/dist/capabilities/device-state.cap.d.ts +3 -0
- package/dist/capabilities/device-status.cap.d.ts +25 -0
- package/dist/capabilities/device-transitions.cap.d.ts +4 -0
- package/dist/capabilities/dishwasher.cap.d.ts +60 -0
- package/dist/capabilities/display-palette.cap.d.ts +3 -0
- package/dist/capabilities/do-not-disturb.cap.d.ts +12 -0
- package/dist/capabilities/doorbell.cap.d.ts +11 -0
- package/dist/capabilities/embedding-encoder.cap.d.ts +3 -0
- package/dist/capabilities/energy-system.cap.d.ts +281 -0
- package/dist/capabilities/enum-sensor.cap.d.ts +10 -0
- package/dist/capabilities/event-emitter.cap.d.ts +11 -0
- package/dist/capabilities/face-gallery.cap.d.ts +3 -0
- package/dist/capabilities/failure-contribution.cap.d.ts +3 -0
- package/dist/capabilities/fan-control.cap.d.ts +19 -0
- package/dist/capabilities/fan-presets.cap.d.ts +3 -0
- package/dist/capabilities/feature-probe.cap.d.ts +5 -0
- package/dist/capabilities/filesystem-browse.cap.d.ts +3 -0
- package/dist/capabilities/flood.cap.d.ts +12 -0
- package/dist/capabilities/gas.cap.d.ts +12 -0
- package/dist/capabilities/group-active.cap.d.ts +4 -0
- package/dist/capabilities/group-commands.cap.d.ts +4 -0
- package/dist/capabilities/group-status.cap.d.ts +23 -0
- package/dist/capabilities/heat-pump-control.cap.d.ts +4 -0
- package/dist/capabilities/heat-pump-status.cap.d.ts +4 -0
- package/dist/capabilities/heating-valve.cap.d.ts +12 -0
- package/dist/capabilities/hero-layout.cap.d.ts +3 -0
- package/dist/capabilities/humidifier.cap.d.ts +19 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +12 -0
- package/dist/capabilities/image-settings.cap.d.ts +4 -0
- package/dist/capabilities/image.cap.d.ts +4 -0
- package/dist/capabilities/index.d.ts +5 -3
- package/dist/capabilities/integration-instances.cap.d.ts +12 -0
- package/dist/capabilities/integrations.cap.d.ts +3 -0
- package/dist/capabilities/intercom.cap.d.ts +13 -0
- package/dist/capabilities/ir-transmitter.cap.d.ts +101 -0
- package/dist/capabilities/keychain-admin.cap.d.ts +3 -0
- package/dist/capabilities/keychain.cap.d.ts +3 -0
- package/dist/capabilities/lawn-mower-control.cap.d.ts +36 -0
- package/dist/capabilities/llm-runtime.cap.d.ts +3 -0
- package/dist/capabilities/llm.cap.d.ts +3 -0
- package/dist/capabilities/load-contribution.cap.d.ts +3 -0
- package/dist/capabilities/local-network.cap.d.ts +3 -0
- package/dist/capabilities/lock-control.cap.d.ts +35 -0
- package/dist/capabilities/log-channels.cap.d.ts +3 -0
- package/dist/capabilities/log-destination.cap.d.ts +3 -0
- package/dist/capabilities/login-method.cap.d.ts +3 -0
- package/dist/capabilities/media-player.cap.d.ts +66 -6
- package/dist/capabilities/mesh-network.cap.d.ts +3 -0
- package/dist/capabilities/meter.cap.d.ts +11 -0
- package/dist/capabilities/metrics-provider.cap.d.ts +3 -0
- package/dist/capabilities/migrations.cap.d.ts +3 -0
- package/dist/capabilities/model-convert.cap.d.ts +3 -0
- package/dist/capabilities/model-distributor.cap.d.ts +3 -0
- package/dist/capabilities/motion-detection.cap.d.ts +5 -0
- package/dist/capabilities/motion-trigger.cap.d.ts +13 -0
- package/dist/capabilities/motion-zones.cap.d.ts +4 -0
- package/dist/capabilities/motion.cap.d.ts +13 -0
- package/dist/capabilities/mqtt-broker.cap.d.ts +3 -0
- package/dist/capabilities/native-object-detection.cap.d.ts +19 -0
- package/dist/capabilities/navigation.cap.d.ts +36 -0
- package/dist/capabilities/network-access.cap.d.ts +3 -0
- package/dist/capabilities/network-link.cap.d.ts +31 -0
- package/dist/capabilities/network-quality.cap.d.ts +3 -0
- package/dist/capabilities/node-certificates.cap.d.ts +3 -0
- package/dist/capabilities/node-removal-hook.cap.d.ts +3 -0
- package/dist/capabilities/nodes.cap.d.ts +3 -0
- package/dist/capabilities/notification-output.cap.d.ts +3 -0
- package/dist/capabilities/notification-rules.cap.d.ts +3 -0
- package/dist/capabilities/notifier.cap.d.ts +5 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts +11 -0
- package/dist/capabilities/oauth-integration.cap.d.ts +3 -0
- package/dist/capabilities/osd-manager.cap.d.ts +3 -0
- package/dist/capabilities/osd.cap.d.ts +5 -0
- package/dist/capabilities/pet-feeder.cap.d.ts +35 -9
- package/dist/capabilities/pet-fountain.cap.d.ts +19 -0
- package/dist/capabilities/pipeline-analytics.cap.d.ts +35 -0
- package/dist/capabilities/pipeline-executor.cap.d.ts +3 -0
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +3 -0
- package/dist/capabilities/pipeline-runner.cap.d.ts +3 -0
- package/dist/capabilities/plate-gallery.cap.d.ts +3 -0
- package/dist/capabilities/platform-probe.cap.d.ts +3 -0
- package/dist/capabilities/power-meter.cap.d.ts +33 -0
- package/dist/capabilities/power-source.cap.d.ts +12 -0
- package/dist/capabilities/presence.cap.d.ts +11 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts +12 -0
- package/dist/capabilities/privacy-mask.cap.d.ts +19 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts +13 -0
- package/dist/capabilities/ptz.cap.d.ts +11 -7
- package/dist/capabilities/pump-cycle.cap.d.ts +12 -0
- package/dist/capabilities/reboot.cap.d.ts +4 -0
- package/dist/capabilities/record-entries.cap.d.ts +3 -0
- package/dist/capabilities/recording-archive.cap.d.ts +3 -0
- package/dist/capabilities/recording-export.cap.d.ts +3 -0
- package/dist/capabilities/recording-onboard.cap.d.ts +12 -0
- package/dist/capabilities/recording-signal.cap.d.ts +12 -0
- package/dist/capabilities/recording.cap.d.ts +4 -0
- package/dist/capabilities/records.cap.d.ts +3 -0
- package/dist/capabilities/remote-layout-components.cap.d.ts +3 -0
- package/dist/capabilities/remote.cap.d.ts +3 -0
- package/dist/capabilities/running-state.cap.d.ts +77 -0
- package/dist/capabilities/scene-monitor.cap.d.ts +11 -0
- package/dist/capabilities/schedulers.cap.d.ts +3 -0
- package/dist/capabilities/script-runner.cap.d.ts +12 -0
- package/dist/capabilities/server-management.cap.d.ts +3 -0
- package/dist/capabilities/settings-store.cap.d.ts +3 -0
- package/dist/capabilities/smoke.cap.d.ts +12 -0
- package/dist/capabilities/smtp-provider.cap.d.ts +3 -0
- package/dist/capabilities/snapshot.cap.d.ts +4 -0
- package/dist/capabilities/sso-bridge.cap.d.ts +3 -0
- package/dist/capabilities/storage-admin.cap.d.ts +3 -0
- package/dist/capabilities/storage-evictable.cap.d.ts +3 -0
- package/dist/capabilities/storage-migration.cap.d.ts +3 -0
- package/dist/capabilities/storage-occupancy.cap.d.ts +3 -0
- package/dist/capabilities/storage-provider.cap.d.ts +3 -0
- package/dist/capabilities/storage.cap.d.ts +3 -0
- package/dist/capabilities/stream-broker.cap.d.ts +3 -0
- package/dist/capabilities/stream-catalog.cap.d.ts +4 -0
- package/dist/capabilities/stream-params.cap.d.ts +4 -0
- package/dist/capabilities/stream-signals.cap.d.ts +4 -0
- package/dist/capabilities/switch.cap.d.ts +208 -0
- package/dist/capabilities/system.cap.d.ts +3 -0
- package/dist/capabilities/tamper.cap.d.ts +12 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts +12 -0
- package/dist/capabilities/template.cap.d.ts +42 -2
- package/dist/capabilities/terminal-session.cap.d.ts +3 -0
- package/dist/capabilities/timed-run.cap.d.ts +4 -0
- package/dist/capabilities/toast.cap.d.ts +3 -0
- package/dist/capabilities/training-provider.cap.d.ts +3 -0
- package/dist/capabilities/training.cap.d.ts +3 -0
- package/dist/capabilities/turn-provider.cap.d.ts +3 -0
- package/dist/capabilities/update.cap.d.ts +19 -0
- package/dist/capabilities/user-management.cap.d.ts +3 -0
- package/dist/capabilities/user-passkeys.cap.d.ts +3 -0
- package/dist/capabilities/vacuum-control.cap.d.ts +43 -0
- package/dist/capabilities/valve.cap.d.ts +38 -0
- package/dist/capabilities/vector-store.cap.d.ts +3 -0
- package/dist/capabilities/vibration.cap.d.ts +12 -0
- package/dist/capabilities/videoclips.cap.d.ts +4 -0
- package/dist/capabilities/viewer-ui.cap.d.ts +3 -0
- package/dist/capabilities/water-heater.cap.d.ts +33 -4
- package/dist/capabilities/weather.cap.d.ts +39 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +4 -0
- package/dist/capabilities/zone-analytics.cap.d.ts +11 -0
- package/dist/capabilities/zone-rules.cap.d.ts +4 -0
- package/dist/capabilities/zones.cap.d.ts +4 -0
- package/dist/client.js +186 -29
- package/dist/client.mjs +186 -29
- package/dist/{composed-stable-id-iddnCQ51.mjs → composed-stable-id-B3wcvtvW.mjs} +4 -0
- package/dist/{composed-stable-id-BmJ_5GiE.js → composed-stable-id-Bp33yrYi.js} +4 -0
- package/dist/device/cap-vocabulary/declaration.d.ts +107 -0
- package/dist/device/cap-vocabulary/index.d.ts +4 -2
- package/dist/device/cap-vocabulary/system-reasons.d.ts +17 -0
- package/dist/device/cap-vocabulary/types.d.ts +24 -6
- package/dist/device/cap-vocabulary/vocabulary.d.ts +15 -3
- package/dist/device/device-control-resolution.d.ts +1 -1
- package/dist/device/device-icon.d.ts +1 -0
- package/dist/device/device-type.d.ts +5 -1
- package/dist/device/hero/hero-layout.d.ts +1 -0
- package/dist/device/hero/hero-look.d.ts +6 -0
- package/dist/device/hero/hero-scene.d.ts +1 -0
- package/dist/generated/addon-api.d.ts +66 -52
- package/dist/generated/addon-cap-facts.d.ts +1 -1
- package/dist/generated/cap-status-types.d.ts +3 -1
- package/dist/generated/cap-vocabulary.d.ts +7 -0
- package/dist/generated/capability-router-map.d.ts +5 -2
- package/dist/generated/customize-catalog.d.ts +1 -1
- package/dist/generated/device-local-state.d.ts +6 -0
- package/dist/generated/device-proxy.d.ts +4 -0
- package/dist/generated/device-scoped-caps.d.ts +1 -1
- package/dist/generated/history-catalog.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/generated/runtime-state-durability.d.ts +1 -1
- package/dist/{implemented-methods-CfaRR_ki.js → implemented-methods-CDYOCn9a.js} +1 -1
- package/dist/{implemented-methods-CSTk6zYK.mjs → implemented-methods-CgUBu6uM.mjs} +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6739 -765
- package/dist/index.mjs +6685 -766
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/{sleep-CyWfD1LJ.js → sleep-Cb2px0Nb.js} +5706 -1620
- package/dist/{sleep-BvVGLl30.mjs → sleep-Cykc2bzi.mjs} +5701 -1621
- package/dist/template/automation-template.d.ts +782 -0
- package/dist/template/builtin-automation-templates.d.ts +17 -0
- package/dist/template/template-kinds.d.ts +4 -3
- package/package.json +1 -1
- package/dist/device/cap-vocabulary/entries/actuators.d.ts +0 -5
- package/dist/device/cap-vocabulary/entries/appliances.d.ts +0 -5
- package/dist/device/cap-vocabulary/entries/camera.d.ts +0 -5
- package/dist/device/cap-vocabulary/entries/heat-pump.d.ts +0 -4
- package/dist/device/cap-vocabulary/entries/sensors.d.ts +0 -5
- package/dist/device/cap-vocabulary/entries/system.d.ts +0 -8
package/dist/client.mjs
CHANGED
|
@@ -140,6 +140,8 @@ function method(input, output, options) {
|
|
|
140
140
|
...options?.access !== void 0 ? { access: options.access } : {},
|
|
141
141
|
...options?.role !== void 0 ? { role: options.role } : {},
|
|
142
142
|
...options?.caller !== void 0 ? { caller: options.caller } : {},
|
|
143
|
+
...options?.actions !== void 0 ? { actions: options.actions } : {},
|
|
144
|
+
...options?.notOperatorFacing !== void 0 ? { notOperatorFacing: options.notOperatorFacing } : {},
|
|
143
145
|
timeoutMs: options?.timeoutMs
|
|
144
146
|
};
|
|
145
147
|
}
|
|
@@ -593,6 +595,25 @@ var PeerBytesTicketSchema = z.object({
|
|
|
593
595
|
declaredBytes: z.number().int().nonnegative().nullable()
|
|
594
596
|
});
|
|
595
597
|
//#endregion
|
|
598
|
+
//#region src/device/cap-vocabulary/system-reasons.ts
|
|
599
|
+
/**
|
|
600
|
+
* Why a system-scoped cap is never part of a device's vocabulary (D920): the
|
|
601
|
+
* reasons several caps share, named once. A cap's `vocabulary` block cites
|
|
602
|
+
* one (`vocabulary: { notOperatorFacing: NOT_A_DEVICE.STORAGE }`) or states
|
|
603
|
+
* its own.
|
|
604
|
+
*/
|
|
605
|
+
var NOT_A_DEVICE = {
|
|
606
|
+
UI_PLUMBING: "admin UI plumbing — pages, widgets and routes, not something a device does",
|
|
607
|
+
ADDON_ADMIN: "addon administration — installed and configured from the Addons page",
|
|
608
|
+
PIPELINE: "detection pipeline machinery — tuned on the pipeline pages, never actuated per device",
|
|
609
|
+
STORAGE: "storage administration — locations, retention and migrations, not a device action",
|
|
610
|
+
IDENTITY: "identity and access administration — users, sign-in and secrets",
|
|
611
|
+
NETWORK: "network administration of the cluster — addresses, mesh, tunnels",
|
|
612
|
+
CLUSTER: "cluster administration — nodes, server package, metrics",
|
|
613
|
+
ML: "model and training machinery — no device action",
|
|
614
|
+
INTERNAL: "internal plumbing between addons — never operator-facing"
|
|
615
|
+
};
|
|
616
|
+
//#endregion
|
|
596
617
|
//#region src/retrain-review.ts
|
|
597
618
|
/** Every status, in the order a summary lists them. */
|
|
598
619
|
var RETRAIN_REVIEW_STATUSES = [
|
|
@@ -1215,6 +1236,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1215
1236
|
* water, cooling, solar), its system modes and its power. One main read-only
|
|
1216
1237
|
* `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
|
|
1217
1238
|
DeviceType["HeatPump"] = "heat-pump";
|
|
1239
|
+
/** A home energy installation (any vendor): solar, grid, house, a metered heat pump
|
|
1240
|
+
* and the storage as branches of one bus. One read-only `energy-system` cap carries
|
|
1241
|
+
* every value; the storage is a field of it, never the `battery` cap (#513, #522). */
|
|
1242
|
+
DeviceType["EnergySystem"] = "energy-system";
|
|
1218
1243
|
return DeviceType;
|
|
1219
1244
|
}({});
|
|
1220
1245
|
/**
|
|
@@ -1599,15 +1624,6 @@ z.object({
|
|
|
1599
1624
|
app: AppLoginPathSchema.nullable()
|
|
1600
1625
|
});
|
|
1601
1626
|
//#endregion
|
|
1602
|
-
//#region src/device/cap-vocabulary/l10n.ts
|
|
1603
|
-
/** A string in English and Italian. */
|
|
1604
|
-
function t(en, it) {
|
|
1605
|
-
return {
|
|
1606
|
-
en,
|
|
1607
|
-
it
|
|
1608
|
-
};
|
|
1609
|
-
}
|
|
1610
|
-
//#endregion
|
|
1611
1627
|
//#region src/device/icon-catalog.generated.ts
|
|
1612
1628
|
/** Lucide category ids, alphabetical. `ICON_META` indexes into this. */
|
|
1613
1629
|
var ICON_CATEGORY_IDS = [
|
|
@@ -21752,6 +21768,15 @@ var COCO_TO_MACRO = {
|
|
|
21752
21768
|
preserveOriginal: false
|
|
21753
21769
|
};
|
|
21754
21770
|
//#endregion
|
|
21771
|
+
//#region src/device/cap-vocabulary/l10n.ts
|
|
21772
|
+
/** A string in English and Italian. */
|
|
21773
|
+
function t(en, it) {
|
|
21774
|
+
return {
|
|
21775
|
+
en,
|
|
21776
|
+
it
|
|
21777
|
+
};
|
|
21778
|
+
}
|
|
21779
|
+
//#endregion
|
|
21755
21780
|
//#region src/capabilities/alarm-panel.cap.ts
|
|
21756
21781
|
/**
|
|
21757
21782
|
* Alarm-panel cap. Models HA `alarm_control_panel.*` on
|
|
@@ -21809,24 +21834,151 @@ z.object({
|
|
|
21809
21834
|
/** Ms epoch when the slice was last updated. */
|
|
21810
21835
|
lastChangedAt: z.number()
|
|
21811
21836
|
});
|
|
21812
|
-
DeviceType.AlarmPanel, method(z.object({
|
|
21837
|
+
DeviceType.AlarmPanel, method(z.object({ deviceId: z.number().int().nonnegative() }), z.void(), {
|
|
21838
|
+
kind: "mutation",
|
|
21839
|
+
auth: "protected",
|
|
21840
|
+
actions: [{
|
|
21841
|
+
id: "alarm.trigger",
|
|
21842
|
+
label: t("Trigger alarm", "Fai scattare l’allarme"),
|
|
21843
|
+
phrase: t("Trigger the alarm on {device}", "Fai scattare l’allarme su {device}"),
|
|
21844
|
+
icon: "siren"
|
|
21845
|
+
}]
|
|
21846
|
+
}), method(z.object({
|
|
21813
21847
|
deviceId: z.number().int().nonnegative(),
|
|
21814
|
-
mode: AlarmArmModeSchema,
|
|
21815
|
-
/** Optional PIN code. Required when `requiresCode === true`.
|
|
21816
|
-
* Passed through to the upstream service; never persisted. */
|
|
21817
21848
|
code: z.string().min(1).optional()
|
|
21818
21849
|
}), z.void(), {
|
|
21819
21850
|
kind: "mutation",
|
|
21820
|
-
auth: "protected"
|
|
21851
|
+
auth: "protected",
|
|
21852
|
+
actions: [{
|
|
21853
|
+
id: "alarm.disarm",
|
|
21854
|
+
label: t("Disarm", "Disinserisci"),
|
|
21855
|
+
phrase: t("Disarm {device}", "Disinserisci {device}"),
|
|
21856
|
+
icon: "shield-off",
|
|
21857
|
+
effect: {
|
|
21858
|
+
field: "state",
|
|
21859
|
+
value: "disarmed"
|
|
21860
|
+
},
|
|
21861
|
+
openArgs: [{
|
|
21862
|
+
key: "code",
|
|
21863
|
+
label: t("PIN code", "Codice PIN"),
|
|
21864
|
+
offer: {
|
|
21865
|
+
kind: "text",
|
|
21866
|
+
secret: true
|
|
21867
|
+
},
|
|
21868
|
+
optional: true
|
|
21869
|
+
}]
|
|
21870
|
+
}]
|
|
21821
21871
|
}), method(z.object({
|
|
21822
21872
|
deviceId: z.number().int().nonnegative(),
|
|
21873
|
+
mode: AlarmArmModeSchema,
|
|
21874
|
+
/** Optional PIN code. Required when `requiresCode === true`.
|
|
21875
|
+
* Passed through to the upstream service; never persisted. */
|
|
21823
21876
|
code: z.string().min(1).optional()
|
|
21824
21877
|
}), z.void(), {
|
|
21825
21878
|
kind: "mutation",
|
|
21826
|
-
auth: "protected"
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21879
|
+
auth: "protected",
|
|
21880
|
+
actions: [
|
|
21881
|
+
{
|
|
21882
|
+
id: "alarm.arm.home",
|
|
21883
|
+
label: t("Arm home", "Inserisci in casa"),
|
|
21884
|
+
phrase: t("Arm {device} for home", "Inserisci {device} in modalità casa"),
|
|
21885
|
+
icon: "house",
|
|
21886
|
+
effect: {
|
|
21887
|
+
field: "state",
|
|
21888
|
+
value: "armed_home"
|
|
21889
|
+
},
|
|
21890
|
+
args: { mode: "home" },
|
|
21891
|
+
openArgs: [{
|
|
21892
|
+
key: "code",
|
|
21893
|
+
label: t("PIN code", "Codice PIN"),
|
|
21894
|
+
offer: {
|
|
21895
|
+
kind: "text",
|
|
21896
|
+
secret: true
|
|
21897
|
+
},
|
|
21898
|
+
optional: true
|
|
21899
|
+
}]
|
|
21900
|
+
},
|
|
21901
|
+
{
|
|
21902
|
+
id: "alarm.arm.away",
|
|
21903
|
+
label: t("Arm away", "Inserisci fuori casa"),
|
|
21904
|
+
phrase: t("Arm {device} for away", "Inserisci {device} in modalità fuori casa"),
|
|
21905
|
+
icon: "shield-check",
|
|
21906
|
+
effect: {
|
|
21907
|
+
field: "state",
|
|
21908
|
+
value: "armed_away"
|
|
21909
|
+
},
|
|
21910
|
+
args: { mode: "away" },
|
|
21911
|
+
openArgs: [{
|
|
21912
|
+
key: "code",
|
|
21913
|
+
label: t("PIN code", "Codice PIN"),
|
|
21914
|
+
offer: {
|
|
21915
|
+
kind: "text",
|
|
21916
|
+
secret: true
|
|
21917
|
+
},
|
|
21918
|
+
optional: true
|
|
21919
|
+
}]
|
|
21920
|
+
},
|
|
21921
|
+
{
|
|
21922
|
+
id: "alarm.arm.night",
|
|
21923
|
+
label: t("Arm night", "Inserisci notte"),
|
|
21924
|
+
phrase: t("Arm {device} for the night", "Inserisci {device} in modalità notte"),
|
|
21925
|
+
icon: "moon",
|
|
21926
|
+
effect: {
|
|
21927
|
+
field: "state",
|
|
21928
|
+
value: "armed_night"
|
|
21929
|
+
},
|
|
21930
|
+
args: { mode: "night" },
|
|
21931
|
+
openArgs: [{
|
|
21932
|
+
key: "code",
|
|
21933
|
+
label: t("PIN code", "Codice PIN"),
|
|
21934
|
+
offer: {
|
|
21935
|
+
kind: "text",
|
|
21936
|
+
secret: true
|
|
21937
|
+
},
|
|
21938
|
+
optional: true
|
|
21939
|
+
}]
|
|
21940
|
+
},
|
|
21941
|
+
{
|
|
21942
|
+
id: "alarm.arm.vacation",
|
|
21943
|
+
label: t("Arm vacation", "Inserisci vacanza"),
|
|
21944
|
+
phrase: t("Arm {device} for vacation", "Inserisci {device} in modalità vacanza"),
|
|
21945
|
+
icon: "plane",
|
|
21946
|
+
effect: {
|
|
21947
|
+
field: "state",
|
|
21948
|
+
value: "armed_vacation"
|
|
21949
|
+
},
|
|
21950
|
+
args: { mode: "vacation" },
|
|
21951
|
+
openArgs: [{
|
|
21952
|
+
key: "code",
|
|
21953
|
+
label: t("PIN code", "Codice PIN"),
|
|
21954
|
+
offer: {
|
|
21955
|
+
kind: "text",
|
|
21956
|
+
secret: true
|
|
21957
|
+
},
|
|
21958
|
+
optional: true
|
|
21959
|
+
}]
|
|
21960
|
+
},
|
|
21961
|
+
{
|
|
21962
|
+
id: "alarm.arm.custom_bypass",
|
|
21963
|
+
label: t("Arm custom bypass", "Inserisci con esclusioni"),
|
|
21964
|
+
phrase: t("Arm {device} with its custom bypass", "Inserisci {device} con le zone escluse"),
|
|
21965
|
+
icon: "shield-half",
|
|
21966
|
+
effect: {
|
|
21967
|
+
field: "state",
|
|
21968
|
+
value: "armed_custom_bypass"
|
|
21969
|
+
},
|
|
21970
|
+
args: { mode: "custom_bypass" },
|
|
21971
|
+
openArgs: [{
|
|
21972
|
+
key: "code",
|
|
21973
|
+
label: t("PIN code", "Codice PIN"),
|
|
21974
|
+
offer: {
|
|
21975
|
+
kind: "text",
|
|
21976
|
+
secret: true
|
|
21977
|
+
},
|
|
21978
|
+
optional: true
|
|
21979
|
+
}]
|
|
21980
|
+
}
|
|
21981
|
+
]
|
|
21830
21982
|
});
|
|
21831
21983
|
//#endregion
|
|
21832
21984
|
//#region src/remote/remote-roles.ts
|
|
@@ -22558,7 +22710,7 @@ method(z.void(), z.array(TopologyNodeSchema).readonly(), { auth: "admin" }), met
|
|
|
22558
22710
|
}), z.unknown(), {
|
|
22559
22711
|
kind: "mutation",
|
|
22560
22712
|
auth: "admin"
|
|
22561
|
-
});
|
|
22713
|
+
}), NOT_A_DEVICE.CLUSTER;
|
|
22562
22714
|
//#endregion
|
|
22563
22715
|
//#region src/catalogs/audio-classmap.ts
|
|
22564
22716
|
var AUDIO_MACRO_LABELS = [
|
|
@@ -27133,6 +27285,7 @@ var DEVICE_TYPE_ICON = {
|
|
|
27133
27285
|
[DeviceType.Sensor]: "activity",
|
|
27134
27286
|
[DeviceType.Climate]: "thermometer",
|
|
27135
27287
|
[DeviceType.HeatPump]: "flame",
|
|
27288
|
+
[DeviceType.EnergySystem]: "solar-panel",
|
|
27136
27289
|
[DeviceType.Button]: "circle-dot",
|
|
27137
27290
|
[DeviceType.EventEmitter]: "zap",
|
|
27138
27291
|
[DeviceType.Update]: "refresh-cw",
|
|
@@ -27368,9 +27521,9 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27368
27521
|
};
|
|
27369
27522
|
const airQualitySensorInterface = { getStatus: (input) => dispatch("air-quality-sensor", "airQualitySensor", "getStatus", "query", input) };
|
|
27370
27523
|
const alarmPanelInterface = {
|
|
27371
|
-
arm: (input) => dispatch("alarm-panel", "alarmPanel", "arm", "mutation", input),
|
|
27372
|
-
disarm: (input) => dispatch("alarm-panel", "alarmPanel", "disarm", "mutation", input),
|
|
27373
27524
|
trigger: (input) => dispatch("alarm-panel", "alarmPanel", "trigger", "mutation", input),
|
|
27525
|
+
disarm: (input) => dispatch("alarm-panel", "alarmPanel", "disarm", "mutation", input),
|
|
27526
|
+
arm: (input) => dispatch("alarm-panel", "alarmPanel", "arm", "mutation", input),
|
|
27374
27527
|
getStatus: (input) => dispatch("alarm-panel", "alarmPanel", "getStatus", "query", input)
|
|
27375
27528
|
};
|
|
27376
27529
|
const ambientLightSensorInterface = { getStatus: (input) => dispatch("ambient-light-sensor", "ambientLightSensor", "getStatus", "query", input) };
|
|
@@ -27426,11 +27579,11 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27426
27579
|
const carbonMonoxideInterface = { getStatus: (input) => dispatch("carbon-monoxide", "carbonMonoxide", "getStatus", "query", input) };
|
|
27427
27580
|
const climateControlInterface = {
|
|
27428
27581
|
setMode: (input) => dispatch("climate-control", "climateControl", "setMode", "mutation", input),
|
|
27429
|
-
setFanMode: (input) => dispatch("climate-control", "climateControl", "setFanMode", "mutation", input),
|
|
27430
|
-
setPreset: (input) => dispatch("climate-control", "climateControl", "setPreset", "mutation", input),
|
|
27431
27582
|
setTarget: (input) => dispatch("climate-control", "climateControl", "setTarget", "mutation", input),
|
|
27432
27583
|
setTargetRange: (input) => dispatch("climate-control", "climateControl", "setTargetRange", "mutation", input),
|
|
27433
27584
|
setTargetHumidity: (input) => dispatch("climate-control", "climateControl", "setTargetHumidity", "mutation", input),
|
|
27585
|
+
setFanMode: (input) => dispatch("climate-control", "climateControl", "setFanMode", "mutation", input),
|
|
27586
|
+
setPreset: (input) => dispatch("climate-control", "climateControl", "setPreset", "mutation", input),
|
|
27434
27587
|
setSwingVertical: (input) => dispatch("climate-control", "climateControl", "setSwingVertical", "mutation", input),
|
|
27435
27588
|
setSwingHorizontal: (input) => dispatch("climate-control", "climateControl", "setSwingHorizontal", "mutation", input),
|
|
27436
27589
|
getStatus: (input) => dispatch("climate-control", "climateControl", "getStatus", "query", input)
|
|
@@ -27518,6 +27671,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27518
27671
|
getStatus: (input) => dispatch("do-not-disturb", "doNotDisturb", "getStatus", "query", input)
|
|
27519
27672
|
};
|
|
27520
27673
|
const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
|
|
27674
|
+
const energySystemInterface = { getStatus: (input) => dispatch("energy-system", "energySystem", "getStatus", "query", input) };
|
|
27521
27675
|
const enumSensorInterface = { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) };
|
|
27522
27676
|
const eventEmitterInterface = { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) };
|
|
27523
27677
|
const fanControlInterface = {
|
|
@@ -27603,12 +27757,12 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27603
27757
|
stop: (input) => dispatch("media-player", "mediaPlayer", "stop", "mutation", input),
|
|
27604
27758
|
next: (input) => dispatch("media-player", "mediaPlayer", "next", "mutation", input),
|
|
27605
27759
|
previous: (input) => dispatch("media-player", "mediaPlayer", "previous", "mutation", input),
|
|
27606
|
-
seek: (input) => dispatch("media-player", "mediaPlayer", "seek", "mutation", input),
|
|
27607
27760
|
setVolume: (input) => dispatch("media-player", "mediaPlayer", "setVolume", "mutation", input),
|
|
27608
27761
|
setMute: (input) => dispatch("media-player", "mediaPlayer", "setMute", "mutation", input),
|
|
27609
27762
|
setShuffle: (input) => dispatch("media-player", "mediaPlayer", "setShuffle", "mutation", input),
|
|
27610
27763
|
setRepeat: (input) => dispatch("media-player", "mediaPlayer", "setRepeat", "mutation", input),
|
|
27611
27764
|
selectSource: (input) => dispatch("media-player", "mediaPlayer", "selectSource", "mutation", input),
|
|
27765
|
+
seek: (input) => dispatch("media-player", "mediaPlayer", "seek", "mutation", input),
|
|
27612
27766
|
playMedia: (input) => dispatch("media-player", "mediaPlayer", "playMedia", "mutation", input),
|
|
27613
27767
|
getStatus: (input) => dispatch("media-player", "mediaPlayer", "getStatus", "query", input)
|
|
27614
27768
|
};
|
|
@@ -27667,10 +27821,10 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27667
27821
|
const petFeederInterface = {
|
|
27668
27822
|
feed: (input) => dispatch("pet-feeder", "petFeeder", "feed", "mutation", input),
|
|
27669
27823
|
cancelFeed: (input) => dispatch("pet-feeder", "petFeeder", "cancelFeed", "mutation", input),
|
|
27670
|
-
resetDesiccant: (input) => dispatch("pet-feeder", "petFeeder", "resetDesiccant", "mutation", input),
|
|
27671
|
-
markFoodReplenished: (input) => dispatch("pet-feeder", "petFeeder", "markFoodReplenished", "mutation", input),
|
|
27672
27824
|
callPet: (input) => dispatch("pet-feeder", "petFeeder", "callPet", "mutation", input),
|
|
27673
27825
|
playSound: (input) => dispatch("pet-feeder", "petFeeder", "playSound", "mutation", input),
|
|
27826
|
+
resetDesiccant: (input) => dispatch("pet-feeder", "petFeeder", "resetDesiccant", "mutation", input),
|
|
27827
|
+
markFoodReplenished: (input) => dispatch("pet-feeder", "petFeeder", "markFoodReplenished", "mutation", input),
|
|
27674
27828
|
setChildLock: (input) => dispatch("pet-feeder", "petFeeder", "setChildLock", "mutation", input),
|
|
27675
27829
|
setIndicatorLight: (input) => dispatch("pet-feeder", "petFeeder", "setIndicatorLight", "mutation", input),
|
|
27676
27830
|
setFeedSound: (input) => dispatch("pet-feeder", "petFeeder", "setFeedSound", "mutation", input),
|
|
@@ -27790,13 +27944,13 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27790
27944
|
const ptzInterface = {
|
|
27791
27945
|
move: (input) => dispatch("ptz", "ptz", "move", "mutation", input),
|
|
27792
27946
|
continuousMove: (input) => dispatch("ptz", "ptz", "continuousMove", "mutation", input),
|
|
27793
|
-
|
|
27947
|
+
goHome: (input) => dispatch("ptz", "ptz", "goHome", "mutation", input),
|
|
27794
27948
|
getPresets: (input) => dispatch("ptz", "ptz", "getPresets", "query", input),
|
|
27795
27949
|
goToPreset: (input) => dispatch("ptz", "ptz", "goToPreset", "mutation", input),
|
|
27796
27950
|
savePreset: (input) => dispatch("ptz", "ptz", "savePreset", "mutation", input),
|
|
27797
27951
|
deletePreset: (input) => dispatch("ptz", "ptz", "deletePreset", "mutation", input),
|
|
27798
27952
|
getOptions: (input) => dispatch("ptz", "ptz", "getOptions", "query", input),
|
|
27799
|
-
|
|
27953
|
+
stop: (input) => dispatch("ptz", "ptz", "stop", "mutation", input),
|
|
27800
27954
|
getHomePreset: (input) => dispatch("ptz", "ptz", "getHomePreset", "query", input),
|
|
27801
27955
|
setHomePreset: (input) => dispatch("ptz", "ptz", "setHomePreset", "mutation", input),
|
|
27802
27956
|
captureHomeHere: (input) => dispatch("ptz", "ptz", "captureHomeHere", "mutation", input),
|
|
@@ -27914,9 +28068,9 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
27914
28068
|
getPlaybackOptions: (input) => dispatch("videoclips", "videoclips", "getPlaybackOptions", "query", input)
|
|
27915
28069
|
};
|
|
27916
28070
|
const waterHeaterInterface = {
|
|
27917
|
-
setTargetTemp: (input) => dispatch("water-heater", "waterHeater", "setTargetTemp", "mutation", input),
|
|
27918
28071
|
setOperationMode: (input) => dispatch("water-heater", "waterHeater", "setOperationMode", "mutation", input),
|
|
27919
28072
|
setAway: (input) => dispatch("water-heater", "waterHeater", "setAway", "mutation", input),
|
|
28073
|
+
setTargetTemp: (input) => dispatch("water-heater", "waterHeater", "setTargetTemp", "mutation", input),
|
|
27920
28074
|
getStatus: (input) => dispatch("water-heater", "waterHeater", "getStatus", "query", input)
|
|
27921
28075
|
};
|
|
27922
28076
|
const weatherInterface = { getStatus: (input) => dispatch("weather", "weather", "getStatus", "query", input) };
|
|
@@ -28144,6 +28298,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28144
28298
|
dishwasher: createSliceHandle(stateSource, binding.deviceId, "dishwasher"),
|
|
28145
28299
|
doNotDisturb: createSliceHandle(stateSource, binding.deviceId, "do-not-disturb"),
|
|
28146
28300
|
doorbell: createSliceHandle(stateSource, binding.deviceId, "doorbell"),
|
|
28301
|
+
energySystem: createSliceHandle(stateSource, binding.deviceId, "energy-system"),
|
|
28147
28302
|
enumSensor: createSliceHandle(stateSource, binding.deviceId, "enum-sensor"),
|
|
28148
28303
|
eventEmitter: createSliceHandle(stateSource, binding.deviceId, "event-emitter"),
|
|
28149
28304
|
fanControl: createSliceHandle(stateSource, binding.deviceId, "fan-control"),
|
|
@@ -28160,6 +28315,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28160
28315
|
image: createSliceHandle(stateSource, binding.deviceId, "image"),
|
|
28161
28316
|
imageSettings: createSliceHandle(stateSource, binding.deviceId, "image-settings"),
|
|
28162
28317
|
intercom: createSliceHandle(stateSource, binding.deviceId, "intercom"),
|
|
28318
|
+
irTransmitter: createSliceHandle(stateSource, binding.deviceId, "ir-transmitter"),
|
|
28163
28319
|
lawnMowerControl: createSliceHandle(stateSource, binding.deviceId, "lawn-mower-control"),
|
|
28164
28320
|
lockControl: createSliceHandle(stateSource, binding.deviceId, "lock-control"),
|
|
28165
28321
|
mediaPlayer: createSliceHandle(stateSource, binding.deviceId, "media-player"),
|
|
@@ -28238,6 +28394,7 @@ function createDeviceProxy(api, binding, opts) {
|
|
|
28238
28394
|
...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
|
|
28239
28395
|
...bound("do-not-disturb") ? { doNotDisturb: doNotDisturbInterface } : {},
|
|
28240
28396
|
...bound("doorbell") ? { doorbell: doorbellInterface } : {},
|
|
28397
|
+
...bound("energy-system") ? { energySystem: energySystemInterface } : {},
|
|
28241
28398
|
...bound("enum-sensor") ? { enumSensor: enumSensorInterface } : {},
|
|
28242
28399
|
...bound("event-emitter") ? { eventEmitter: eventEmitterInterface } : {},
|
|
28243
28400
|
...bound("fan-control") ? { fanControl: fanControlInterface } : {},
|
|
@@ -127,6 +127,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
127
127
|
* water, cooling, solar), its system modes and its power. One main read-only
|
|
128
128
|
* `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
|
|
129
129
|
DeviceType["HeatPump"] = "heat-pump";
|
|
130
|
+
/** A home energy installation (any vendor): solar, grid, house, a metered heat pump
|
|
131
|
+
* and the storage as branches of one bus. One read-only `energy-system` cap carries
|
|
132
|
+
* every value; the storage is a field of it, never the `battery` cap (#513, #522). */
|
|
133
|
+
DeviceType["EnergySystem"] = "energy-system";
|
|
130
134
|
return DeviceType;
|
|
131
135
|
}({});
|
|
132
136
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -127,6 +127,10 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
127
127
|
* water, cooling, solar), its system modes and its power. One main read-only
|
|
128
128
|
* `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
|
|
129
129
|
DeviceType["HeatPump"] = "heat-pump";
|
|
130
|
+
/** A home energy installation (any vendor): solar, grid, house, a metered heat pump
|
|
131
|
+
* and the storage as branches of one bus. One read-only `energy-system` cap carries
|
|
132
|
+
* every value; the storage is a field of it, never the `battery` cap (#513, #522). */
|
|
133
|
+
DeviceType["EnergySystem"] = "energy-system";
|
|
130
134
|
return DeviceType;
|
|
131
135
|
}({});
|
|
132
136
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a capability DECLARES its vocabulary in its own `*.cap.ts` (D1050). The
|
|
3
|
+
* cap vocabulary (D920) is generated from these declarations by
|
|
4
|
+
* `npm run codegen` into `generated/cap-vocabulary.ts`; nothing hand-writes an
|
|
5
|
+
* entry of the map any more (`scripts/check-no-handwritten-cap-vocabulary.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Three places, each next to what it phrases:
|
|
8
|
+
*
|
|
9
|
+
* - an ACTION is declared on the method it calls — `method(input, output,
|
|
10
|
+
* { kind: 'mutation', actions: [...] })`, typed against that method's Zod
|
|
11
|
+
* input (fixed `args` and `openArgs` keys) — and a mutation that must never
|
|
12
|
+
* become a step says why with `notOperatorFacing` there. A method with
|
|
13
|
+
* neither is refused by `check-cap-vocabulary`: no mutation is offered by
|
|
14
|
+
* default.
|
|
15
|
+
* - an EVENT's trigger wording (or its excuse) sits on the event declaration.
|
|
16
|
+
* - the rest — the cap's noun, its state triggers, wording overrides by device
|
|
17
|
+
* type or role, bus events with no declared cap event, and the picker order —
|
|
18
|
+
* is the cap's `vocabulary` block. A system-scoped cap's block is only the
|
|
19
|
+
* reason it is never a device's vocabulary.
|
|
20
|
+
*
|
|
21
|
+
* These shapes are string-keyed: a status field, a dynamic-offer method or an
|
|
22
|
+
* effect field cannot be named by its cap's TYPE inside the very object that
|
|
23
|
+
* defines the cap. The generated map is typed `CapVocabularyMap`, which checks
|
|
24
|
+
* every one of those names against the cap definition, and
|
|
25
|
+
* `check-cap-vocabulary` checks values against the Zod schemas.
|
|
26
|
+
*/
|
|
27
|
+
import type { L10n, LooseVocabEffect, LooseVocabOffer, LooseVocabOverrides, LooseVocabStateTrigger, VocabEffectValue, VocabEventTrigger, VocabIcon } from './types.js';
|
|
28
|
+
/** The operator-supplied keys of a method input (`deviceId` is the target). */
|
|
29
|
+
export type MethodActionArgs<TInput> = TInput extends object ? Omit<TInput, 'deviceId'> : Record<never, never>;
|
|
30
|
+
/** An open arg of a method action, keyed by the method's own input. */
|
|
31
|
+
export interface MethodActionOpenArg<TKey extends string = string> {
|
|
32
|
+
readonly key: TKey;
|
|
33
|
+
readonly label: L10n;
|
|
34
|
+
readonly offer: LooseVocabOffer;
|
|
35
|
+
/** The method accepts the call without it. */
|
|
36
|
+
readonly optional?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/** The state a method action leads to (D983) — see `VocabEffectFor`. */
|
|
39
|
+
export type MethodActionEffect<TKey extends string = string> = {
|
|
40
|
+
readonly field: string;
|
|
41
|
+
readonly value: VocabEffectValue;
|
|
42
|
+
} | {
|
|
43
|
+
readonly field: string;
|
|
44
|
+
readonly fromArg: TKey;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* One operator-facing action declared on the method it calls. `TInput` is the
|
|
48
|
+
* method's Zod input; the action's `method` is the key the method is declared
|
|
49
|
+
* under, filled in by codegen.
|
|
50
|
+
*/
|
|
51
|
+
export interface MethodActionDecl<TInput = Readonly<Record<string, unknown>>> {
|
|
52
|
+
/** Stable id — persisted by steps as their `actionId` (`switch.on`). */
|
|
53
|
+
readonly id: string;
|
|
54
|
+
/** Short label for a picker ("Turn on"). */
|
|
55
|
+
readonly label: L10n;
|
|
56
|
+
/** The sentence ("Turn on {device}"); placeholders are `{device}` and arg keys. */
|
|
57
|
+
readonly phrase: L10n;
|
|
58
|
+
readonly icon: VocabIcon;
|
|
59
|
+
/** Args baked into the action — never asked. */
|
|
60
|
+
readonly args?: Partial<MethodActionArgs<TInput>>;
|
|
61
|
+
/** Args the operator fills. */
|
|
62
|
+
readonly openArgs?: readonly MethodActionOpenArg<keyof MethodActionArgs<TInput> & string>[];
|
|
63
|
+
/** The state this action leads to, when it is one. */
|
|
64
|
+
readonly effect?: MethodActionEffect<keyof MethodActionArgs<TInput> & string>;
|
|
65
|
+
}
|
|
66
|
+
/** A method action as codegen reads it off a method schema, string-keyed. */
|
|
67
|
+
export interface LooseMethodActionDecl {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly label: L10n;
|
|
70
|
+
readonly phrase: L10n;
|
|
71
|
+
readonly icon: VocabIcon;
|
|
72
|
+
readonly args?: Readonly<Record<string, unknown>>;
|
|
73
|
+
readonly openArgs?: readonly MethodActionOpenArg[];
|
|
74
|
+
readonly effect?: LooseVocabEffect;
|
|
75
|
+
}
|
|
76
|
+
/** What a declared cap event is to an automation: a trigger, or an excuse. */
|
|
77
|
+
export type EventVocabularyDecl = {
|
|
78
|
+
readonly trigger: VocabEventTrigger;
|
|
79
|
+
readonly notOperatorFacing?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
readonly notOperatorFacing: string;
|
|
82
|
+
readonly trigger?: undefined;
|
|
83
|
+
};
|
|
84
|
+
/** The `vocabulary` block of a device-scoped cap. */
|
|
85
|
+
export interface DeviceCapVocabularyDecl {
|
|
86
|
+
/** What the cap is, for grouping ("Switch" / "Interruttore"). */
|
|
87
|
+
readonly noun: L10n;
|
|
88
|
+
/**
|
|
89
|
+
* Where the cap's actions and triggers sit among a device's caps in a
|
|
90
|
+
* picker — lower first. Caps of one family share a thousand
|
|
91
|
+
* (actuators 1xxx, appliances 2xxx, camera 3xxx, heat pump 4xxx, sensors 5xxx).
|
|
92
|
+
*/
|
|
93
|
+
readonly order: number;
|
|
94
|
+
readonly state?: readonly LooseVocabStateTrigger[];
|
|
95
|
+
/** Bus events the cap's devices emit with no declared cap event behind them. */
|
|
96
|
+
readonly extraEvents?: readonly VocabEventTrigger[];
|
|
97
|
+
/** Wording that differs for a device type or role (a switch that is a siren). */
|
|
98
|
+
readonly overrides?: LooseVocabOverrides;
|
|
99
|
+
readonly notOperatorFacing?: undefined;
|
|
100
|
+
}
|
|
101
|
+
/** The `vocabulary` block of a system-scoped cap: why it is no device's vocabulary. */
|
|
102
|
+
export interface SystemCapVocabularyDecl {
|
|
103
|
+
readonly notOperatorFacing: string;
|
|
104
|
+
readonly noun?: undefined;
|
|
105
|
+
}
|
|
106
|
+
/** A cap's `vocabulary` block. */
|
|
107
|
+
export type CapVocabularyDecl = DeviceCapVocabularyDecl | SystemCapVocabularyDecl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The cap vocabulary (D920) — what every capability lets an operator DO to a
|
|
3
|
-
* device and WATCH it for, in one cap-keyed map
|
|
3
|
+
* device and WATCH it for, in one cap-keyed map generated from the caps (D1050).
|
|
4
4
|
*/
|
|
5
5
|
export type { ResolvedBooleanTrigger, ResolvedEnumTrigger, ResolvedEnumValue, ResolvedEventTrigger, ResolvedNumericTrigger, ResolvedValueTrigger, ResolvedVocabAction, ResolvedVocabTrigger, VocabBindingsInput, } from './resolve.js';
|
|
6
6
|
export { actionsForDevice, renderVocabPhrase, triggersForDevice, } from './resolve.js';
|
|
@@ -9,5 +9,7 @@ export { actionEffect, allVocabActions, assertDeviceOffers, findVocabAction, Voc
|
|
|
9
9
|
export type { CommandEffect } from './command-catalog.js';
|
|
10
10
|
export { auditedFields, commandEffect, isCommand } from './command-catalog.js';
|
|
11
11
|
export { VOCAB_TEMPLATES } from './templates.js';
|
|
12
|
-
export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapStatusField, CapVocabularyEntry, CapVocabularyMap,
|
|
12
|
+
export type { ActionArgKey, ActionArgs, BooleanOffer, CapEventName, CapMethodName, CapStatusField, CapVocabularyEntry, CapVocabularyMap, DeviceCapVocabulary, DeviceVocabCapName, DynamicOffer, EnumOffer, EnumStateValue, L10n, LooseCapVocabularyEntry, LooseDynamicOffer, LooseVocabAction, LooseVocabEffect, LooseVocabOffer, LooseVocabOpenArg, LooseVocabStateTrigger, NumberOffer, SystemCapVocabulary, SystemVocabCapName, TextOffer, VocabAction, VocabCapName, VocabChoice, VocabEffectFor, VocabEffectValue, VocabEventTrigger, VocabIcon, VocabLocale, VocabOffer, VocabOpenArg, VocabStateTrigger, } from './types.js';
|
|
13
13
|
export { CAP_VOCABULARY, CAP_VOCABULARY_BY_NAME } from './vocabulary.js';
|
|
14
|
+
export type { CapVocabularyDecl, DeviceCapVocabularyDecl, EventVocabularyDecl, LooseMethodActionDecl, MethodActionArgs, MethodActionDecl, MethodActionEffect, MethodActionOpenArg, SystemCapVocabularyDecl, } from './declaration.js';
|
|
15
|
+
export { NOT_A_DEVICE } from './system-reasons.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Why a system-scoped cap is never part of a device's vocabulary (D920): the
|
|
3
|
+
* reasons several caps share, named once. A cap's `vocabulary` block cites
|
|
4
|
+
* one (`vocabulary: { notOperatorFacing: NOT_A_DEVICE.STORAGE }`) or states
|
|
5
|
+
* its own.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NOT_A_DEVICE: {
|
|
8
|
+
readonly UI_PLUMBING: 'admin UI plumbing — pages, widgets and routes, not something a device does';
|
|
9
|
+
readonly ADDON_ADMIN: 'addon administration — installed and configured from the Addons page';
|
|
10
|
+
readonly PIPELINE: 'detection pipeline machinery — tuned on the pipeline pages, never actuated per device';
|
|
11
|
+
readonly STORAGE: 'storage administration — locations, retention and migrations, not a device action';
|
|
12
|
+
readonly IDENTITY: 'identity and access administration — users, sign-in and secrets';
|
|
13
|
+
readonly NETWORK: 'network administration of the cluster — addresses, mesh, tunnels';
|
|
14
|
+
readonly CLUSTER: 'cluster administration — nodes, server package, metrics';
|
|
15
|
+
readonly ML: 'model and training machinery — no device action';
|
|
16
|
+
readonly INTERNAL: 'internal plumbing between addons — never operator-facing';
|
|
17
|
+
};
|
|
@@ -109,7 +109,8 @@ export interface BooleanOffer {
|
|
|
109
109
|
readonly kind: 'boolean';
|
|
110
110
|
}
|
|
111
111
|
/**
|
|
112
|
-
* Values the DEVICE knows, read at authoring time from the same cap
|
|
112
|
+
* Values the DEVICE knows, read at authoring time from the same cap (or, for a
|
|
113
|
+
* status list, a sibling cap of the same device — {@link SiblingStatusOffer}):
|
|
113
114
|
* a status field holding a list, or a read method returning one.
|
|
114
115
|
* `valueKey` / `labelKey` pick the fields of an object item (omit both for a
|
|
115
116
|
* list of strings); `where` keeps only items whose field equals a value.
|
|
@@ -137,7 +138,26 @@ export type DynamicOffer<C extends VocabCapName> = {
|
|
|
137
138
|
readonly equals: string | number | boolean;
|
|
138
139
|
};
|
|
139
140
|
readonly valueKind?: 'string' | 'number';
|
|
140
|
-
};
|
|
141
|
+
} | SiblingStatusOffer;
|
|
142
|
+
/**
|
|
143
|
+
* Values read from the status of ANOTHER cap the same device binds (D1050):
|
|
144
|
+
* `heat-pump-control.setCircuitComfortSetpoint` offers the circuits that
|
|
145
|
+
* `heat-pump-status` reports. `field` is a status field of `cap`, checked by
|
|
146
|
+
* `scripts/check-cap-vocabulary.ts`.
|
|
147
|
+
*/
|
|
148
|
+
export interface SiblingStatusOffer {
|
|
149
|
+
readonly kind: 'dynamic';
|
|
150
|
+
readonly from: 'status';
|
|
151
|
+
readonly cap: DeviceVocabCapName;
|
|
152
|
+
readonly field: string;
|
|
153
|
+
readonly valueKey?: string;
|
|
154
|
+
readonly labelKey?: string;
|
|
155
|
+
readonly where?: {
|
|
156
|
+
readonly key: string;
|
|
157
|
+
readonly equals: string | number | boolean;
|
|
158
|
+
};
|
|
159
|
+
readonly valueKind?: 'string' | 'number';
|
|
160
|
+
}
|
|
141
161
|
/** How the authoring UI offers a value for an open arg. */
|
|
142
162
|
export type VocabOffer<C extends VocabCapName> = EnumOffer | NumberOffer | TextOffer | BooleanOffer | DynamicOffer<C>;
|
|
143
163
|
/** An arg the operator fills after picking the action. */
|
|
@@ -324,14 +344,12 @@ export type CapVocabularyEntry<C extends VocabCapName> = CapDef<C>['scope'] exte
|
|
|
324
344
|
export type CapVocabularyMap = {
|
|
325
345
|
readonly [C in VocabCapName]: CapVocabularyEntry<C>;
|
|
326
346
|
};
|
|
327
|
-
/** A slice of the map, for files that hold a family of caps. */
|
|
328
|
-
export type CapVocabularySlice<K extends VocabCapName> = {
|
|
329
|
-
readonly [C in K]: CapVocabularyEntry<C>;
|
|
330
|
-
};
|
|
331
347
|
/** A dynamic offer with no cap-specific key type. */
|
|
332
348
|
export type LooseDynamicOffer = {
|
|
333
349
|
readonly kind: 'dynamic';
|
|
334
350
|
readonly from: 'status';
|
|
351
|
+
/** A sibling cap of the same device whose status holds the list; absent = this cap. */
|
|
352
|
+
readonly cap?: string;
|
|
335
353
|
readonly field: string;
|
|
336
354
|
readonly valueKey?: string;
|
|
337
355
|
readonly labelKey?: string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* THE cap vocabulary (D920): one complete, cap-keyed map of what every
|
|
3
|
+
* capability lets an operator DO to a device and WATCH it for — so a picker,
|
|
4
|
+
* a script editor and a phrase renderer all read one map.
|
|
5
|
+
*
|
|
6
|
+
* Declared on the caps, generated here (D1050): an action sits on the method
|
|
7
|
+
* it calls, an event's wording on the event, the rest in the cap's
|
|
8
|
+
* `vocabulary` block (`declaration.ts`); `npm run codegen` projects them into
|
|
9
|
+
* `generated/cap-vocabulary.ts`, typed {@link CapVocabularyMap} — a cap with
|
|
10
|
+
* no entry, or a name its cap does not have, is a TypeScript error there.
|
|
11
|
+
* Nothing hand-writes an entry (`scripts/check-no-handwritten-cap-vocabulary.ts`).
|
|
12
|
+
*/
|
|
13
|
+
import { CAP_VOCABULARY } from '../../generated/cap-vocabulary.js';
|
|
14
|
+
import type { LooseCapVocabularyEntry } from './types.js';
|
|
15
|
+
export { CAP_VOCABULARY };
|
|
4
16
|
/** The same map, read by a string cap name (a binding names caps as strings). */
|
|
5
17
|
export declare const CAP_VOCABULARY_BY_NAME: Readonly<Record<string, LooseCapVocabularyEntry>>;
|
|
@@ -5,7 +5,7 @@ import { DeviceType } from './device-type.js';
|
|
|
5
5
|
* kind can back several device types (`'switch'` ← Switch + Siren, `'sensor'`
|
|
6
6
|
* ← Sensor + Presence, `'dummy'` ← every placeholder/non-controllable type).
|
|
7
7
|
*/
|
|
8
|
-
export type DeviceControlKind = 'cover' | 'valve' | 'humidifier' | 'water-heater' | 'switch' | 'light' | 'fan' | 'sensor' | 'thermostat' | 'climate' | 'button' | 'update' | 'lock' | 'media-player' | 'alarm' | 'control' | 'weather' | 'vacuum' | 'lawn-mower' | 'image' | 'pet-feeder' | 'pet-fountain' | 'heater' | 'dishwasher' | 'appliance' | 'script' | 'automation' | 'dummy';
|
|
8
|
+
export type DeviceControlKind = 'cover' | 'valve' | 'humidifier' | 'water-heater' | 'switch' | 'light' | 'fan' | 'sensor' | 'thermostat' | 'climate' | 'button' | 'update' | 'lock' | 'media-player' | 'alarm' | 'control' | 'weather' | 'vacuum' | 'lawn-mower' | 'image' | 'pet-feeder' | 'pet-fountain' | 'heater' | 'dishwasher' | 'appliance' | 'script' | 'automation' | 'energy-system' | 'dummy';
|
|
9
9
|
/**
|
|
10
10
|
* Exhaustive `DeviceType` → `DeviceControlKind` map. Omitting a new enum member
|
|
11
11
|
* fails the build here (the single place the type→kind decision is encoded).
|
|
@@ -24,6 +24,7 @@ export declare const DEVICE_TYPE_ICON: {
|
|
|
24
24
|
readonly sensor: 'activity';
|
|
25
25
|
readonly climate: 'thermometer';
|
|
26
26
|
readonly "heat-pump": 'flame';
|
|
27
|
+
readonly "energy-system": 'solar-panel';
|
|
27
28
|
readonly button: 'circle-dot';
|
|
28
29
|
readonly "event-emitter": 'zap';
|
|
29
30
|
readonly update: 'refresh-cw';
|
|
@@ -113,7 +113,11 @@ export declare enum DeviceType {
|
|
|
113
113
|
/** A heat pump (any vendor): the compressor unit with its circuits (heating, hot
|
|
114
114
|
* water, cooling, solar), its system modes and its power. One main read-only
|
|
115
115
|
* `heat-pump-status` cap carries all of it; `heat-pump-control` sets it (D1026). */
|
|
116
|
-
HeatPump = "heat-pump"
|
|
116
|
+
HeatPump = "heat-pump",
|
|
117
|
+
/** A home energy installation (any vendor): solar, grid, house, a metered heat pump
|
|
118
|
+
* and the storage as branches of one bus. One read-only `energy-system` cap carries
|
|
119
|
+
* every value; the storage is a field of it, never the `battery` cap (#513, #522). */
|
|
120
|
+
EnergySystem = "energy-system"
|
|
117
121
|
}
|
|
118
122
|
export declare enum DeviceFeature {
|
|
119
123
|
BatteryOperated = "battery-operated",
|
|
@@ -25,6 +25,7 @@ export declare const HERO_LAYOUT_BY_TYPE: {
|
|
|
25
25
|
readonly humidifier: HeroLayout;
|
|
26
26
|
readonly "water-heater": HeroLayout;
|
|
27
27
|
readonly "heat-pump": HeroLayout;
|
|
28
|
+
readonly "energy-system": HeroLayout;
|
|
28
29
|
readonly fan: HeroLayout;
|
|
29
30
|
readonly "media-player": HeroLayout;
|
|
30
31
|
readonly "alarm-panel": HeroLayout;
|