@camstack/types 1.2.556 → 1.2.558
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 +19 -1
- package/dist/addon/fake-addon-context.d.ts +3 -0
- package/dist/addon.js +2 -2
- package/dist/addon.mjs +2 -2
- package/dist/automation/action-target.d.ts +8 -0
- package/dist/automation/action.d.ts +24 -54
- package/dist/automation/draft/draft-json.d.ts +1 -1
- package/dist/automation/draft/index.d.ts +0 -1
- package/dist/automation/index.d.ts +3 -2
- package/dist/automation/normalize-units.d.ts +3 -3
- package/dist/automation/offered.d.ts +18 -0
- package/dist/automation/recipe.d.ts +1156 -2598
- package/dist/automation/scheduler.d.ts +48 -108
- package/dist/automation/step-runner.d.ts +7 -0
- package/dist/capabilities/action-source.cap.d.ts +12 -27
- package/dist/capabilities/actions.cap.d.ts +84 -189
- package/dist/capabilities/device-export.cap.d.ts +36 -1
- package/dist/capabilities/hero-layout.cap.d.ts +92 -0
- package/dist/capabilities/index.d.ts +2 -2
- package/dist/capabilities/remote.cap.d.ts +2 -2
- package/dist/capabilities/scene-monitor.cap.d.ts +1 -1
- package/dist/capabilities/schedulers.cap.d.ts +96 -216
- package/dist/client.d.ts +1 -1
- package/dist/client.js +21 -3
- package/dist/client.mjs +20 -4
- package/dist/{composed-stable-id-CDNLq7Y8.js → composed-stable-id-BmJ_5GiE.js} +5 -0
- package/dist/{composed-stable-id-CPp3votu.mjs → composed-stable-id-iddnCQ51.mjs} +5 -0
- package/dist/composition/composition.d.ts +8 -0
- package/dist/composition/helpers/index.d.ts +1 -1
- package/dist/composition/helpers/save.d.ts +2 -0
- package/dist/composition/helpers/source-pick.d.ts +11 -5
- package/dist/composition/validate-composition.d.ts +2 -0
- package/dist/device/cap-vocabulary/action-index.d.ts +32 -0
- package/dist/device/cap-vocabulary/index.d.ts +2 -2
- package/dist/device/device-do-actions.d.ts +3 -105
- package/dist/device/device-kind.d.ts +36 -0
- package/dist/device/device-type.d.ts +5 -0
- package/dist/device/export-name.d.ts +65 -0
- package/dist/device/hero/hero-contribution-kit.d.ts +3 -0
- package/dist/device/hero/hero-fragment.d.ts +3 -0
- package/dist/device/hero/hero-look.d.ts +6 -0
- package/dist/device/hero/hero-measurement.d.ts +76 -0
- package/dist/device/hero/hero-model.d.ts +91 -0
- package/dist/device/hero/hero-row.d.ts +61 -0
- package/dist/device/hero/hero-scene.d.ts +1 -0
- package/dist/device/hero/index.d.ts +1 -0
- package/dist/device/index.d.ts +1 -1
- package/dist/generated/addon-api.d.ts +7 -0
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/{implemented-methods-5YMDeE3f.mjs → implemented-methods-CSTk6zYK.mjs} +147 -2
- package/dist/{implemented-methods-Cj65uy2F.js → implemented-methods-CfaRR_ki.js} +212 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +3145 -2959
- package/dist/index.mjs +3095 -2936
- package/dist/node.js +2 -2
- package/dist/node.mjs +2 -2
- package/dist/notification/alarm-steps.d.ts +18 -0
- package/dist/remote/remote-config.d.ts +5 -5
- package/dist/{sleep-Czv-4wFH.mjs → sleep-BvVGLl30.mjs} +52 -2
- package/dist/{sleep-BRGFFgr9.js → sleep-CyWfD1LJ.js} +69 -1
- package/dist/testing.js +3 -3
- package/dist/testing.mjs +3 -3
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* value this entry does not export — a missing name here is `undefined` at
|
|
15
15
|
* runtime, not a build error.
|
|
16
16
|
*/
|
|
17
|
-
export { APPLE_SA_TO_MACRO, AUDIO_MACRO_LABELS, AlarmArmModeSchema, CLIP_BROKER_PACED_RATES, COCO_TO_MACRO, CamProfileSchema, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, LOCATION_ICON_FALLBACK, REMOTE_CUSTOM_ROLE_ICON, REMOTE_ROLE_VOCABULARY, DEFINITIVE_DEVICE_REFUSALS, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, DEVICE_CERT_SIGNATURE, DEVICE_SIGNATURE_MESSAGE_VERSION, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DeviceType, EVENTFUL_CAP_NAMES, EVENT_KIND_BY_CAP, EVENT_TAXONOMY, MACRO_LABELS, NC_ALARM_DELAY_MAX_SEC, NC_ALARM_SENSORS_MAX, NC_ALARM_SYSTEM_EVENT_KINDS, NC_ALARM_TRIGGERED_MAX_SEC, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CAMERA_SCOPE_CAP_NAME, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_GROUPING_DEFAULT_SEC, NC_GROUPING_MAX_SEC, NC_GROUPING_MIN_SEC, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_CLASS_SPECS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NcAlarmConfigSchema, NcAlarmSensorsSchema, NcAlarmSettingsPatchSchema, NcHistoryEntrySchema, NcRuleLastRunsSchema, NodeDirectorySchema, RECORDING_EXPORT_MAX_READ_BYTES, RETRAIN_REVIEW_ADJUSTED_IOU, RETRAIN_REVIEW_MATCH_IOU, RETRAIN_REVIEW_STATUSES, RETRAIN_REVISION_CONFLICT, SystemMirror, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleSchema, YAMNET_TO_MACRO, alarmDeviceBlocksArming, alarmDeviceSecureOnArm, alarmPatchLanded, canonicalIconKey, buildDeviceEnrollmentLink, buildDeviceSignatureMessage, deviceRefusalFromMessage, isDefinitiveDeviceRefusal, classifyRetrainReview, conditionVisibleForKind, createSystemProxy, droppedConditionsForKind, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, isHeldBackTemplateVar, isSystemRuleKind, kindsForDiscriminator, locationIconKey, knownValues, nodePickerItems, parseDeviceEnrollmentLink, packagePickerItems, pickerForCondition, pickerForRuleClasses, parseRetrainRevisionConflict, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, resolveIconKey, resolveModeDelays, retrainBoxIou, retrainRevisionConflictMessage, ruleDeviceCompatCapNames, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleSeedForSection, searchIcons, sensorTransitionNeverFires, sensorTransitionOffered, stateLabel, summarizeReview, systemEventClassesFor, systemEventClassKinds, systemEventDeliveryProblems, systemEventFilterAppliesToAnyKind, systemEventKindsOfFamily, systemFamilyOfKind, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, buildSubjectPath, isDrawableSubjectPath, projectSubjectPath, subjectPathSampleFromBox, subjectPathSvgPoints, expandSystemEventClasses, withSystemEventClasses, bundledCamstack, paintHex, paletteResultSchema, CONTAINER_PRIMARY_CHILD_RULES, primaryChildPreferenceOf, resolveContainerPrimaryChild, } from './index.js';
|
|
17
|
+
export { APPLE_SA_TO_MACRO, AUDIO_MACRO_LABELS, AlarmArmModeSchema, CLIP_BROKER_PACED_RATES, COCO_TO_MACRO, CamProfileSchema, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, LOCATION_ICON_FALLBACK, REMOTE_CUSTOM_ROLE_ICON, REMOTE_ROLE_VOCABULARY, DEFINITIVE_DEVICE_REFUSALS, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, DEVICE_CERT_SIGNATURE, DEVICE_SIGNATURE_MESSAGE_VERSION, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DeviceType, EVENTFUL_CAP_NAMES, EVENT_KIND_BY_CAP, EVENT_TAXONOMY, MACRO_LABELS, NC_ALARM_DELAY_MAX_SEC, NC_ALARM_SENSORS_MAX, NC_ALARM_SYSTEM_EVENT_KINDS, NC_ALARM_TRIGGERED_MAX_SEC, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CAMERA_SCOPE_CAP_NAME, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_GROUPING_DEFAULT_SEC, NC_GROUPING_MAX_SEC, NC_GROUPING_MIN_SEC, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_CLASS_SPECS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NcAlarmConfigSchema, NcAlarmSensorsSchema, NcAlarmSettingsPatchSchema, NcHistoryEntrySchema, NcRuleLastRunsSchema, NodeDirectorySchema, RECORDING_EXPORT_MAX_READ_BYTES, RETRAIN_REVIEW_ADJUSTED_IOU, RETRAIN_REVIEW_MATCH_IOU, RETRAIN_REVIEW_STATUSES, RETRAIN_REVISION_CONFLICT, SystemMirror, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleSchema, YAMNET_TO_MACRO, alarmDeviceBlocksArming, alarmDeviceSecureOnArm, alarmPatchLanded, canonicalIconKey, buildDeviceEnrollmentLink, buildDeviceSignatureMessage, deviceRefusalFromMessage, isDefinitiveDeviceRefusal, classifyRetrainReview, conditionVisibleForKind, createSystemProxy, droppedConditionsForKind, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, isHeldBackTemplateVar, isSystemRuleKind, kindsForDiscriminator, locationIconKey, knownValues, nodePickerItems, parseDeviceEnrollmentLink, packagePickerItems, pickerForCondition, pickerForRuleClasses, parseRetrainRevisionConflict, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, resolveIconKey, resolveModeDelays, retrainBoxIou, retrainRevisionConflictMessage, ruleDeviceCompatCapNames, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleSeedForSection, searchIcons, sensorTransitionNeverFires, sensorTransitionOffered, stepActuatesAlarmPanel, stepPullsAlarmTrigger, stateLabel, summarizeReview, systemEventClassesFor, systemEventClassKinds, systemEventDeliveryProblems, systemEventFilterAppliesToAnyKind, systemEventKindsOfFamily, systemFamilyOfKind, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, buildSubjectPath, isDrawableSubjectPath, projectSubjectPath, subjectPathSampleFromBox, subjectPathSvgPoints, expandSystemEventClasses, withSystemEventClasses, bundledCamstack, paintHex, paletteResultSchema, CONTAINER_PRIMARY_CHILD_RULES, primaryChildPreferenceOf, resolveContainerPrimaryChild, } from './index.js';
|
|
18
18
|
export type { ContainerPrimaryChildPreference } from './index.js';
|
|
19
19
|
export type { PaletteReady, PaletteResult, PaletteEntryId, PalettePresetId } from './index.js';
|
|
20
20
|
export type { RemoteRoleVocabEntry, VocabLocale } from './index.js';
|
package/dist/client.js
CHANGED
|
@@ -28914,6 +28914,7 @@ function createSystemProxy(api) {
|
|
|
28914
28914
|
listExposedDevices: (input) => dispatch("deviceExport", "listExposedDevices", "query", input),
|
|
28915
28915
|
exposeDevice: (input) => dispatch("deviceExport", "exposeDevice", "mutation", input),
|
|
28916
28916
|
unexposeDevice: (input) => dispatch("deviceExport", "unexposeDevice", "mutation", input),
|
|
28917
|
+
setExposedName: (input) => dispatch("deviceExport", "setExposedName", "mutation", input),
|
|
28917
28918
|
listSupportedEntityKinds: (input) => dispatch("deviceExport", "listSupportedEntityKinds", "query", input),
|
|
28918
28919
|
listExposedEntities: (input) => dispatch("deviceExport", "listExposedEntities", "query", input),
|
|
28919
28920
|
exposeEntity: (input) => dispatch("deviceExport", "exposeEntity", "mutation", input),
|
|
@@ -30747,11 +30748,26 @@ function subjectPathSvgPoints(run, width, height) {
|
|
|
30747
30748
|
const fmt = (v) => String(Math.round(v * 100) / 100);
|
|
30748
30749
|
return run.map((p) => `${fmt(p.x * width)},${fmt(p.y * height)}`).join(" ");
|
|
30749
30750
|
}
|
|
30751
|
+
var ALARM_PANEL_ACTIONS = new Set([
|
|
30752
|
+
"alarm.trigger",
|
|
30753
|
+
"alarm.disarm",
|
|
30754
|
+
"alarm.arm.home",
|
|
30755
|
+
"alarm.arm.away",
|
|
30756
|
+
"alarm.arm.night",
|
|
30757
|
+
"alarm.arm.vacation",
|
|
30758
|
+
"alarm.arm.custom_bypass"
|
|
30759
|
+
]);
|
|
30760
|
+
/** A command step on the alarm panel (arm, disarm or trigger). */
|
|
30761
|
+
function stepActuatesAlarmPanel(step) {
|
|
30762
|
+
return step.kind === "command" && ALARM_PANEL_ACTIONS.has(step.actionId);
|
|
30763
|
+
}
|
|
30764
|
+
/** A command step that pulls the alarm panel's trigger. */
|
|
30765
|
+
function stepPullsAlarmTrigger(step) {
|
|
30766
|
+
return step.kind === "command" && step.actionId === "alarm.trigger";
|
|
30767
|
+
}
|
|
30750
30768
|
//#endregion
|
|
30751
30769
|
//#region src/notification/alarm-membership.ts
|
|
30752
30770
|
var ARMED_WORD_PREFIX = "armed_";
|
|
30753
|
-
var ALARM_PANEL_CAP = "alarm-panel";
|
|
30754
|
-
var ALARM_PANEL_TRIGGER_METHOD = "trigger";
|
|
30755
30771
|
/**
|
|
30756
30772
|
* The sensor-event kinds that are OPENINGS to the alarm — the keys of the
|
|
30757
30773
|
* engine's opening table (`alarm-openings.ts`, which is checked against this
|
|
@@ -30766,7 +30782,7 @@ var NC_ALARM_OPENING_EVENT_KINDS = [
|
|
|
30766
30782
|
function actionPullsAlarmTrigger(actionId, actionStepsOf) {
|
|
30767
30783
|
const steps = actionStepsOf?.(actionId);
|
|
30768
30784
|
if (steps === void 0) return false;
|
|
30769
|
-
return steps.some(
|
|
30785
|
+
return steps.some(stepPullsAlarmTrigger);
|
|
30770
30786
|
}
|
|
30771
30787
|
/** True when the rule's deviceState gate names any `armed_*` word. */
|
|
30772
30788
|
function ruleGatedOnArmedState(rule) {
|
|
@@ -33258,6 +33274,8 @@ exports.searchIcons = searchIcons;
|
|
|
33258
33274
|
exports.sensorTransitionNeverFires = sensorTransitionNeverFires;
|
|
33259
33275
|
exports.sensorTransitionOffered = sensorTransitionOffered;
|
|
33260
33276
|
exports.stateLabel = stateLabel;
|
|
33277
|
+
exports.stepActuatesAlarmPanel = stepActuatesAlarmPanel;
|
|
33278
|
+
exports.stepPullsAlarmTrigger = stepPullsAlarmTrigger;
|
|
33261
33279
|
exports.subjectPathSampleFromBox = subjectPathSampleFromBox;
|
|
33262
33280
|
exports.subjectPathSvgPoints = subjectPathSvgPoints;
|
|
33263
33281
|
exports.summarizeReview = summarizeReview;
|
package/dist/client.mjs
CHANGED
|
@@ -28913,6 +28913,7 @@ function createSystemProxy(api) {
|
|
|
28913
28913
|
listExposedDevices: (input) => dispatch("deviceExport", "listExposedDevices", "query", input),
|
|
28914
28914
|
exposeDevice: (input) => dispatch("deviceExport", "exposeDevice", "mutation", input),
|
|
28915
28915
|
unexposeDevice: (input) => dispatch("deviceExport", "unexposeDevice", "mutation", input),
|
|
28916
|
+
setExposedName: (input) => dispatch("deviceExport", "setExposedName", "mutation", input),
|
|
28916
28917
|
listSupportedEntityKinds: (input) => dispatch("deviceExport", "listSupportedEntityKinds", "query", input),
|
|
28917
28918
|
listExposedEntities: (input) => dispatch("deviceExport", "listExposedEntities", "query", input),
|
|
28918
28919
|
exposeEntity: (input) => dispatch("deviceExport", "exposeEntity", "mutation", input),
|
|
@@ -30746,11 +30747,26 @@ function subjectPathSvgPoints(run, width, height) {
|
|
|
30746
30747
|
const fmt = (v) => String(Math.round(v * 100) / 100);
|
|
30747
30748
|
return run.map((p) => `${fmt(p.x * width)},${fmt(p.y * height)}`).join(" ");
|
|
30748
30749
|
}
|
|
30750
|
+
var ALARM_PANEL_ACTIONS = new Set([
|
|
30751
|
+
"alarm.trigger",
|
|
30752
|
+
"alarm.disarm",
|
|
30753
|
+
"alarm.arm.home",
|
|
30754
|
+
"alarm.arm.away",
|
|
30755
|
+
"alarm.arm.night",
|
|
30756
|
+
"alarm.arm.vacation",
|
|
30757
|
+
"alarm.arm.custom_bypass"
|
|
30758
|
+
]);
|
|
30759
|
+
/** A command step on the alarm panel (arm, disarm or trigger). */
|
|
30760
|
+
function stepActuatesAlarmPanel(step) {
|
|
30761
|
+
return step.kind === "command" && ALARM_PANEL_ACTIONS.has(step.actionId);
|
|
30762
|
+
}
|
|
30763
|
+
/** A command step that pulls the alarm panel's trigger. */
|
|
30764
|
+
function stepPullsAlarmTrigger(step) {
|
|
30765
|
+
return step.kind === "command" && step.actionId === "alarm.trigger";
|
|
30766
|
+
}
|
|
30749
30767
|
//#endregion
|
|
30750
30768
|
//#region src/notification/alarm-membership.ts
|
|
30751
30769
|
var ARMED_WORD_PREFIX = "armed_";
|
|
30752
|
-
var ALARM_PANEL_CAP = "alarm-panel";
|
|
30753
|
-
var ALARM_PANEL_TRIGGER_METHOD = "trigger";
|
|
30754
30770
|
/**
|
|
30755
30771
|
* The sensor-event kinds that are OPENINGS to the alarm — the keys of the
|
|
30756
30772
|
* engine's opening table (`alarm-openings.ts`, which is checked against this
|
|
@@ -30765,7 +30781,7 @@ var NC_ALARM_OPENING_EVENT_KINDS = [
|
|
|
30765
30781
|
function actionPullsAlarmTrigger(actionId, actionStepsOf) {
|
|
30766
30782
|
const steps = actionStepsOf?.(actionId);
|
|
30767
30783
|
if (steps === void 0) return false;
|
|
30768
|
-
return steps.some(
|
|
30784
|
+
return steps.some(stepPullsAlarmTrigger);
|
|
30769
30785
|
}
|
|
30770
30786
|
/** True when the rule's deviceState gate names any `armed_*` word. */
|
|
30771
30787
|
function ruleGatedOnArmedState(rule) {
|
|
@@ -33142,4 +33158,4 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
|
|
|
33142
33158
|
updatedAt: z.number()
|
|
33143
33159
|
});
|
|
33144
33160
|
//#endregion
|
|
33145
|
-
export { APPLE_SA_TO_MACRO, AUDIO_MACRO_LABELS, AlarmArmModeSchema, CLIP_BROKER_PACED_RATES, COCO_TO_MACRO, CONTAINER_PRIMARY_CHILD_RULES, CamProfileSchema, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DEFINITIVE_DEVICE_REFUSALS, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_CERT_SIGNATURE, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, DEVICE_SIGNATURE_MESSAGE_VERSION, DeviceType, EVENTFUL_CAP_NAMES, EVENT_KIND_BY_CAP, EVENT_TAXONOMY, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, LOCATION_ICON_FALLBACK, MACRO_LABELS, NC_ALARM_DELAY_MAX_SEC, NC_ALARM_SENSORS_MAX, NC_ALARM_SYSTEM_EVENT_KINDS, NC_ALARM_TRIGGERED_MAX_SEC, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CAMERA_SCOPE_CAP_NAME, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_GROUPING_DEFAULT_SEC, NC_GROUPING_MAX_SEC, NC_GROUPING_MIN_SEC, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SYSTEM_EVENT_CLASS_SPECS, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NcAlarmConfigSchema, NcAlarmSensorsSchema, NcAlarmSettingsPatchSchema, NcHistoryEntrySchema, NcRuleLastRunsSchema, NodeDirectorySchema, RECORDING_EXPORT_MAX_READ_BYTES, REMOTE_CUSTOM_ROLE_ICON, REMOTE_ROLE_VOCABULARY, RETRAIN_REVIEW_ADJUSTED_IOU, RETRAIN_REVIEW_MATCH_IOU, RETRAIN_REVIEW_STATUSES, RETRAIN_REVISION_CONFLICT, SystemMirror, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleSchema, YAMNET_TO_MACRO, alarmDeviceBlocksArming, alarmDeviceSecureOnArm, alarmPatchLanded, buildDeviceEnrollmentLink, buildDeviceSignatureMessage, buildSubjectPath, bundledCamstack, canonicalIconKey, classifyRetrainReview, conditionVisibleForKind, createSystemProxy, deviceRefusalFromMessage, droppedConditionsForKind, expandSystemEventClasses, iconCategoryLabel, iconEntry, iconsInCategory, isDefinitiveDeviceRefusal, isDrawableSubjectPath, isHeldBackTemplateVar, isIconKey, isSystemRuleKind, kindsForDiscriminator, knownValues, locationIconKey, nodePickerItems, packagePickerItems, paintHex, paletteResultSchema, parseDeviceEnrollmentLink, parseRetrainRevisionConflict, pickerForCondition, pickerForRuleClasses, primaryChildPreferenceOf, projectSubjectPath, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, resolveContainerPrimaryChild, resolveIconKey, resolveModeDelays, retrainBoxIou, retrainRevisionConflictMessage, ruleDeviceCompatCapNames, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleSeedForSection, searchIcons, sensorTransitionNeverFires, sensorTransitionOffered, stateLabel, subjectPathSampleFromBox, subjectPathSvgPoints, summarizeReview, systemEventClassKinds, systemEventClassesFor, systemEventDeliveryProblems, systemEventFilterAppliesToAnyKind, systemEventKindsOfFamily, systemFamilyOfKind, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, withSystemEventClasses };
|
|
33161
|
+
export { APPLE_SA_TO_MACRO, AUDIO_MACRO_LABELS, AlarmArmModeSchema, CLIP_BROKER_PACED_RATES, COCO_TO_MACRO, CONTAINER_PRIMARY_CHILD_RULES, CamProfileSchema, DEFAULT_TIMELAPSE_PREVIEW_TEXT, DEFINITIVE_DEVICE_REFUSALS, DEVICE_CERT_RENEW_WINDOW_DAYS, DEVICE_CERT_SIGNATURE, DEVICE_DEFINITIVE_REFUSALS_BEFORE_DELETE, DEVICE_REFRESH_REFUSAL_PREFIX, DEVICE_SIGNATURE_MESSAGE_VERSION, DeviceType, EVENTFUL_CAP_NAMES, EVENT_KIND_BY_CAP, EVENT_TAXONOMY, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, LOCATION_ICON_FALLBACK, MACRO_LABELS, NC_ALARM_DELAY_MAX_SEC, NC_ALARM_SENSORS_MAX, NC_ALARM_SYSTEM_EVENT_KINDS, NC_ALARM_TRIGGERED_MAX_SEC, NC_BATTERY_CONSUMABLE_SYSTEM_EVENT_KINDS, NC_CAMERA_SCOPE_CAP_NAME, NC_CONSUMABLE_LOW_PERCENT_DEFAULT, NC_CONSUMABLE_LOW_PERCENT_MAX, NC_GROUPING_DEFAULT_SEC, NC_GROUPING_MAX_SEC, NC_GROUPING_MIN_SEC, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_SENSOR_TRANSITION_UNSUPPORTED_REASON, NC_SYSTEM_EVENT_CLASS_SPECS, NC_SYSTEM_EVENT_FAMILY_FILTERS, NC_SYSTEM_EVENT_KIND_GROUP_SPECS, NC_SYSTEM_EVENT_SUMMARY_FAMILIES, NC_TEMPLATE_HELD_BACK_SYSTEM_EVENT_KINDS, NC_TEMPLATE_VARS, NcAlarmConfigSchema, NcAlarmSensorsSchema, NcAlarmSettingsPatchSchema, NcHistoryEntrySchema, NcRuleLastRunsSchema, NodeDirectorySchema, RECORDING_EXPORT_MAX_READ_BYTES, REMOTE_CUSTOM_ROLE_ICON, REMOTE_ROLE_VOCABULARY, RETRAIN_REVIEW_ADJUSTED_IOU, RETRAIN_REVIEW_MATCH_IOU, RETRAIN_REVIEW_STATUSES, RETRAIN_REVISION_CONFLICT, SystemMirror, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleSchema, YAMNET_TO_MACRO, alarmDeviceBlocksArming, alarmDeviceSecureOnArm, alarmPatchLanded, buildDeviceEnrollmentLink, buildDeviceSignatureMessage, buildSubjectPath, bundledCamstack, canonicalIconKey, classifyRetrainReview, conditionVisibleForKind, createSystemProxy, deviceRefusalFromMessage, droppedConditionsForKind, expandSystemEventClasses, iconCategoryLabel, iconEntry, iconsInCategory, isDefinitiveDeviceRefusal, isDrawableSubjectPath, isHeldBackTemplateVar, isIconKey, isSystemRuleKind, kindsForDiscriminator, knownValues, locationIconKey, nodePickerItems, packagePickerItems, paintHex, paletteResultSchema, parseDeviceEnrollmentLink, parseRetrainRevisionConflict, pickerForCondition, pickerForRuleClasses, primaryChildPreferenceOf, projectSubjectPath, remoteRoleIcon, remoteRoleLabel, remoteRoleLegend, resolveContainerPrimaryChild, resolveIconKey, resolveModeDelays, retrainBoxIou, retrainRevisionConflictMessage, ruleDeviceCompatCapNames, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleSeedForSection, searchIcons, sensorTransitionNeverFires, sensorTransitionOffered, stateLabel, stepActuatesAlarmPanel, stepPullsAlarmTrigger, subjectPathSampleFromBox, subjectPathSvgPoints, summarizeReview, systemEventClassKinds, systemEventClassesFor, systemEventDeliveryProblems, systemEventFilterAppliesToAnyKind, systemEventKindsOfFamily, systemFamilyOfKind, templateCarriesSummary, templateVarDeliveryApplies, templateVarKindApplies, templateVarSystemEventApplies, withSystemEventClasses };
|
|
@@ -357,6 +357,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
357
357
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
358
|
* device also has a fan cap (D1033). */
|
|
359
359
|
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
361
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
362
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
363
|
+
* or colour this relay lacks. */
|
|
364
|
+
DeviceRole["SwitchLight"] = "switch-light";
|
|
360
365
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
366
|
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
367
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -357,6 +357,11 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
357
357
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
358
358
|
* device also has a fan cap (D1033). */
|
|
359
359
|
DeviceRole["SwitchFan"] = "switch-fan";
|
|
360
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
361
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
362
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
363
|
+
* or colour this relay lacks. */
|
|
364
|
+
DeviceRole["SwitchLight"] = "switch-light";
|
|
360
365
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
361
366
|
DeviceRole["ClimateAc"] = "climate-ac";
|
|
362
367
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -831,6 +831,14 @@ export declare const CompositionNewTargetSchema: z.ZodObject<{
|
|
|
831
831
|
role: z.ZodOptional<z.ZodEnum<typeof DeviceRole>>;
|
|
832
832
|
}, z.core.$strip>;
|
|
833
833
|
export type CompositionNewTarget = z.infer<typeof CompositionNewTargetSchema>;
|
|
834
|
+
/**
|
|
835
|
+
* A STORED block, read back: the `new` target of its composition may name a
|
|
836
|
+
* device type D1033 retired (`thermostat`). {@link CompositionNewTargetSchema}
|
|
837
|
+
* stays a strict enum on the wire, so the store rewrites the retired name to
|
|
838
|
+
* its canonical type (`source.composition.target.type`) before it parses the
|
|
839
|
+
* row. Anything else is returned untouched, for the schema to judge.
|
|
840
|
+
*/
|
|
841
|
+
export declare function canonicalStoredBlockTarget(block: unknown): unknown;
|
|
834
842
|
/** Customize an EXISTING device: each feature adds a capability or replaces fields of a native one (D663). */
|
|
835
843
|
export declare const CompositionExistingTargetSchema: z.ZodObject<{
|
|
836
844
|
kind: z.ZodLiteral<"existing">;
|
|
@@ -9,5 +9,5 @@ export { KWH_PER_WATT_MS, wattMillisecondsToKwh } from './energy.js';
|
|
|
9
9
|
export { type HistoryValue, type IntegralScale, type SeriesBefore, type SeriesKind, type SeriesPoint, type SeriesRead, STATISTIC_STATS, SERIES_KINDS, evaluateDerivative, evaluateStatistic, integrateReading, } from './history-math.js';
|
|
10
10
|
export { type CalendarPeriod, type CalendarWindow, type HistoryRetention, type HistoryTier, type HistoryTierPlan, type OpenRange, type ResetPeriod, type RollingSpan, type RollingWindow, type StatisticWindow, CALENDAR_PERIODS, CalendarWindowSchema, DAY_MS, DEFAULT_HISTORY_RETENTION, historyRetentionFromSettings, HISTORY_FAST_MS, HISTORY_SLOW_MS, HISTORY_TIERS, HOUR_MS, MINUTE_MS, MIN_CUSTOM_MINUTES, RESET_PERIODS, ROLLING_SPANS, RollingWindowSchema, StatisticWindowSchema, integralCadenceMs, maxDurationMs, nextLocalMidnight, openReset, openStatistic, planResetTier, planStatisticTier, rollingDurationMs, statisticCadenceMs, } from './history-window.js';
|
|
11
11
|
export { type HelperMemberFact, helperSaveProblems, } from './save.js';
|
|
12
|
-
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind, sourcePickForHistory, sourcePickForMath, sourcePickForTemplate, } from './source-pick.js';
|
|
12
|
+
export { type SourcePick, type SourcePickAccept, type SourcePickFieldChoice, type SourcePickHistory, type SourcePickRequest, type MathSourceKind, sourcePickForHistory, sourcePickForMath, sourcePickAcceptsDevice, sourcePickForTemplate, } from './source-pick.js';
|
|
13
13
|
export { ACTIVE_CRITERIA, AGGREGATE_REDUCERS, ActiveCriterionSchema, AggregateReducerSchema, BINARY_AGGREGATES, GROUP_TEMPLATE_IDS, ARITHMETIC_OPS, ArithmeticHelperSpecSchema, DERIVATIVE_UNITS, DerivativeHelperSpecSchema, EXPRESSION_OUTPUTS, ExpressionHelperSpecSchema, ThresholdHelperSpecSchema, GroupHelperSpecSchema, GroupTemplateIdSchema, HelperMemberSchema, HelperSpecSchema, INTEGRAL_OUTPUTS, IntegralHelperSpecSchema, MAX_HELPER_MEMBERS, helperMembers, isHistoryHelper, NUMERIC_AGGREGATES, StatisticHelperSpecSchema, type ActiveCriterion, type AggregateReducer, type BinaryAggregate, type ArithmeticHelperSpec, type ArithmeticOp, type DerivativeHelperSpec, type DerivativeUnit, type ExpressionHelperSpec, type ExpressionInput, type ExpressionOutput, type ThresholdHelperSpec, type GroupHelperSpec, type GroupTemplateId, type HelperMember, type HelperSpec, type HistoryHelperSpec, type IntegralHelperSpec, type IntegralOutput, type NumericAggregate, type StatisticHelperSpec, type StatisticStat, } from './spec.js';
|
|
@@ -9,6 +9,8 @@ import type { CompositionProblem } from '../composition-report.js';
|
|
|
9
9
|
/** What a save learned about one member device. Absent keys were not read. */
|
|
10
10
|
export interface HelperMemberFact {
|
|
11
11
|
readonly deviceType?: DeviceType;
|
|
12
|
+
/** The member's role, when read: a `switch-light` relay is a light member. */
|
|
13
|
+
readonly role?: string | null;
|
|
12
14
|
readonly quantity?: ReadingQuantity;
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The request the common source selector (#236) accepts for a helper (D944 §5).
|
|
3
|
-
* The selector's layout is not specified here. Groups ask for one device type
|
|
4
|
-
* and the catalog field; they do not opt into incompatible fields.
|
|
5
|
-
*/
|
|
6
1
|
import { DeviceType } from '../../device/device-type.js';
|
|
7
2
|
import type { CompositionSourceRef } from '../source-ref.js';
|
|
8
3
|
import type { GroupTemplate } from './catalog.js';
|
|
@@ -43,6 +38,17 @@ export interface SourcePick {
|
|
|
43
38
|
readonly compatibility: 'direct' | 'convert' | 'incompatible';
|
|
44
39
|
readonly history: 'recorded' | 'absent' | 'unknown';
|
|
45
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Does a device of this type and role answer the request's device types?
|
|
43
|
+
*
|
|
44
|
+
* The one gate both the member picker and the save use. No types = any device.
|
|
45
|
+
* A relay driving a lamp (`switch-light`) is a switch AND a light member: it
|
|
46
|
+
* joins a light group with its on/off only, and a command it cannot do
|
|
47
|
+
* (brightness, colour) skips it like any member that lacks the cap.
|
|
48
|
+
*/
|
|
49
|
+
export declare function sourcePickAcceptsDevice(request: Pick<SourcePickRequest, 'deviceTypes'>, deviceType: string, role: string | null | undefined): boolean;
|
|
50
|
+
/** `sourcePickAcceptsDevice` over a bare list of member types. */
|
|
51
|
+
export declare function memberKindAccepted(allowed: readonly DeviceType[], deviceType: string, role: string | null | undefined): boolean;
|
|
46
52
|
/** What the member step asks the selector for this template. */
|
|
47
53
|
export declare function sourcePickForTemplate(template: GroupTemplate): SourcePickRequest;
|
|
48
54
|
/** A statistic or integral reads one field that declares history. */
|
|
@@ -26,6 +26,8 @@ export interface CompositionSourceFound {
|
|
|
26
26
|
readonly caps: ReadonlySet<string>;
|
|
27
27
|
/** Present when the row was read. A helper group requires this one type. */
|
|
28
28
|
readonly deviceType?: DeviceType;
|
|
29
|
+
/** The row's role, when read: a `switch-light` relay joins a light group. */
|
|
30
|
+
readonly role?: string | null;
|
|
29
31
|
/** Present when the device declares one. Mixed quantities are refused. */
|
|
30
32
|
readonly quantity?: ReadingQuantity;
|
|
31
33
|
/**
|
|
@@ -29,3 +29,35 @@ export declare function vocabActionIdFor(cap: string, method: string, args: Read
|
|
|
29
29
|
* value is missing.
|
|
30
30
|
*/
|
|
31
31
|
export declare function actionEffect(actionId: string, args: Readonly<Record<string, unknown>> | undefined): ActionEffect | null;
|
|
32
|
+
/** Why a step's vocabulary action cannot be performed. */
|
|
33
|
+
export type VocabActionRefusal = 'unknown-action' | 'not-offered';
|
|
34
|
+
/**
|
|
35
|
+
* A command step names an action that does not exist, or a device that does
|
|
36
|
+
* not offer it. Typed so a save boundary names the reason, not a string.
|
|
37
|
+
*/
|
|
38
|
+
export declare class VocabActionError extends Error {
|
|
39
|
+
readonly reason: VocabActionRefusal;
|
|
40
|
+
readonly actionId: string;
|
|
41
|
+
readonly deviceId?: number | undefined;
|
|
42
|
+
constructor(reason: VocabActionRefusal, actionId: string, message: string, deviceId?: number | undefined);
|
|
43
|
+
}
|
|
44
|
+
/** The cap method call a vocabulary action makes. */
|
|
45
|
+
export interface VocabCall {
|
|
46
|
+
readonly cap: string;
|
|
47
|
+
readonly method: string;
|
|
48
|
+
/** The step's args with the args the action bakes in (those win). */
|
|
49
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The cap + method + args `actionId` calls with the step's (open) `args`.
|
|
53
|
+
* THE one place a command step's action id becomes a cap method: the step
|
|
54
|
+
* runner and a generated automation block call it when the step runs.
|
|
55
|
+
* Throws {@link VocabActionError} (`unknown-action`).
|
|
56
|
+
*/
|
|
57
|
+
export declare function vocabCall(actionId: string, args: Readonly<Record<string, unknown>> | undefined): VocabCall;
|
|
58
|
+
/**
|
|
59
|
+
* Refuse a device that does not offer `actionId`: its bound caps (the
|
|
60
|
+
* per-binding walk, D12) do not include the action's cap. Throws
|
|
61
|
+
* {@link VocabActionError} (`unknown-action` or `not-offered`).
|
|
62
|
+
*/
|
|
63
|
+
export declare function assertDeviceOffers(actionId: string, deviceId: number, deviceCaps: readonly string[]): void;
|
|
@@ -4,8 +4,8 @@
|
|
|
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';
|
|
7
|
-
export type { ActionEffect, IndexedVocabAction } from './action-index.js';
|
|
8
|
-
export { actionEffect, allVocabActions, findVocabAction, vocabActionIdFor, } from './action-index.js';
|
|
7
|
+
export type { ActionEffect, IndexedVocabAction, VocabActionRefusal, VocabCall, } from './action-index.js';
|
|
8
|
+
export { actionEffect, allVocabActions, assertDeviceOffers, findVocabAction, VocabActionError, vocabActionIdFor, vocabCall, } from './action-index.js';
|
|
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';
|
|
@@ -1,108 +1,6 @@
|
|
|
1
|
-
import type { LooseVocabOffer } from './cap-vocabulary/types.js';
|
|
2
|
-
import { DeviceType } from './device-type.js';
|
|
3
|
-
/** An arg the authoring UI collects (not baked into the catalogue entry). */
|
|
4
|
-
export interface DeviceDoOpenArg {
|
|
5
|
-
readonly key: string;
|
|
6
|
-
readonly label: string;
|
|
7
|
-
readonly kind: 'string' | 'number';
|
|
8
|
-
/** How the vocabulary says to offer values (enum, range, the device's own list). */
|
|
9
|
-
readonly offer?: LooseVocabOffer;
|
|
10
|
-
/** The method accepts the call without it. */
|
|
11
|
-
readonly optional?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/** One operator-facing action that becomes a cap method call. */
|
|
14
|
-
export interface DeviceDoAction {
|
|
15
|
-
/** Stable id for the select value, e.g. `switch.on`. */
|
|
16
|
-
readonly id: string;
|
|
17
|
-
/** Human label shown in the picker. */
|
|
18
|
-
readonly label: string;
|
|
19
|
-
readonly cap: string;
|
|
20
|
-
readonly method: string;
|
|
21
|
-
readonly args?: Readonly<Record<string, unknown>>;
|
|
22
|
-
/**
|
|
23
|
-
* Keys the operator fills after picking the action (e.g. `presetId` for
|
|
24
|
-
* `ptz.goToPreset`). Matching ignores these — only baked {@link args} must
|
|
25
|
-
* agree — so a saved step with a filled preset still selects this entry.
|
|
26
|
-
*/
|
|
27
|
-
readonly openArgs?: readonly DeviceDoOpenArg[];
|
|
28
|
-
}
|
|
29
1
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
export declare const DEVICE_DO_ACTIONS: readonly DeviceDoAction[];
|
|
35
|
-
/** True when METHOD_ACCESS_MAP still exposes this cap.method as actuatable. */
|
|
36
|
-
export declare function isDoActionActuatable(action: DeviceDoAction): boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Catalogue caps a `DeviceType` is expected to offer in the Do picker.
|
|
39
|
-
*
|
|
40
|
-
* Exhaustive over {@link DeviceType}: adding a new enum member without an
|
|
41
|
-
* entry fails the TypeScript build here (same pattern as
|
|
42
|
-
* {@link DEVICE_TYPE_CONTROL_KIND}). An empty list is a deliberate choice
|
|
43
|
-
* for read-only / non-actuatable types — never "forgotten".
|
|
44
|
-
*
|
|
45
|
-
* Camera accessories (ptz, privacy-mask, …) are listed on Camera even though
|
|
46
|
-
* a given camera may bind only a subset; {@link actionsForBoundCaps} still
|
|
47
|
-
* filters to what the device actually binds.
|
|
48
|
-
*/
|
|
49
|
-
export declare const DEVICE_TYPE_DO_CAPS: Record<DeviceType, readonly string[]>;
|
|
50
|
-
/**
|
|
51
|
-
* Whether a device type belongs in a Do / automation action device picker.
|
|
52
|
-
*
|
|
53
|
-
* Containers stay in {@link DEVICE_TYPE_DO_CAPS} (empty, for exhaustiveness)
|
|
54
|
-
* but must never appear as selectable targets — actuate the children instead.
|
|
2
|
+
* Whether a device type belongs in a command / automation action device picker.
|
|
3
|
+
* A container is a parent grouping node, never an actuation target: its
|
|
4
|
+
* children are.
|
|
55
5
|
*/
|
|
56
6
|
export declare function isDoPickerDeviceType(type: string): boolean;
|
|
57
|
-
/**
|
|
58
|
-
* Do-picker family id — devices that share one may be multi-selected for
|
|
59
|
-
* the same action (several locks, the climate family, cover+valve, …).
|
|
60
|
-
*
|
|
61
|
-
* Distinct from {@link DeviceControlKind}: humidifier / water-heater keep
|
|
62
|
-
* their own control widgets but author with climate siblings.
|
|
63
|
-
*/
|
|
64
|
-
export declare function deviceDoFamily(type: string): string;
|
|
65
|
-
/** True when two device types may share one multi-target Do step. */
|
|
66
|
-
export declare function sameDoFamily(leftType: string, rightType: string): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Actions offered for a device that binds the given caps.
|
|
69
|
-
*
|
|
70
|
-
* Only catalogue entries whose cap is bound AND still actuatable in
|
|
71
|
-
* METHOD_ACCESS_MAP. Empty bindings → empty list (pick a device first).
|
|
72
|
-
*/
|
|
73
|
-
export declare function actionsForBoundCaps(boundCaps: readonly string[]): readonly DeviceDoAction[];
|
|
74
|
-
/**
|
|
75
|
-
* Catalogue actions for a wire `DeviceType` string — the fallback when
|
|
76
|
-
* bindings have not answered yet (or answered empty for a typed actuator).
|
|
77
|
-
* Unknown type strings → empty.
|
|
78
|
-
*/
|
|
79
|
-
export declare function actionsForDeviceType(type: string): readonly DeviceDoAction[];
|
|
80
|
-
/**
|
|
81
|
-
* Union of bound-cap actions with the type's expected catalogue caps.
|
|
82
|
-
*
|
|
83
|
-
* Bindings win for filtering (a lock without `lock-control` bound still
|
|
84
|
-
* offers nothing from bindings alone); the type map fills gaps when the
|
|
85
|
-
* binding read is empty so a Lock / Valve / Climate never shows
|
|
86
|
-
* "No actions for this device" solely because getBindings lagged.
|
|
87
|
-
*/
|
|
88
|
-
export declare function actionsForDevice(input: {
|
|
89
|
-
readonly boundCaps: readonly string[] | undefined;
|
|
90
|
-
readonly deviceType: string | undefined;
|
|
91
|
-
}): readonly DeviceDoAction[];
|
|
92
|
-
/**
|
|
93
|
-
* Intersection of {@link actionsForDevice} across several targets — what a
|
|
94
|
-
* multi-select same-family Do step may offer.
|
|
95
|
-
*/
|
|
96
|
-
export declare function actionsForDevices(targets: readonly {
|
|
97
|
-
readonly boundCaps?: readonly string[];
|
|
98
|
-
readonly deviceType?: string;
|
|
99
|
-
}[]): readonly DeviceDoAction[];
|
|
100
|
-
/** The whole catalogue (still actuatable) — for a `{$var}` automation target. */
|
|
101
|
-
export declare function allDoActions(): readonly DeviceDoAction[];
|
|
102
|
-
/**
|
|
103
|
-
* Match a saved wire step to a catalogue entry, or null when it is outside
|
|
104
|
-
* the catalogue (legacy / custom). Args must agree when the entry bakes them.
|
|
105
|
-
*/
|
|
106
|
-
export declare function matchDoAction(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): DeviceDoAction | null;
|
|
107
|
-
/** Select value for a saved step: catalogue id, or a synthetic custom key. */
|
|
108
|
-
export declare function doActionSelectValue(cap: string, method: string, args: Readonly<Record<string, unknown>> | undefined): string;
|
|
@@ -5,9 +5,23 @@
|
|
|
5
5
|
* `switch-heater`; an air conditioner and a radiator valve are both `climate`,
|
|
6
6
|
* told apart by their `climate-*` role.
|
|
7
7
|
*/
|
|
8
|
+
import { z } from 'zod';
|
|
8
9
|
import { DeviceRole, DeviceType } from './device-type.js';
|
|
9
10
|
/** The live type a stored `type` value stands for (itself unless retired). */
|
|
10
11
|
export declare function canonicalStoredDeviceType(stored: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* The schema for a device type read back from STORAGE — a device config, a
|
|
14
|
+
* container's `entities[]`, a persisted identity. A retired type is read as its
|
|
15
|
+
* live type before the enum check, so a type retired after the record was
|
|
16
|
+
* written never fails the parse and never drops the device (D1033).
|
|
17
|
+
*
|
|
18
|
+
* Never on a schema that is also a WIRE input: a preprocess makes its input
|
|
19
|
+
* type `unknown`, which loosens the generated client. A store whose row schema
|
|
20
|
+
* is a wire schema (a grant, an action, a composition, a notification rule)
|
|
21
|
+
* keeps it strict and rewrites the row with {@link canonicalStoredDeviceType}
|
|
22
|
+
* where it reads the row back.
|
|
23
|
+
*/
|
|
24
|
+
export declare const StoredDeviceTypeSchema: z.ZodPreprocess<z.ZodEnum<typeof DeviceType>>;
|
|
11
25
|
/** The `climate-*` roles, in the order the role picker lists them. */
|
|
12
26
|
export declare const CLIMATE_ROLES: readonly DeviceRole[];
|
|
13
27
|
export type ClimateRole = DeviceRole.ClimateThermostat | DeviceRole.ClimateAc | DeviceRole.ClimateRadiator | DeviceRole.ClimateFloor | DeviceRole.ClimateHeater | DeviceRole.ClimateHeatPumpCircuit;
|
|
@@ -19,6 +33,28 @@ export type ClimateRole = DeviceRole.ClimateThermostat | DeviceRole.ClimateAc |
|
|
|
19
33
|
export declare function climateRoleOf(role: string | null | undefined): ClimateRole;
|
|
20
34
|
/** An air conditioner: exports present it as an AC unit, not a thermostat. */
|
|
21
35
|
export declare function isAirConditioner(type: string, role: string | null | undefined): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* A relay driving an on/off-only lamp (a `switch` with role `switch-light`):
|
|
38
|
+
* drawn and exported as a light, with the switch's power only. The one place
|
|
39
|
+
* that reads the role for it — a consumer asks this, never the role string.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isSwitchLight(type: string, role: string | null | undefined): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* A smart plug (a `switch` with role `outlet`, D875): exported as a plug /
|
|
44
|
+
* outlet. Exports ask this, never the role string.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isOutlet(type: string, role: string | null | undefined): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* A plain fan behind a switch (a `switch` with role `switch-fan`): exported as
|
|
49
|
+
* a fan with the switch's on/off only — no speed it does not have.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isSwitchFan(type: string, role: string | null | undefined): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A plug-in heater behind a switch (a `switch` with role `switch-heater`): it
|
|
54
|
+
* has power only, no setpoint and no room temperature, so an export never
|
|
55
|
+
* presents it as a thermostat.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isSwitchHeater(type: string, role: string | null | undefined): boolean;
|
|
22
58
|
/** The part of a capability definition that says which devices it is offered on. */
|
|
23
59
|
export interface DeviceKindGate {
|
|
24
60
|
readonly deviceTypes?: readonly DeviceType[];
|
|
@@ -339,6 +339,11 @@ export declare enum DeviceRole {
|
|
|
339
339
|
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
340
340
|
* device also has a fan cap (D1033). */
|
|
341
341
|
SwitchFan = "switch-fan",
|
|
342
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
343
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
344
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
345
|
+
* or colour this relay lacks. */
|
|
346
|
+
SwitchLight = "switch-light",
|
|
342
347
|
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
343
348
|
ClimateAc = "climate-ac",
|
|
344
349
|
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** The per-device store key holding `{ [instanceId]: name }`. */
|
|
2
|
+
export declare const EXPOSED_NAMES_STORE_KEY = "exposedNames";
|
|
3
|
+
export type ExposedNameCheck = {
|
|
4
|
+
readonly ok: true;
|
|
5
|
+
readonly name: string | null;
|
|
6
|
+
} | {
|
|
7
|
+
readonly ok: false;
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
};
|
|
10
|
+
/** A platform's naming rule over a normalised, non-blank name. */
|
|
11
|
+
export type ExposedNameValidator = (name: string) => ExposedNameCheck;
|
|
12
|
+
/** A per-device store, as the exporter reaches it (`ctx.settings.readDeviceStore` / `writeDeviceStore`). */
|
|
13
|
+
export interface ExposedNameStore {
|
|
14
|
+
read(deviceId: number): Promise<Readonly<Record<string, unknown>>>;
|
|
15
|
+
write(deviceId: number, patch: Record<string, unknown>): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export interface SaveExposedNameInput {
|
|
18
|
+
readonly store: ExposedNameStore;
|
|
19
|
+
readonly deviceId: number;
|
|
20
|
+
readonly instanceId: string;
|
|
21
|
+
readonly raw: unknown;
|
|
22
|
+
readonly validate: ExposedNameValidator;
|
|
23
|
+
/** Validate only: refuse as a real save would, read and write nothing. */
|
|
24
|
+
readonly dryRun?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface SaveExposedNameResult {
|
|
27
|
+
readonly changed: boolean;
|
|
28
|
+
readonly name: string | null;
|
|
29
|
+
}
|
|
30
|
+
/** Trim and collapse whitespace, then the platform rule. Blank or null clears (`name: null`). */
|
|
31
|
+
export declare function checkExposedName(raw: unknown, validate: ExposedNameValidator): ExposedNameCheck;
|
|
32
|
+
/** Every saved name of a device, by instance id. A malformed blob reads as none. */
|
|
33
|
+
export declare function readExposedNames(store: Readonly<Record<string, unknown>>): Readonly<Record<string, string>>;
|
|
34
|
+
/**
|
|
35
|
+
* The saved name of one instance, or null: never saved, or a stored value the platform would
|
|
36
|
+
* now refuse (the device's own name is used rather than pushing a name the platform rejects).
|
|
37
|
+
*/
|
|
38
|
+
export declare function readExposedName(store: Readonly<Record<string, unknown>>, instanceId: string, validate: ExposedNameValidator): string | null;
|
|
39
|
+
/** The store patch that sets (or, with null, clears) one instance's name and keeps the others. */
|
|
40
|
+
export declare function exposedNamePatch(store: Readonly<Record<string, unknown>>, instanceId: string, name: string | null): Record<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* Validate and save one instance's name. A name the platform would refuse throws
|
|
43
|
+
* {@link ExportNameRefusedError} BEFORE anything is written, so the old name stays.
|
|
44
|
+
*/
|
|
45
|
+
export declare function saveExposedName(input: SaveExposedNameInput): Promise<SaveExposedNameResult>;
|
|
46
|
+
/** The part of `ctx.settings` an exporter's names live in (D865). */
|
|
47
|
+
export interface DeviceStoreAccess {
|
|
48
|
+
readDeviceStore(deviceId: number): Promise<Record<string, unknown>>;
|
|
49
|
+
writeDeviceStore(deviceId: number, patch: Record<string, unknown>): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
/** The exporter's per-device store as an {@link ExposedNameStore}; throws when settings are absent. */
|
|
52
|
+
export declare function exposedNameStoreOf(settings: DeviceStoreAccess | undefined, owner: string): ExposedNameStore;
|
|
53
|
+
/** The per-device store an exporter can walk to prune a deleted instance's names. */
|
|
54
|
+
export interface PrunableDeviceStore extends DeviceStoreAccess {
|
|
55
|
+
listDeviceStoreIds(): Promise<readonly number[]>;
|
|
56
|
+
readDeviceStoreBatch(deviceIds: readonly number[]): Promise<ReadonlyMap<number, Record<string, unknown>>>;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Remove every name saved for `instanceId` (the instance was deleted), so a later instance that
|
|
60
|
+
* reuses the id does not inherit them. Returns the device ids that lost a name. A store that
|
|
61
|
+
* cannot be read throws; nothing is written for the devices not reached.
|
|
62
|
+
*/
|
|
63
|
+
export declare function pruneExposedNames(settings: PrunableDeviceStore, instanceId: string): Promise<readonly number[]>;
|
|
64
|
+
/** No control characters, at most `max` characters: the rule of a platform that takes free text. */
|
|
65
|
+
export declare function freeTextNameValidator(platform: string, max: number): ExposedNameValidator;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import type { z } from 'zod';
|
|
8
8
|
import type { VocabIcon } from './cap-vocabulary-icon.js';
|
|
9
9
|
import type { HeroContext, HeroFragment, StateReading } from './hero-fragment.js';
|
|
10
|
+
import type { HeroMeasurement } from './hero-measurement.js';
|
|
10
11
|
import type { HeroAction, HeroArgs, HeroConfirm, HeroControl, HeroFact, HeroRow } from './hero-model.js';
|
|
11
12
|
import type { HeroState } from './hero-state.js';
|
|
12
13
|
import { type HeroText } from './hero-text.js';
|
|
@@ -16,6 +17,8 @@ export interface HeroContribution {
|
|
|
16
17
|
}
|
|
17
18
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
18
19
|
export declare function contribution<S>(cap: string, schema: z.ZodType<S>, build: (slice: S | undefined, ctx: HeroContext) => HeroFragment): HeroContribution;
|
|
20
|
+
/** The fragment, carrying the cap's single measurement when it has one. */
|
|
21
|
+
export declare function measured(fragment: HeroFragment, measurement: HeroMeasurement | undefined): HeroFragment;
|
|
19
22
|
export declare function action(id: string, label: HeroText, icon: VocabIcon, cap: string, method: string, args?: HeroArgs, emphasis?: 'primary' | 'normal', confirm?: HeroConfirm | null): HeroAction;
|
|
20
23
|
export declare const asAction: (a: HeroAction) => HeroControl;
|
|
21
24
|
export declare function reading(source: StateReading['source'], state: HeroState, assumed?: boolean, title?: HeroText): StateReading;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Contributions return a fragment; `buildHeroModel` merges the fragments.
|
|
4
4
|
*/
|
|
5
5
|
import type { HeroBadge, HeroConsumablesSlot, HeroConsumptionSlot, HeroFact, HeroOwnPowerSlot, HeroPowerSupplySlot, HeroRemoteSlot, HeroRow, HeroSideTile, HeroTimedRunSlot } from './hero-model.js';
|
|
6
|
+
import type { HeroMeasurement } from './hero-measurement.js';
|
|
6
7
|
import type { HeroSceneMode } from './hero-scene.js';
|
|
7
8
|
import type { HeroState } from './hero-state.js';
|
|
8
9
|
import type { HeroText } from './hero-text.js';
|
|
@@ -67,4 +68,6 @@ export interface HeroFragment {
|
|
|
67
68
|
readonly mode?: HeroSceneMode;
|
|
68
69
|
readonly level?: number;
|
|
69
70
|
};
|
|
71
|
+
/** This cap's single reading, when a sensor that measures only it is drawn as that reading. */
|
|
72
|
+
readonly measurement?: HeroMeasurement;
|
|
70
73
|
}
|