@camstack/types 1.2.558 → 1.2.560

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.mjs CHANGED
@@ -1217,6 +1217,144 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
1217
1217
  DeviceType["HeatPump"] = "heat-pump";
1218
1218
  return DeviceType;
1219
1219
  }({});
1220
+ /**
1221
+ * Semantic role a device plays within its parent. Populated by driver
1222
+ * addons when creating accessory devices (Reolink siren/floodlight/
1223
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
1224
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
1225
+ * `role: Floodlight` renders as a bulb with a brightness slider,
1226
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
1227
+ *
1228
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
1229
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
1230
+ */
1231
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1232
+ DeviceRole["Siren"] = "siren";
1233
+ DeviceRole["Floodlight"] = "floodlight";
1234
+ DeviceRole["Spotlight"] = "spotlight";
1235
+ DeviceRole["PirSensor"] = "pir-sensor";
1236
+ DeviceRole["Chime"] = "chime";
1237
+ DeviceRole["Autotrack"] = "autotrack";
1238
+ DeviceRole["Nightvision"] = "nightvision";
1239
+ DeviceRole["PrivacyMask"] = "privacy-mask";
1240
+ DeviceRole["Doorbell"] = "doorbell";
1241
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
1242
+ DeviceRole["CoverBlind"] = "cover-blind";
1243
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
1244
+ DeviceRole["CoverShutter"] = "cover-shutter";
1245
+ /** Exterior awning. HA `device_class: awning`. */
1246
+ DeviceRole["CoverAwning"] = "cover-awning";
1247
+ /** Curtain / drape. HA `device_class: curtain`. */
1248
+ DeviceRole["CoverCurtain"] = "cover-curtain";
1249
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
1250
+ DeviceRole["CoverGarage"] = "cover-garage";
1251
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
1252
+ DeviceRole["CoverGate"] = "cover-gate";
1253
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
1254
+ DeviceRole["CoverDoor"] = "cover-door";
1255
+ /** Window. HA `device_class: window`. */
1256
+ DeviceRole["CoverWindow"] = "cover-window";
1257
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
1258
+ * real Switch device for UI rendering / export adapters. */
1259
+ DeviceRole["BinaryHelper"] = "binary-helper";
1260
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
1261
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
1262
+ DeviceRole["Outlet"] = "outlet";
1263
+ /** A dumb plug-in stove or heater behind a switch: it runs only while the
1264
+ * switch is on. Offered `timed-run`, which switches it off again after a
1265
+ * chosen time. */
1266
+ DeviceRole["SwitchHeater"] = "switch-heater";
1267
+ /** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
1268
+ * with the switch's on/off only. Speed or oscillation appear only when the
1269
+ * device also has a fan cap (D1033). */
1270
+ DeviceRole["SwitchFan"] = "switch-fan";
1271
+ /** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
1272
+ * slider), presented to the exports as a light with power only. Not a
1273
+ * `light` type: the provider owns the type, and a light implies brightness
1274
+ * or colour this relay lacks. */
1275
+ DeviceRole["SwitchLight"] = "switch-light";
1276
+ /** Air conditioner / split unit: cooling, fan speed, louvres. */
1277
+ DeviceRole["ClimateAc"] = "climate-ac";
1278
+ /** Room thermostat: a setpoint and a room temperature. The default. */
1279
+ DeviceRole["ClimateThermostat"] = "climate-thermostat";
1280
+ /** Floor-heating zone actuator. */
1281
+ DeviceRole["ClimateFloor"] = "climate-floor";
1282
+ /** Radiator valve (thermostatic radiator head). */
1283
+ DeviceRole["ClimateRadiator"] = "climate-radiator";
1284
+ /** A heater with its own thermostat (stove, convector). */
1285
+ DeviceRole["ClimateHeater"] = "climate-heater";
1286
+ /** One heating/cooling circuit of a heat pump: a water loop with comfort /
1287
+ * eco setpoints and a heat/cool mode, no room sensor. */
1288
+ DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
1289
+ /** Generic motion / occupancy / moving event source. Distinct from
1290
+ * the camera accessory PirSensor role: that one is a camera child;
1291
+ * this is a standalone HA / 3rd-party motion sensor. */
1292
+ DeviceRole["MotionSensor"] = "motion-sensor";
1293
+ DeviceRole["ContactSensor"] = "contact-sensor";
1294
+ DeviceRole["LeakSensor"] = "leak-sensor";
1295
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
1296
+ DeviceRole["COSensor"] = "co-sensor";
1297
+ DeviceRole["GasSensor"] = "gas-sensor";
1298
+ DeviceRole["TamperSensor"] = "tamper-sensor";
1299
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
1300
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
1301
+ DeviceRole["SoundSensor"] = "sound-sensor";
1302
+ /** Fallback for `binary_sensor` without a known `device_class`. */
1303
+ DeviceRole["BinarySensor"] = "binary-sensor";
1304
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
1305
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
1306
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
1307
+ DeviceRole["PressureSensor"] = "pressure-sensor";
1308
+ /** Wind speed or direction (weather-station `wind-sensor` cap). */
1309
+ DeviceRole["WindSensor"] = "wind-sensor";
1310
+ /** Rain accumulation or rate (weather-station `rain-sensor` cap). */
1311
+ DeviceRole["RainSensor"] = "rain-sensor";
1312
+ /** UV index (weather-station `uv-sensor` cap). */
1313
+ DeviceRole["UvSensor"] = "uv-sensor";
1314
+ /** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
1315
+ * Distinct from AmbientLightSensor (lux). */
1316
+ DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
1317
+ /** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
1318
+ DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
1319
+ DeviceRole["PowerSensor"] = "power-sensor";
1320
+ DeviceRole["EnergySensor"] = "energy-sensor";
1321
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
1322
+ DeviceRole["CurrentSensor"] = "current-sensor";
1323
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
1324
+ /** Battery level (numeric % via `sensor` OR low-bool via
1325
+ * `binary_sensor` — the cap distinguishes via the value type). */
1326
+ DeviceRole["BatterySensor"] = "battery-sensor";
1327
+ /** Fallback for `sensor` numeric without a known `device_class`. */
1328
+ DeviceRole["NumericSensor"] = "numeric-sensor";
1329
+ /** String / enum state (HA `sensor` with `state_class: enum` or
1330
+ * `attributes.options`). */
1331
+ DeviceRole["EnumSensor"] = "enum-sensor";
1332
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
1333
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
1334
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
1335
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
1336
+ /** Last-resort fallback when nothing else matches. */
1337
+ DeviceRole["GenericSensor"] = "generic-sensor";
1338
+ DeviceRole["NumericControl"] = "numeric-control";
1339
+ DeviceRole["SelectControl"] = "select-control";
1340
+ DeviceRole["TextControl"] = "text-control";
1341
+ DeviceRole["DateTimeControl"] = "datetime-control";
1342
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
1343
+ * rich features (image, priority, channel routing). */
1344
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
1345
+ /** Chat / messaging service (HA `notify.telegram_*`,
1346
+ * `notify.discord_*`, etc.). */
1347
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
1348
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
1349
+ DeviceRole["EmailNotifier"] = "email-notifier";
1350
+ /** Fallback when the notifier service name doesn't match a known
1351
+ * pattern. */
1352
+ DeviceRole["GenericNotifier"] = "generic-notifier";
1353
+ /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
1354
+ * cap. A `DeviceType.Generic` device. */
1355
+ DeviceRole["IrTransmitter"] = "ir-transmitter";
1356
+ return DeviceRole;
1357
+ }({});
1220
1358
  z.enum(["new-session", "step-up"]);
