@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/CHANGELOG.md +12 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +289 -0
- package/dist/client.mjs +288 -1
- package/dist/device/device-icon.d.ts +136 -0
- package/dist/device/hero/hero-measurement.d.ts +7 -0
- package/dist/device/hero/hero-text.d.ts +8 -0
- package/dist/device/hero/index.d.ts +2 -2
- package/dist/device/index.d.ts +2 -0
- package/dist/i18n/translation.d.ts +3 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +264 -34
- package/dist/index.mjs +257 -35
- package/dist/interfaces/config-ui.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.2.560] - 2026-11-13
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Settings info fields can carry a translated content key (contentKey), so a hint shows in the operator's language
|
|
15
|
+
|
|
16
|
+
## [1.2.559] - 2026-11-13
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Devices draw one icon from their type and role everywhere (a light switch is a light); a sensor that has not reported shows its normal card with an empty — and its unit instead of Unknown
|
|
21
|
+
|
|
10
22
|
## [1.2.558] - 2026-11-13
|
|
11
23
|
|
|
12
24
|
### Changed
|
package/dist/client.d.ts
CHANGED
|
@@ -14,7 +14,8 @@
|
|
|
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, 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';
|
|
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, deviceIconKey, deviceTypeIconKey, 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';
|
|
21
|
+
export type { DeviceIconKey } from './index.js';
|
package/dist/client.js
CHANGED
|
@@ -1218,6 +1218,144 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
1218
1218
|
DeviceType["HeatPump"] = "heat-pump";
|
|
1219
1219
|
return DeviceType;
|
|
1220
1220
|
}({});
|
|
1221
|
+
/**
|
|
1222
|
+
* Semantic role a device plays within its parent. Populated by driver
|
|
1223
|
+
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
1224
|
+
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
1225
|
+
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
1226
|
+
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
1227
|
+
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
1228
|
+
*
|
|
1229
|
+
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
1230
|
+
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
1231
|
+
*/
|
|
1232
|
+
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
1233
|
+
DeviceRole["Siren"] = "siren";
|
|
1234
|
+
DeviceRole["Floodlight"] = "floodlight";
|
|
1235
|
+
DeviceRole["Spotlight"] = "spotlight";
|
|
1236
|
+
DeviceRole["PirSensor"] = "pir-sensor";
|
|
1237
|
+
DeviceRole["Chime"] = "chime";
|
|
1238
|
+
DeviceRole["Autotrack"] = "autotrack";
|
|
1239
|
+
DeviceRole["Nightvision"] = "nightvision";
|
|
1240
|
+
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
1241
|
+
DeviceRole["Doorbell"] = "doorbell";
|
|
1242
|
+
/** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
|
|
1243
|
+
DeviceRole["CoverBlind"] = "cover-blind";
|
|
1244
|
+
/** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
|
|
1245
|
+
DeviceRole["CoverShutter"] = "cover-shutter";
|
|
1246
|
+
/** Exterior awning. HA `device_class: awning`. */
|
|
1247
|
+
DeviceRole["CoverAwning"] = "cover-awning";
|
|
1248
|
+
/** Curtain / drape. HA `device_class: curtain`. */
|
|
1249
|
+
DeviceRole["CoverCurtain"] = "cover-curtain";
|
|
1250
|
+
/** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
|
|
1251
|
+
DeviceRole["CoverGarage"] = "cover-garage";
|
|
1252
|
+
/** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
|
|
1253
|
+
DeviceRole["CoverGate"] = "cover-gate";
|
|
1254
|
+
/** Door. HA `device_class: door`. A security actuator: exports gate it. */
|
|
1255
|
+
DeviceRole["CoverDoor"] = "cover-door";
|
|
1256
|
+
/** Window. HA `device_class: window`. */
|
|
1257
|
+
DeviceRole["CoverWindow"] = "cover-window";
|
|
1258
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
1259
|
+
* real Switch device for UI rendering / export adapters. */
|
|
1260
|
+
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
1261
|
+
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
1262
|
+
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
1263
|
+
DeviceRole["Outlet"] = "outlet";
|
|
1264
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
1265
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
1266
|
+
* chosen time. */
|
|
1267
|
+
DeviceRole["SwitchHeater"] = "switch-heater";
|
|
1268
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
1269
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
1270
|
+
* device also has a fan cap (D1033). */
|
|
1271
|
+
DeviceRole["SwitchFan"] = "switch-fan";
|
|
1272
|
+
/** A relay driving an on/off-only lamp: drawn as a light (bulb and glow, no
|
|
1273
|
+
* slider), presented to the exports as a light with power only. Not a
|
|
1274
|
+
* `light` type: the provider owns the type, and a light implies brightness
|
|
1275
|
+
* or colour this relay lacks. */
|
|
1276
|
+
DeviceRole["SwitchLight"] = "switch-light";
|
|
1277
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
1278
|
+
DeviceRole["ClimateAc"] = "climate-ac";
|
|
1279
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
1280
|
+
DeviceRole["ClimateThermostat"] = "climate-thermostat";
|
|
1281
|
+
/** Floor-heating zone actuator. */
|
|
1282
|
+
DeviceRole["ClimateFloor"] = "climate-floor";
|
|
1283
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
1284
|
+
DeviceRole["ClimateRadiator"] = "climate-radiator";
|
|
1285
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
1286
|
+
DeviceRole["ClimateHeater"] = "climate-heater";
|
|
1287
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
1288
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
1289
|
+
DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
|
|
1290
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
1291
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
1292
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
1293
|
+
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
1294
|
+
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
1295
|
+
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
1296
|
+
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
1297
|
+
DeviceRole["COSensor"] = "co-sensor";
|
|
1298
|
+
DeviceRole["GasSensor"] = "gas-sensor";
|
|
1299
|
+
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
1300
|
+
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
1301
|
+
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
1302
|
+
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
1303
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
1304
|
+
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
1305
|
+
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
1306
|
+
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
1307
|
+
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
1308
|
+
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
1309
|
+
/** Wind speed or direction (weather-station `wind-sensor` cap). */
|
|
1310
|
+
DeviceRole["WindSensor"] = "wind-sensor";
|
|
1311
|
+
/** Rain accumulation or rate (weather-station `rain-sensor` cap). */
|
|
1312
|
+
DeviceRole["RainSensor"] = "rain-sensor";
|
|
1313
|
+
/** UV index (weather-station `uv-sensor` cap). */
|
|
1314
|
+
DeviceRole["UvSensor"] = "uv-sensor";
|
|
1315
|
+
/** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
|
|
1316
|
+
* Distinct from AmbientLightSensor (lux). */
|
|
1317
|
+
DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
|
|
1318
|
+
/** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
|
|
1319
|
+
DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
|
|
1320
|
+
DeviceRole["PowerSensor"] = "power-sensor";
|
|
1321
|
+
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
1322
|
+
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
1323
|
+
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
1324
|
+
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
1325
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
1326
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
1327
|
+
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
1328
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
1329
|
+
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
1330
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
1331
|
+
* `attributes.options`). */
|
|
1332
|
+
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
1333
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
1334
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
1335
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
1336
|
+
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
1337
|
+
/** Last-resort fallback when nothing else matches. */
|
|
1338
|
+
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
1339
|
+
DeviceRole["NumericControl"] = "numeric-control";
|
|
1340
|
+
DeviceRole["SelectControl"] = "select-control";
|
|
1341
|
+
DeviceRole["TextControl"] = "text-control";
|
|
1342
|
+
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
1343
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
1344
|
+
* rich features (image, priority, channel routing). */
|
|
1345
|
+
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
1346
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
1347
|
+
* `notify.discord_*`, etc.). */
|
|
1348
|
+
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
1349
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
1350
|
+
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
1351
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
1352
|
+
* pattern. */
|
|
1353
|
+
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
1354
|
+
/** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
|
|
1355
|
+
* cap. A `DeviceType.Generic` device. */
|
|
1356
|
+
DeviceRole["IrTransmitter"] = "ir-transmitter";
|
|
1357
|
+
return DeviceRole;
|
|
1358
|
+
}({});
|
|
1221
1359
|
zod.z.enum(["new-session", "step-up"]);
|
|
1222
1360
|
zod.z.enum(["en", "it"]);
|
|
1223
1361
|
/** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
|
|
@@ -26970,6 +27108,155 @@ function isSource(x) {
|
|
|
26970
27108
|
return typeof x.read === "function" && typeof x.watch === "function";
|
|
26971
27109
|
}
|
|
26972
27110
|
//#endregion
|
|
27111
|
+
//#region src/device/device-icon.ts
|
|
27112
|
+
/**
|
|
27113
|
+
* device-icon — THE icon of a device, from what it IS: its {@link DeviceType},
|
|
27114
|
+
* refined by its {@link DeviceRole}. One table for every surface: the admin's
|
|
27115
|
+
* rows, cards, page header, lists and pickers draw it through ui-library's
|
|
27116
|
+
* glyph table, the viewer through its catalog nodes. The value is a key of the
|
|
27117
|
+
* icon catalog (D854), never a glyph.
|
|
27118
|
+
*
|
|
27119
|
+
* Exhaustive over both enums (`satisfies Record<…>`): a new type or role fails
|
|
27120
|
+
* the build until it has an icon. Nothing here reads a name, a provider or a
|
|
27121
|
+
* capability — an icon picked from those would be invented.
|
|
27122
|
+
*
|
|
27123
|
+
* Precedence: a known role → its icon; otherwise the type's icon; a type this
|
|
27124
|
+
* build does not know → the generic type's icon. An operator's per-device or
|
|
27125
|
+
* per-role display override is the caller's level above this one.
|
|
27126
|
+
*/
|
|
27127
|
+
/** The icon of each device type. */
|
|
27128
|
+
var DEVICE_TYPE_ICON = {
|
|
27129
|
+
[DeviceType.Camera]: "camera",
|
|
27130
|
+
[DeviceType.Hub]: "network",
|
|
27131
|
+
[DeviceType.Light]: "lightbulb",
|
|
27132
|
+
[DeviceType.Siren]: "siren",
|
|
27133
|
+
[DeviceType.Switch]: "toggle-left",
|
|
27134
|
+
[DeviceType.Sensor]: "activity",
|
|
27135
|
+
[DeviceType.Climate]: "thermometer",
|
|
27136
|
+
[DeviceType.HeatPump]: "flame",
|
|
27137
|
+
[DeviceType.Button]: "circle-dot",
|
|
27138
|
+
[DeviceType.EventEmitter]: "zap",
|
|
27139
|
+
[DeviceType.Update]: "refresh-cw",
|
|
27140
|
+
[DeviceType.Generic]: "box",
|
|
27141
|
+
[DeviceType.Notifier]: "bell",
|
|
27142
|
+
[DeviceType.Script]: "scroll-text",
|
|
27143
|
+
[DeviceType.Automation]: "workflow",
|
|
27144
|
+
[DeviceType.Lock]: "lock",
|
|
27145
|
+
[DeviceType.Cover]: "blinds",
|
|
27146
|
+
[DeviceType.Valve]: "pipette",
|
|
27147
|
+
[DeviceType.Humidifier]: "waves",
|
|
27148
|
+
[DeviceType.WaterHeater]: "bath",
|
|
27149
|
+
[DeviceType.Fan]: "fan",
|
|
27150
|
+
[DeviceType.MediaPlayer]: "monitor-play",
|
|
27151
|
+
[DeviceType.AlarmPanel]: "shield-alert",
|
|
27152
|
+
[DeviceType.Control]: "sliders-horizontal",
|
|
27153
|
+
[DeviceType.Presence]: "map-pin",
|
|
27154
|
+
[DeviceType.Weather]: "cloud-sun",
|
|
27155
|
+
[DeviceType.Vacuum]: "bot",
|
|
27156
|
+
[DeviceType.LawnMower]: "tractor",
|
|
27157
|
+
[DeviceType.Container]: "box",
|
|
27158
|
+
[DeviceType.Image]: "image",
|
|
27159
|
+
[DeviceType.PetFeeder]: "bone",
|
|
27160
|
+
[DeviceType.PetFountain]: "droplets",
|
|
27161
|
+
[DeviceType.Dishwasher]: "waves",
|
|
27162
|
+
[DeviceType.Washer]: "washing-machine",
|
|
27163
|
+
[DeviceType.Dryer]: "wind",
|
|
27164
|
+
[DeviceType.Gateway]: "router"
|
|
27165
|
+
};
|
|
27166
|
+
/** The icon of each role: what the device is FOR, which reads better than its type. */
|
|
27167
|
+
var DEVICE_ROLE_ICON = {
|
|
27168
|
+
[DeviceRole.Siren]: "siren",
|
|
27169
|
+
[DeviceRole.Floodlight]: "lightbulb",
|
|
27170
|
+
[DeviceRole.Spotlight]: "flashlight",
|
|
27171
|
+
[DeviceRole.PirSensor]: "radar",
|
|
27172
|
+
[DeviceRole.Chime]: "bell",
|
|
27173
|
+
[DeviceRole.Autotrack]: "crosshair",
|
|
27174
|
+
[DeviceRole.Nightvision]: "moon",
|
|
27175
|
+
[DeviceRole.PrivacyMask]: "eye-off",
|
|
27176
|
+
[DeviceRole.Doorbell]: "door-closed",
|
|
27177
|
+
[DeviceRole.CoverBlind]: "blinds",
|
|
27178
|
+
[DeviceRole.CoverShutter]: "blinds",
|
|
27179
|
+
[DeviceRole.CoverAwning]: "blinds",
|
|
27180
|
+
[DeviceRole.CoverCurtain]: "blinds",
|
|
27181
|
+
[DeviceRole.CoverGarage]: "door-closed",
|
|
27182
|
+
[DeviceRole.CoverGate]: "door-closed",
|
|
27183
|
+
[DeviceRole.CoverDoor]: "door-open",
|
|
27184
|
+
[DeviceRole.CoverWindow]: "blinds",
|
|
27185
|
+
[DeviceRole.BinaryHelper]: "toggle-left",
|
|
27186
|
+
[DeviceRole.Outlet]: "plug",
|
|
27187
|
+
[DeviceRole.SwitchHeater]: "flame",
|
|
27188
|
+
[DeviceRole.SwitchFan]: "fan",
|
|
27189
|
+
[DeviceRole.SwitchLight]: "lightbulb",
|
|
27190
|
+
[DeviceRole.ClimateAc]: "air-vent",
|
|
27191
|
+
[DeviceRole.ClimateThermostat]: "thermometer",
|
|
27192
|
+
[DeviceRole.ClimateFloor]: "waves",
|
|
27193
|
+
[DeviceRole.ClimateRadiator]: "heater",
|
|
27194
|
+
[DeviceRole.ClimateHeater]: "flame",
|
|
27195
|
+
[DeviceRole.ClimateHeatPumpCircuit]: "refresh-cw",
|
|
27196
|
+
[DeviceRole.MotionSensor]: "footprints",
|
|
27197
|
+
[DeviceRole.ContactSensor]: "door-open",
|
|
27198
|
+
[DeviceRole.LeakSensor]: "droplet",
|
|
27199
|
+
[DeviceRole.SmokeSensor]: "alarm-smoke",
|
|
27200
|
+
[DeviceRole.COSensor]: "wind",
|
|
27201
|
+
[DeviceRole.GasSensor]: "flame",
|
|
27202
|
+
[DeviceRole.TamperSensor]: "shield-alert",
|
|
27203
|
+
[DeviceRole.VibrationSensor]: "vibrate",
|
|
27204
|
+
[DeviceRole.ConnectivitySensor]: "wifi",
|
|
27205
|
+
[DeviceRole.SoundSensor]: "volume-2",
|
|
27206
|
+
[DeviceRole.BinarySensor]: "toggle-left",
|
|
27207
|
+
[DeviceRole.TemperatureSensor]: "thermometer",
|
|
27208
|
+
[DeviceRole.HumiditySensor]: "droplets",
|
|
27209
|
+
[DeviceRole.AmbientLightSensor]: "sun",
|
|
27210
|
+
[DeviceRole.PressureSensor]: "gauge",
|
|
27211
|
+
[DeviceRole.WindSensor]: "wind",
|
|
27212
|
+
[DeviceRole.RainSensor]: "cloud-rain",
|
|
27213
|
+
[DeviceRole.UvSensor]: "sun-medium",
|
|
27214
|
+
[DeviceRole.SolarRadiationSensor]: "sunrise",
|
|
27215
|
+
[DeviceRole.SoilMoistureSensor]: "sprout",
|
|
27216
|
+
[DeviceRole.PowerSensor]: "zap",
|
|
27217
|
+
[DeviceRole.EnergySensor]: "zap",
|
|
27218
|
+
[DeviceRole.VoltageSensor]: "zap",
|
|
27219
|
+
[DeviceRole.CurrentSensor]: "zap",
|
|
27220
|
+
[DeviceRole.AirQualitySensor]: "wind",
|
|
27221
|
+
[DeviceRole.BatterySensor]: "gauge",
|
|
27222
|
+
[DeviceRole.NumericSensor]: "hash",
|
|
27223
|
+
[DeviceRole.EnumSensor]: "list",
|
|
27224
|
+
[DeviceRole.DateTimeSensor]: "clock",
|
|
27225
|
+
[DeviceRole.GenericSensor]: "gauge",
|
|
27226
|
+
[DeviceRole.NumericControl]: "sliders-horizontal",
|
|
27227
|
+
[DeviceRole.SelectControl]: "list-checks",
|
|
27228
|
+
[DeviceRole.TextControl]: "type",
|
|
27229
|
+
[DeviceRole.DateTimeControl]: "clock",
|
|
27230
|
+
[DeviceRole.MobilePushNotifier]: "smartphone",
|
|
27231
|
+
[DeviceRole.MessagingNotifier]: "message-square",
|
|
27232
|
+
[DeviceRole.EmailNotifier]: "mail",
|
|
27233
|
+
[DeviceRole.GenericNotifier]: "bell",
|
|
27234
|
+
[DeviceRole.IrTransmitter]: "radio-tower"
|
|
27235
|
+
};
|
|
27236
|
+
var TYPE_VALUES = new Set(Object.values(DeviceType));
|
|
27237
|
+
var ROLE_VALUES = new Set(Object.values(DeviceRole));
|
|
27238
|
+
function isDeviceType(value) {
|
|
27239
|
+
return TYPE_VALUES.has(value);
|
|
27240
|
+
}
|
|
27241
|
+
function isDeviceRole(value) {
|
|
27242
|
+
return ROLE_VALUES.has(value);
|
|
27243
|
+
}
|
|
27244
|
+
/** The icon of a device type alone; a type this build does not know draws the generic one. */
|
|
27245
|
+
function deviceTypeIconKey(type) {
|
|
27246
|
+
return isDeviceType(type) ? DEVICE_TYPE_ICON[type] : DEVICE_TYPE_ICON[DeviceType.Generic];
|
|
27247
|
+
}
|
|
27248
|
+
/** The icon of a role alone, or `null` for a role this build does not know. */
|
|
27249
|
+
function deviceRoleIconKey(role) {
|
|
27250
|
+
return isDeviceRole(role) ? DEVICE_ROLE_ICON[role] : null;
|
|
27251
|
+
}
|
|
27252
|
+
/**
|
|
27253
|
+
* The icon of a device: its role's when the role is known, else its type's.
|
|
27254
|
+
* An unknown role never borrows another role's icon — it is drawn as its type.
|
|
27255
|
+
*/
|
|
27256
|
+
function deviceIconKey(type, role) {
|
|
27257
|
+
return (role === null || role === void 0 ? null : deviceRoleIconKey(role)) ?? deviceTypeIconKey(type);
|
|
27258
|
+
}
|
|
27259
|
+
//#endregion
|
|
26973
27260
|
//#region src/helpers/addon-slice-handle.ts
|
|
26974
27261
|
/** Structural bridge: every `AddonApi` client carries `deviceState` (+ optional `live`). */
|
|
26975
27262
|
function addonSliceHandleApi(api) {
|
|
@@ -33232,7 +33519,9 @@ exports.canonicalIconKey = canonicalIconKey;
|
|
|
33232
33519
|
exports.classifyRetrainReview = classifyRetrainReview;
|
|
33233
33520
|
exports.conditionVisibleForKind = conditionVisibleForKind;
|
|
33234
33521
|
exports.createSystemProxy = createSystemProxy;
|
|
33522
|
+
exports.deviceIconKey = deviceIconKey;
|
|
33235
33523
|
exports.deviceRefusalFromMessage = deviceRefusalFromMessage;
|
|
33524
|
+
exports.deviceTypeIconKey = deviceTypeIconKey;
|
|
33236
33525
|
exports.droppedConditionsForKind = droppedConditionsForKind;
|
|
33237
33526
|
exports.expandSystemEventClasses = expandSystemEventClasses;
|
|
33238
33527
|
exports.iconCategoryLabel = iconCategoryLabel;
|