1221
1359
  z.enum(["en", "it"]);
1222
1360
  /** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
@@ -26969,6 +27107,155 @@ function isSource(x) {
26969
27107
  return typeof x.read === "function" && typeof x.watch === "function";
26970
27108
  }
26971
27109
  //#endregion
27110
+ //#region src/device/device-icon.ts
27111
+ /**
27112
+ * device-icon — THE icon of a device, from what it IS: its {@link DeviceType},
27113
+ * refined by its {@link DeviceRole}. One table for every surface: the admin's
27114
+ * rows, cards, page header, lists and pickers draw it through ui-library's
27115
+ * glyph table, the viewer through its catalog nodes. The value is a key of the
27116
+ * icon catalog (D854), never a glyph.
27117
+ *
27118
+ * Exhaustive over both enums (`satisfies Record<…>`): a new type or role fails
27119
+ * the build until it has an icon. Nothing here reads a name, a provider or a
27120
+ * capability — an icon picked from those would be invented.
27121
+ *
27122
+ * Precedence: a known role → its icon; otherwise the type's icon; a type this
27123
+ * build does not know → the generic type's icon. An operator's per-device or
27124
+ * per-role display override is the caller's level above this one.
27125
+ */
27126
+ /** The icon of each device type. */
27127
+ var DEVICE_TYPE_ICON = {
27128
+ [DeviceType.Camera]: "camera",
27129
+ [DeviceType.Hub]: "network",
27130
+ [DeviceType.Light]: "lightbulb",
27131
+ [DeviceType.Siren]: "siren",
27132
+ [DeviceType.Switch]: "toggle-left",
27133
+ [DeviceType.Sensor]: "activity",
27134
+ [DeviceType.Climate]: "thermometer",
27135
+ [DeviceType.HeatPump]: "flame",
27136
+ [DeviceType.Button]: "circle-dot",
27137
+ [DeviceType.EventEmitter]: "zap",
27138
+ [DeviceType.Update]: "refresh-cw",
27139
+ [DeviceType.Generic]: "box",
27140
+ [DeviceType.Notifier]: "bell",
27141
+ [DeviceType.Script]: "scroll-text",
27142
+ [DeviceType.Automation]: "workflow",
27143
+ [DeviceType.Lock]: "lock",
27144
+ [DeviceType.Cover]: "blinds",
27145
+ [DeviceType.Valve]: "pipette",
27146
+ [DeviceType.Humidifier]: "waves",
27147
+ [DeviceType.WaterHeater]: "bath",
27148
+ [DeviceType.Fan]: "fan",
27149
+ [DeviceType.MediaPlayer]: "monitor-play",
27150
+ [DeviceType.AlarmPanel]: "shield-alert",
27151
+ [DeviceType.Control]: "sliders-horizontal",
27152
+ [DeviceType.Presence]: "map-pin",
27153
+ [DeviceType.Weather]: "cloud-sun",
27154
+ [DeviceType.Vacuum]: "bot",
27155
+ [DeviceType.LawnMower]: "tractor",
27156
+ [DeviceType.Container]: "box",
27157
+ [DeviceType.Image]: "image",
27158
+ [DeviceType.PetFeeder]: "bone",
27159
+ [DeviceType.PetFountain]: "droplets",
27160
+ [DeviceType.Dishwasher]: "waves",
27161
+ [DeviceType.Washer]: "washing-machine",
27162
+ [DeviceType.Dryer]: "wind",
27163
+ [DeviceType.Gateway]: "router"
27164
+ };
27165
+ /** The icon of each role: what the device is FOR, which reads better than its type. */
27166
+ var DEVICE_ROLE_ICON = {
27167
+ [DeviceRole.Siren]: "siren",
27168
+ [DeviceRole.Floodlight]: "lightbulb",
27169
+ [DeviceRole.Spotlight]: "flashlight",
27170
+ [DeviceRole.PirSensor]: "radar",
27171
+ [DeviceRole.Chime]: "bell",
27172
+ [DeviceRole.Autotrack]: "crosshair",
27173
+ [DeviceRole.Nightvision]: "moon",
27174
+ [DeviceRole.PrivacyMask]: "eye-off",
27175
+ [DeviceRole.Doorbell]: "door-closed",
27176
+ [DeviceRole.CoverBlind]: "blinds",
27177
+ [DeviceRole.CoverShutter]: "blinds",
27178
+ [DeviceRole.CoverAwning]: "blinds",
27179
+ [DeviceRole.CoverCurtain]: "blinds",
27180
+ [DeviceRole.CoverGarage]: "door-closed",
27181
+ [DeviceRole.CoverGate]: "door-closed",
27182
+ [DeviceRole.CoverDoor]: "door-open",
27183
+ [DeviceRole.CoverWindow]: "blinds",
27184
+ [DeviceRole.BinaryHelper]: "toggle-left",
27185
+ [DeviceRole.Outlet]: "plug",
27186
+ [DeviceRole.SwitchHeater]: "flame",
27187
+ [DeviceRole.SwitchFan]: "fan",
27188
+ [DeviceRole.SwitchLight]: "lightbulb",
27189
+ [DeviceRole.ClimateAc]: "air-vent",
27190
+ [DeviceRole.ClimateThermostat]: "thermometer",
27191
+ [DeviceRole.ClimateFloor]: "waves",
27192
+ [DeviceRole.ClimateRadiator]: "heater",
27193
+ [DeviceRole.ClimateHeater]: "flame",
27194
+ [DeviceRole.ClimateHeatPumpCircuit]: "refresh-cw",
27195
+ [DeviceRole.MotionSensor]: "footprints",
27196
+ [DeviceRole.ContactSensor]: "door-open",
27197
+ [DeviceRole.LeakSensor]: "droplet",
27198
+ [DeviceRole.SmokeSensor]: "alarm-smoke",
27199
+ [DeviceRole.COSensor]: "wind",
27200
+ [DeviceRole.GasSensor]: "flame",
27201
+ [DeviceRole.TamperSensor]: "shield-alert",
27202
+ [DeviceRole.VibrationSensor]: "vibrate",
27203
+ [DeviceRole.ConnectivitySensor]: "wifi",
27204
+ [DeviceRole.SoundSensor]: "volume-2",
27205
+ [DeviceRole.BinarySensor]: "toggle-left",
27206
+ [DeviceRole.TemperatureSensor]: "thermometer",
27207
+ [DeviceRole.HumiditySensor]: "droplets",
27208
+ [DeviceRole.AmbientLightSensor]: "sun",
27209
+ [DeviceRole.PressureSensor]: "gauge",
27210
+ [DeviceRole.WindSensor]: "wind",
27211
+ [DeviceRole.RainSensor]: "cloud-rain",
27212
+ [DeviceRole.UvSensor]: "sun-medium",
27213
+ [DeviceRole.SolarRadiationSensor]: "sunrise",
27214
+ [DeviceRole.SoilMoistureSensor]: "sprout",
27215
+ [DeviceRole.PowerSensor]: "zap",
27216
+ [DeviceRole.EnergySensor]: "zap",
27217
+ [DeviceRole.VoltageSensor]: "zap",
27218
+ [DeviceRole.CurrentSensor]: "zap",
27219
+ [DeviceRole.AirQualitySensor]: "wind",
27220
+ [DeviceRole.BatterySensor]: "gauge",
27221
+ [DeviceRole.NumericSensor]: "hash",
27222
+ [DeviceRole.EnumSensor]: "list",
27223
+ [DeviceRole.DateTimeSensor]: "clock",
27224
+ [DeviceRole.GenericSensor]: "gauge",
27225
+ [DeviceRole.NumericControl]: "sliders-horizontal",
27226
+ [DeviceRole.SelectControl]: "list-checks",
27227
+ [DeviceRole.TextControl]: "type",
27228
+ [DeviceRole.DateTimeControl]: "clock",
27229
+ [DeviceRole.MobilePushNotifier]: "smartphone",
27230
+ [DeviceRole.MessagingNotifier]: "message-square",
27231
+ [DeviceRole.EmailNotifier]: "mail",
27232
+ [DeviceRole.GenericNotifier]: "bell",
27233
+ [DeviceRole.IrTransmitter]: "radio-tower"
27234
+ };
27235
+ var TYPE_VALUES = new Set(Object.values(DeviceType));
27236
+ var ROLE_VALUES = new Set(Object.values(DeviceRole));
27237
+ function isDeviceType(value) {
27238
+ return TYPE_VALUES.has(value);
27239
+ }
27240
+ function isDeviceRole(value) {
27241
+ return ROLE_VALUES.has(value);
27242
+ }
27243
+ /** The icon of a device type alone; a type this build does not know draws the generic one. */
27244
+ function deviceTypeIconKey(type) {
27245
+ return isDeviceType(type) ? DEVICE_TYPE_ICON[type] : DEVICE_TYPE_ICON[DeviceType.Generic];
27246
+ }
27247
+ /** The icon of a role alone, or `null` for a role this build does not know. */
27248
+ function deviceRoleIconKey(role) {
27249
+ return isDeviceRole(role) ? DEVICE_ROLE_ICON[role] : null;
27250
+ }
27251
+ /**
27252
+ * The icon of a device: its role's when the role is known, else its type's.
27253
+ * An unknown role never borrows another role's icon — it is drawn as its type.
27254
+ */
27255
+ function deviceIconKey(type, role) {
27256
+ return (role === null || role === void 0 ? null : deviceRoleIconKey(role)) ?? deviceTypeIconKey(type);
27257
+ }
27258
+ //#endregion
26972
27259
  //#region src/helpers/addon-slice-handle.ts
26973
27260
  /** Structural bridge: every `AddonApi` client carries `deviceState` (+ optional `live`). */
26974
27261
  function addonSliceHandleApi(api) {
@@ -33158,4 +33445,4 @@ var TimelapseRuleSchema = TimelapseRuleInputSchema.extend({
33158
33445
  updatedAt: z.number()
33159
33446
  });
33160
33447
  //#endregion
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 };
33448
+ 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, deviceIconKey, deviceRefusalFromMessage, deviceTypeIconKey, 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 };
@@ -0,0 +1,136 @@
1
+ /**
2
+ * device-icon — THE icon of a device, from what it IS: its {@link DeviceType},
3
+ * refined by its {@link DeviceRole}. One table for every surface: the admin's
4
+ * rows, cards, page header, lists and pickers draw it through ui-library's
5
+ * glyph table, the viewer through its catalog nodes. The value is a key of the
6
+ * icon catalog (D854), never a glyph.
7
+ *
8
+ * Exhaustive over both enums (`satisfies Record<…>`): a new type or role fails
9
+ * the build until it has an icon. Nothing here reads a name, a provider or a
10
+ * capability — an icon picked from those would be invented.
11
+ *
12
+ * Precedence: a known role → its icon; otherwise the type's icon; a type this
13
+ * build does not know → the generic type's icon. An operator's per-device or
14
+ * per-role display override is the caller's level above this one.
15
+ */
16
+ import { DeviceRole, DeviceType } from './device-type.js';
17
+ /** The icon of each device type. */
18
+ export declare const DEVICE_TYPE_ICON: {
19
+ readonly camera: 'camera';
20
+ readonly hub: 'network';
21
+ readonly light: 'lightbulb';
22
+ readonly siren: 'siren';
23
+ readonly switch: 'toggle-left';
24
+ readonly sensor: 'activity';
25
+ readonly climate: 'thermometer';
26
+ readonly "heat-pump": 'flame';
27
+ readonly button: 'circle-dot';
28
+ readonly "event-emitter": 'zap';
29
+ readonly update: 'refresh-cw';
30
+ readonly generic: 'box';
31
+ readonly notifier: 'bell';
32
+ readonly script: 'scroll-text';
33
+ readonly automation: 'workflow';
34
+ readonly lock: 'lock';
35
+ readonly cover: 'blinds';
36
+ readonly valve: 'pipette';
37
+ readonly humidifier: 'waves';
38
+ readonly "water-heater": 'bath';
39
+ readonly fan: 'fan';
40
+ readonly "media-player": 'monitor-play';
41
+ readonly "alarm-panel": 'shield-alert';
42
+ readonly control: 'sliders-horizontal';
43
+ readonly presence: 'map-pin';
44
+ readonly weather: 'cloud-sun';
45
+ readonly vacuum: 'bot';
46
+ readonly "lawn-mower": 'tractor';
47
+ readonly container: 'box';
48
+ readonly image: 'image';
49
+ readonly "pet-feeder": 'bone';
50
+ readonly "pet-fountain": 'droplets';
51
+ readonly dishwasher: 'waves';
52
+ readonly washer: 'washing-machine';
53
+ readonly dryer: 'wind';
54
+ readonly gateway: 'router';
55
+ };
56
+ /** The icon of each role: what the device is FOR, which reads better than its type. */
57
+ export declare const DEVICE_ROLE_ICON: {
58
+ readonly siren: 'siren';
59
+ readonly floodlight: 'lightbulb';
60
+ readonly spotlight: 'flashlight';
61
+ readonly "pir-sensor": 'radar';
62
+ readonly chime: 'bell';
63
+ readonly autotrack: 'crosshair';
64
+ readonly nightvision: 'moon';
65
+ readonly "privacy-mask": 'eye-off';
66
+ readonly doorbell: 'door-closed';
67
+ readonly "cover-blind": 'blinds';
68
+ readonly "cover-shutter": 'blinds';
69
+ readonly "cover-awning": 'blinds';
70
+ readonly "cover-curtain": 'blinds';
71
+ readonly "cover-garage": 'door-closed';
72
+ readonly "cover-gate": 'door-closed';
73
+ readonly "cover-door": 'door-open';
74
+ readonly "cover-window": 'blinds';
75
+ readonly "binary-helper": 'toggle-left';
76
+ readonly outlet: 'plug';
77
+ readonly "switch-heater": 'flame';
78
+ readonly "switch-fan": 'fan';
79
+ readonly "switch-light": 'lightbulb';
80
+ readonly "climate-ac": 'air-vent';
81
+ readonly "climate-thermostat": 'thermometer';
82
+ readonly "climate-floor": 'waves';
83
+ readonly "climate-radiator": 'heater';
84
+ readonly "climate-heater": 'flame';
85
+ readonly "climate-heat-pump-circuit": 'refresh-cw';
86
+ readonly "motion-sensor": 'footprints';
87
+ readonly "contact-sensor": 'door-open';
88
+ readonly "leak-sensor": 'droplet';
89
+ readonly "smoke-sensor": 'alarm-smoke';
90
+ readonly "co-sensor": 'wind';
91
+ readonly "gas-sensor": 'flame';
92
+ readonly "tamper-sensor": 'shield-alert';
93
+ readonly "vibration-sensor": 'vibrate';
94
+ readonly "connectivity-sensor": 'wifi';
95
+ readonly "sound-sensor": 'volume-2';
96
+ readonly "binary-sensor": 'toggle-left';
97
+ readonly "temperature-sensor": 'thermometer';
98
+ readonly "humidity-sensor": 'droplets';
99
+ readonly "ambient-light-sensor": 'sun';
100
+ readonly "pressure-sensor": 'gauge';
101
+ readonly "wind-sensor": 'wind';
102
+ readonly "rain-sensor": 'cloud-rain';
103
+ readonly "uv-sensor": 'sun-medium';
104
+ readonly "solar-radiation-sensor": 'sunrise';
105
+ readonly "soil-moisture-sensor": 'sprout';
106
+ readonly "power-sensor": 'zap';
107
+ readonly "energy-sensor": 'zap';
108
+ readonly "voltage-sensor": 'zap';
109
+ readonly "current-sensor": 'zap';
110
+ readonly "air-quality-sensor": 'wind';
111
+ readonly "battery-sensor": 'gauge';
112
+ readonly "numeric-sensor": 'hash';
113
+ readonly "enum-sensor": 'list';
114
+ readonly "datetime-sensor": 'clock';
115
+ readonly "generic-sensor": 'gauge';
116
+ readonly "numeric-control": 'sliders-horizontal';
117
+ readonly "select-control": 'list-checks';
118
+ readonly "text-control": 'type';
119
+ readonly "datetime-control": 'clock';
120
+ readonly "mobile-push-notifier": 'smartphone';
121
+ readonly "messaging-notifier": 'message-square';
122
+ readonly "email-notifier": 'mail';
123
+ readonly "generic-notifier": 'bell';
124
+ readonly "ir-transmitter": 'radio-tower';
125
+ };
126
+ /** Every icon a device can be drawn with — a subset of the catalog the glyph tables must cover. */
127
+ export type DeviceIconKey = (typeof DEVICE_TYPE_ICON)[DeviceType] | (typeof DEVICE_ROLE_ICON)[DeviceRole];
128
+ /** The icon of a device type alone; a type this build does not know draws the generic one. */
129
+ export declare function deviceTypeIconKey(type: string): DeviceIconKey;
130
+ /** The icon of a role alone, or `null` for a role this build does not know. */
131
+ export declare function deviceRoleIconKey(role: string): DeviceIconKey | null;
132
+ /**
133
+ * The icon of a device: its role's when the role is known, else its type's.
134
+ * An unknown role never borrows another role's icon — it is drawn as its type.
135
+ */
136
+ export declare function deviceIconKey(type: string, role?: string | null): DeviceIconKey;
@@ -72,5 +72,12 @@ export declare function humidityMeasurement(percent: number, since: number | nul
72
72
  export declare function powerMeasurement(watts: number, since: number | null): HeroMeasurement;
73
73
  export declare function contactMeasurement(open: boolean, since: number | null): HeroMeasurement;
74
74
  export declare function textMeasurement(text: string, since: number | null): HeroMeasurement;
75
+ /**
76
+ * The measurement of a sensor that has not reported yet: its normal card with
77
+ * an empty "—" value and its unit — never a placeholder, never a 0 (D393). The
78
+ * reading is `null` (nothing to format), the scene does not move, and nothing
79
+ * claims a moment.
80
+ */
81
+ export declare function emptyMeasurement(quantity: HeroMeasurementQuantity): HeroMeasurement;
75
82
  /** Whether `m` is the reading a device of `role` shows. */
76
83
  export declare function measurementFitsRole(m: HeroMeasurement, role: string | null): boolean;
@@ -6,3 +6,11 @@ export declare const HeroTextSchema: z.ZodObject<{
6
6
  it: z.ZodString;
7
7
  }, z.core.$strip>;
8
8
  export type HeroText = z.infer<typeof HeroTextSchema>;
9
+ /**
10
+ * What a device that has not reported says in place of its value: an empty "—",
11
+ * never a word like "Unknown" and never a 0 (D393). The card stays its normal
12
+ * self; only the value is empty.
13
+ */
14
+ export declare const NOT_REPORTED: HeroText;
15
+ /** Whether `text` is {@link NOT_REPORTED}: a client may leave such a slot out instead of painting a dash twice. */
16
+ export declare function isNotReported(text: HeroText): boolean;
@@ -9,7 +9,7 @@ export { HERO_ROW_IDS, HERO_ROW_LABELS, heroArgsWithValue, type HeroAction, type
9
9
  export { HERO_ANIMATIONS, HERO_BACKGROUNDS, HERO_STATES, HERO_TONES, type HeroAnimation, type HeroBackgroundToken, type HeroLook, type HeroState, type HeroTone, type StateLook, } from './hero-state.js';
10
10
  export { HERO_SCENE_BY_ROLE, HERO_SCENE_BY_TYPE, HERO_SCENES, HERO_SCENE_MODES, resolveHeroSceneId, type HeroScene, type HeroSceneId, type HeroSceneMode, } from './hero-scene.js';
11
11
  export { HeroRowModelSchema, projectDeviceRow, type HeroRowModel, } from './hero-row.js';
12
- export { HERO_MEASUREMENT_BANDS, HERO_MEASUREMENT_QUANTITIES, HERO_MEASUREMENT_SINCE_KINDS, HeroMeasurementReadingSchema, HeroMeasurementSchema, contactMeasurement, measurementFitsRole, humidityMeasurement, powerMeasurement, temperatureBand, temperatureMeasurement, textMeasurement, type HeroMeasurement, type HeroMeasurementBand, type HeroMeasurementQuantity, type HeroMeasurementReading, type HeroMeasurementSinceKind, } from './hero-measurement.js';
13
- export { heroText, type HeroText } from './hero-text.js';
12
+ export { HERO_MEASUREMENT_BANDS, HERO_MEASUREMENT_QUANTITIES, HERO_MEASUREMENT_SINCE_KINDS, HeroMeasurementReadingSchema, HeroMeasurementSchema, contactMeasurement, emptyMeasurement, measurementFitsRole, humidityMeasurement, powerMeasurement, temperatureBand, temperatureMeasurement, textMeasurement, type HeroMeasurement, type HeroMeasurementBand, type HeroMeasurementQuantity, type HeroMeasurementReading, type HeroMeasurementSinceKind, } from './hero-measurement.js';
13
+ export { NOT_REPORTED, heroText, isNotReported, type HeroText } from './hero-text.js';
14
14
  export * from './media-player-view.js';
15
15
  export { resolveOwnPower } from './own-power.js';
@@ -20,6 +20,8 @@ export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './d
20
20
  export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType, featuresOfBoundCaps, } from './device-type.js';
21
21
  export { capAppliesToDeviceKind, canonicalStoredDeviceType, CLIMATE_ROLES, StoredDeviceTypeSchema, climateRoleOf, isAirConditioner, isOutlet, isSwitchFan, isSwitchHeater, isSwitchLight, type ClimateRole, type DeviceKindGate, } from './device-kind.js';
22
22
  export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './features.js';
23
+ export { DEVICE_ROLE_ICON, DEVICE_TYPE_ICON, deviceIconKey, deviceRoleIconKey, deviceTypeIconKey, } from './device-icon.js';
24
+ export type { DeviceIconKey } from './device-icon.js';
23
25
  export type { IconCategoryId, IconEntry, IconHit, IconKey, } from './icon-catalog.js';
24
26
  export { ICON_CATALOG_SOURCE, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, canonicalIconKey, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, resolveIconKey, searchIcons, } from './icon-catalog.js';
25
27
  export type { LocationDescriptionAssignment, LocationIconAssignment, } from './location-icon.js';
@@ -30,8 +30,9 @@ export declare function splitTranslationRef(ref: string): {
30
30
  /** `(namespace, key) -> text in the request language`, or `undefined` when absent. */
31
31
  export type CatalogLookup = (ns: string, key: string) => string | undefined;
32
32
  /**
33
- * Returns `value` with every `labelKey` / `descriptionKey` / `titleKey` that
34
- * the catalog can resolve replaced into `label` / `description` / `title`.
33
+ * Returns `value` with every `labelKey` / `descriptionKey` / `titleKey` /
34
+ * `contentKey` that the catalog can resolve replaced into `label` /
35
+ * `description` / `title` / `content`.
35
36
  * Pure: the input is never mutated; a subtree with nothing to change is
36
37
  * returned as the SAME object. A key the catalog does not hold keeps the
37
38
  * English text that sits next to it.
package/dist/index.d.ts CHANGED
@@ -280,6 +280,8 @@ export { DEVICE_FEATURE_REQUIREMENTS, deriveFeatureProvenance, isKernelDerivedFe
280
280
  export { implementedMethodsOf } from './device/implemented-methods.js';
281
281
  export { APPLIANCE_EXPORT, type ApplianceExportDecision, type ApplianceExportEcosystem, type ApplianceExported, type ApplianceNotExported, type PlugApplianceType, PLUG_APPLIANCE_TYPES, applianceExport, isPlugApplianceType, } from './device/appliance-export.js';
282
282
  export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './device/features.js';
283
+ export { DEVICE_ROLE_ICON, DEVICE_TYPE_ICON, deviceIconKey, deviceRoleIconKey, deviceTypeIconKey, } from './device/device-icon.js';
284
+ export type { DeviceIconKey } from './device/device-icon.js';
283
285
  export type { IconCategoryId, IconEntry, IconHit, IconKey, } from './device/icon-catalog.js';
284
286
  export { ICON_CATALOG_SOURCE, ICON_CATEGORIES, ICON_ENTRIES, ICON_KEYS, ICON_VIEWER_MODULES, IconKeySchema, canonicalIconKey, iconCategoryLabel, iconEntry, iconsInCategory, isIconKey, resolveIconKey, searchIcons, } from './device/icon-catalog.js';
285
287
  export type { LocationDescriptionAssignment, LocationIconAssignment, } from './device/location-icon.js';