@camstack/addon-provider-reolink 1.0.5 → 1.0.7
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/addon.js +706 -671
- package/dist/addon.mjs +706 -671
- package/package.json +1 -1
package/dist/addon.mjs
CHANGED
|
@@ -4650,63 +4650,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4650
4650
|
return inst;
|
|
4651
4651
|
}
|
|
4652
4652
|
//#endregion
|
|
4653
|
-
//#region ../types/dist/
|
|
4654
|
-
/**
|
|
4655
|
-
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
4656
|
-
* every declared capability + widget of every installed plugin, on every
|
|
4657
|
-
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
4658
|
-
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
4659
|
-
*
|
|
4660
|
-
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
4661
|
-
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
4662
|
-
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
4663
|
-
*/
|
|
4664
|
-
/** What kind of target a probe addressed. */
|
|
4665
|
-
var wiringProbeKindSchema = _enum([
|
|
4666
|
-
"singleton",
|
|
4667
|
-
"device",
|
|
4668
|
-
"widget"
|
|
4669
|
-
]);
|
|
4670
|
-
/** Result of probing a single (cap|widget [, device]) target. */
|
|
4671
|
-
var wiringProbeResultSchema = object({
|
|
4672
|
-
capName: string(),
|
|
4673
|
-
kind: wiringProbeKindSchema,
|
|
4674
|
-
deviceId: number().optional(),
|
|
4675
|
-
reachable: boolean(),
|
|
4676
|
-
latencyMs: number(),
|
|
4677
|
-
error: string().optional()
|
|
4678
|
-
});
|
|
4679
|
-
/** Per-addon roll-up of cap + widget probe results. */
|
|
4680
|
-
var wiringAddonHealthSchema = object({
|
|
4681
|
-
addonId: string(),
|
|
4682
|
-
caps: array(wiringProbeResultSchema).readonly(),
|
|
4683
|
-
widgets: array(wiringProbeResultSchema).readonly()
|
|
4684
|
-
});
|
|
4685
|
-
/** Per-node roll-up. */
|
|
4686
|
-
var wiringNodeHealthSchema = object({
|
|
4687
|
-
nodeId: string(),
|
|
4688
|
-
addons: array(wiringAddonHealthSchema).readonly()
|
|
4689
|
-
});
|
|
4690
|
-
object({
|
|
4691
|
-
/** True only when every probed target is reachable. */
|
|
4692
|
-
ok: boolean(),
|
|
4693
|
-
/** True when at least one target is unreachable. */
|
|
4694
|
-
degraded: boolean(),
|
|
4695
|
-
checkedAt: string(),
|
|
4696
|
-
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
4697
|
-
summary: object({
|
|
4698
|
-
total: number(),
|
|
4699
|
-
reachable: number(),
|
|
4700
|
-
unreachable: number()
|
|
4701
|
-
})
|
|
4702
|
-
});
|
|
4703
|
-
var MODEL_FORMATS = [
|
|
4704
|
-
"onnx",
|
|
4705
|
-
"coreml",
|
|
4706
|
-
"openvino",
|
|
4707
|
-
"tflite",
|
|
4708
|
-
"pt"
|
|
4709
|
-
];
|
|
4653
|
+
//#region ../types/dist/sleep-B1dKJAMJ.mjs
|
|
4710
4654
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4711
4655
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4712
4656
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -5680,7 +5624,7 @@ var BaseAddon = class {
|
|
|
5680
5624
|
deviceSettingsSchema() {
|
|
5681
5625
|
return null;
|
|
5682
5626
|
}
|
|
5683
|
-
async getGlobalSettings(overlay, cap) {
|
|
5627
|
+
async getGlobalSettings(overlay, cap, _nodeId) {
|
|
5684
5628
|
const schema = this.globalSettingsSchema(cap);
|
|
5685
5629
|
if (!schema) return { sections: [] };
|
|
5686
5630
|
const raw = await this._ctx?.settings?.readAddonStore() ?? {};
|
|
@@ -5689,7 +5633,7 @@ var BaseAddon = class {
|
|
|
5689
5633
|
...overlay
|
|
5690
5634
|
} : raw);
|
|
5691
5635
|
}
|
|
5692
|
-
async updateGlobalSettings(patch) {
|
|
5636
|
+
async updateGlobalSettings(patch, _nodeId) {
|
|
5693
5637
|
await this._ctx?.settings?.writeAddonStore(patch);
|
|
5694
5638
|
await this.resolveConfig();
|
|
5695
5639
|
await this.onConfigChanged();
|
|
@@ -5943,181 +5887,6 @@ function normalizeAddonInitResult(result) {
|
|
|
5943
5887
|
if (Array.isArray(result)) return { providers: result };
|
|
5944
5888
|
return result;
|
|
5945
5889
|
}
|
|
5946
|
-
var EU_DST = {
|
|
5947
|
-
offsetHours: 1,
|
|
5948
|
-
startMonth: 3,
|
|
5949
|
-
startWeekIndex: 5,
|
|
5950
|
-
startWeekday: "Sunday",
|
|
5951
|
-
startHour: 2,
|
|
5952
|
-
endMonth: 10,
|
|
5953
|
-
endWeekIndex: 5,
|
|
5954
|
-
endWeekday: "Sunday",
|
|
5955
|
-
endHour: 3
|
|
5956
|
-
};
|
|
5957
|
-
var US_DST = {
|
|
5958
|
-
offsetHours: 1,
|
|
5959
|
-
startMonth: 3,
|
|
5960
|
-
startWeekIndex: 2,
|
|
5961
|
-
startWeekday: "Sunday",
|
|
5962
|
-
startHour: 2,
|
|
5963
|
-
endMonth: 11,
|
|
5964
|
-
endWeekIndex: 1,
|
|
5965
|
-
endWeekday: "Sunday",
|
|
5966
|
-
endHour: 2
|
|
5967
|
-
};
|
|
5968
|
-
/**
|
|
5969
|
-
* Curated catalogue of common world zones, grouped by region. Not
|
|
5970
|
-
* exhaustive — covers the everyday zones an operator is likely to pick.
|
|
5971
|
-
*/
|
|
5972
|
-
var TIMEZONES = [
|
|
5973
|
-
{
|
|
5974
|
-
id: "UTC",
|
|
5975
|
-
label: "UTC (UTC+0)",
|
|
5976
|
-
region: "Universal",
|
|
5977
|
-
stdOffsetMinutes: 0,
|
|
5978
|
-
dst: null
|
|
5979
|
-
},
|
|
5980
|
-
{
|
|
5981
|
-
id: "Europe/London",
|
|
5982
|
-
label: "Europe/London (UTC+0 / BST)",
|
|
5983
|
-
region: "Europe",
|
|
5984
|
-
stdOffsetMinutes: 0,
|
|
5985
|
-
dst: EU_DST
|
|
5986
|
-
},
|
|
5987
|
-
{
|
|
5988
|
-
id: "Europe/Rome",
|
|
5989
|
-
label: "Europe/Rome (UTC+1 / CEST)",
|
|
5990
|
-
region: "Europe",
|
|
5991
|
-
stdOffsetMinutes: 60,
|
|
5992
|
-
dst: EU_DST
|
|
5993
|
-
},
|
|
5994
|
-
{
|
|
5995
|
-
id: "Europe/Paris",
|
|
5996
|
-
label: "Europe/Paris (UTC+1 / CEST)",
|
|
5997
|
-
region: "Europe",
|
|
5998
|
-
stdOffsetMinutes: 60,
|
|
5999
|
-
dst: EU_DST
|
|
6000
|
-
},
|
|
6001
|
-
{
|
|
6002
|
-
id: "Europe/Berlin",
|
|
6003
|
-
label: "Europe/Berlin (UTC+1 / CEST)",
|
|
6004
|
-
region: "Europe",
|
|
6005
|
-
stdOffsetMinutes: 60,
|
|
6006
|
-
dst: EU_DST
|
|
6007
|
-
},
|
|
6008
|
-
{
|
|
6009
|
-
id: "Europe/Madrid",
|
|
6010
|
-
label: "Europe/Madrid (UTC+1 / CEST)",
|
|
6011
|
-
region: "Europe",
|
|
6012
|
-
stdOffsetMinutes: 60,
|
|
6013
|
-
dst: EU_DST
|
|
6014
|
-
},
|
|
6015
|
-
{
|
|
6016
|
-
id: "Europe/Amsterdam",
|
|
6017
|
-
label: "Europe/Amsterdam (UTC+1 / CEST)",
|
|
6018
|
-
region: "Europe",
|
|
6019
|
-
stdOffsetMinutes: 60,
|
|
6020
|
-
dst: EU_DST
|
|
6021
|
-
},
|
|
6022
|
-
{
|
|
6023
|
-
id: "Europe/Istanbul",
|
|
6024
|
-
label: "Europe/Istanbul (UTC+3)",
|
|
6025
|
-
region: "Europe",
|
|
6026
|
-
stdOffsetMinutes: 180,
|
|
6027
|
-
dst: null
|
|
6028
|
-
},
|
|
6029
|
-
{
|
|
6030
|
-
id: "America/New_York",
|
|
6031
|
-
label: "America/New York (UTC−5 / EDT)",
|
|
6032
|
-
region: "Americas",
|
|
6033
|
-
stdOffsetMinutes: -300,
|
|
6034
|
-
dst: US_DST
|
|
6035
|
-
},
|
|
6036
|
-
{
|
|
6037
|
-
id: "America/Chicago",
|
|
6038
|
-
label: "America/Chicago (UTC−6 / CDT)",
|
|
6039
|
-
region: "Americas",
|
|
6040
|
-
stdOffsetMinutes: -360,
|
|
6041
|
-
dst: US_DST
|
|
6042
|
-
},
|
|
6043
|
-
{
|
|
6044
|
-
id: "America/Denver",
|
|
6045
|
-
label: "America/Denver (UTC−7 / MDT)",
|
|
6046
|
-
region: "Americas",
|
|
6047
|
-
stdOffsetMinutes: -420,
|
|
6048
|
-
dst: US_DST
|
|
6049
|
-
},
|
|
6050
|
-
{
|
|
6051
|
-
id: "America/Los_Angeles",
|
|
6052
|
-
label: "America/Los Angeles (UTC−8 / PDT)",
|
|
6053
|
-
region: "Americas",
|
|
6054
|
-
stdOffsetMinutes: -480,
|
|
6055
|
-
dst: US_DST
|
|
6056
|
-
},
|
|
6057
|
-
{
|
|
6058
|
-
id: "America/Sao_Paulo",
|
|
6059
|
-
label: "America/Sao Paulo (UTC−3)",
|
|
6060
|
-
region: "Americas",
|
|
6061
|
-
stdOffsetMinutes: -180,
|
|
6062
|
-
dst: null
|
|
6063
|
-
},
|
|
6064
|
-
{
|
|
6065
|
-
id: "Asia/Dubai",
|
|
6066
|
-
label: "Asia/Dubai (UTC+4)",
|
|
6067
|
-
region: "Asia",
|
|
6068
|
-
stdOffsetMinutes: 240,
|
|
6069
|
-
dst: null
|
|
6070
|
-
},
|
|
6071
|
-
{
|
|
6072
|
-
id: "Asia/Kolkata",
|
|
6073
|
-
label: "Asia/Kolkata (UTC+5:30)",
|
|
6074
|
-
region: "Asia",
|
|
6075
|
-
stdOffsetMinutes: 330,
|
|
6076
|
-
dst: null
|
|
6077
|
-
},
|
|
6078
|
-
{
|
|
6079
|
-
id: "Asia/Singapore",
|
|
6080
|
-
label: "Asia/Singapore (UTC+8)",
|
|
6081
|
-
region: "Asia",
|
|
6082
|
-
stdOffsetMinutes: 480,
|
|
6083
|
-
dst: null
|
|
6084
|
-
},
|
|
6085
|
-
{
|
|
6086
|
-
id: "Asia/Shanghai",
|
|
6087
|
-
label: "Asia/Shanghai (UTC+8)",
|
|
6088
|
-
region: "Asia",
|
|
6089
|
-
stdOffsetMinutes: 480,
|
|
6090
|
-
dst: null
|
|
6091
|
-
},
|
|
6092
|
-
{
|
|
6093
|
-
id: "Asia/Tokyo",
|
|
6094
|
-
label: "Asia/Tokyo (UTC+9)",
|
|
6095
|
-
region: "Asia",
|
|
6096
|
-
stdOffsetMinutes: 540,
|
|
6097
|
-
dst: null
|
|
6098
|
-
},
|
|
6099
|
-
{
|
|
6100
|
-
id: "Australia/Sydney",
|
|
6101
|
-
label: "Australia/Sydney (UTC+10 / AEDT)",
|
|
6102
|
-
region: "Oceania",
|
|
6103
|
-
stdOffsetMinutes: 600,
|
|
6104
|
-
dst: {
|
|
6105
|
-
offsetHours: 1,
|
|
6106
|
-
startMonth: 10,
|
|
6107
|
-
startWeekIndex: 1,
|
|
6108
|
-
startWeekday: "Sunday",
|
|
6109
|
-
startHour: 2,
|
|
6110
|
-
endMonth: 4,
|
|
6111
|
-
endWeekIndex: 1,
|
|
6112
|
-
endWeekday: "Sunday",
|
|
6113
|
-
endHour: 3
|
|
6114
|
-
}
|
|
6115
|
-
}
|
|
6116
|
-
];
|
|
6117
|
-
/** Resolve an IANA id to its `Timezone`, or `undefined` if unknown. */
|
|
6118
|
-
function findTimezone(id) {
|
|
6119
|
-
return TIMEZONES.find((tz) => tz.id === id);
|
|
6120
|
-
}
|
|
6121
5890
|
/** Shared Zod schemas used across streaming capabilities. */
|
|
6122
5891
|
var CamProfileSchema = _enum([
|
|
6123
5892
|
"high",
|
|
@@ -6204,7 +5973,7 @@ var ProfileSlotSchema = object({
|
|
|
6204
5973
|
* Zod schema for StreamSourceEntry — the canonical stream descriptor
|
|
6205
5974
|
* exposed by ICameraDevice.getStreamSources() and consumed by the broker.
|
|
6206
5975
|
*/
|
|
6207
|
-
var StreamSourceEntrySchema = object({
|
|
5976
|
+
var StreamSourceEntrySchema$1 = object({
|
|
6208
5977
|
id: string(),
|
|
6209
5978
|
label: string(),
|
|
6210
5979
|
protocol: _enum([
|
|
@@ -6426,6 +6195,671 @@ var ProfileRtspEntrySchema = object({
|
|
|
6426
6195
|
codec: string().optional(),
|
|
6427
6196
|
resolution: CamStreamResolutionSchema.optional()
|
|
6428
6197
|
});
|
|
6198
|
+
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6199
|
+
DeviceType["Camera"] = "camera";
|
|
6200
|
+
DeviceType["Hub"] = "hub";
|
|
6201
|
+
DeviceType["Light"] = "light";
|
|
6202
|
+
DeviceType["Siren"] = "siren";
|
|
6203
|
+
DeviceType["Switch"] = "switch";
|
|
6204
|
+
DeviceType["Sensor"] = "sensor";
|
|
6205
|
+
DeviceType["Thermostat"] = "thermostat";
|
|
6206
|
+
DeviceType["Button"] = "button";
|
|
6207
|
+
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
6208
|
+
* event vocabulary verbatim (no normalization). Installed with the
|
|
6209
|
+
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
6210
|
+
* HA bus events (e.g. `zha_event`, generic). */
|
|
6211
|
+
DeviceType["EventEmitter"] = "event-emitter";
|
|
6212
|
+
/** Firmware/software update entity — current vs available version,
|
|
6213
|
+
* updatable flag, update state, and an install action. Installed with
|
|
6214
|
+
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
6215
|
+
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
6216
|
+
DeviceType["Update"] = "update";
|
|
6217
|
+
DeviceType["Generic"] = "generic";
|
|
6218
|
+
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
6219
|
+
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
6220
|
+
* endpoint; the `notifier` cap defines the send surface. */
|
|
6221
|
+
DeviceType["Notifier"] = "notifier";
|
|
6222
|
+
/** Pre-recorded action sequence with optional parameters
|
|
6223
|
+
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
6224
|
+
DeviceType["Script"] = "script";
|
|
6225
|
+
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
6226
|
+
* trigger surface exposed via `automation-control` cap. */
|
|
6227
|
+
DeviceType["Automation"] = "automation";
|
|
6228
|
+
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
6229
|
+
DeviceType["Lock"] = "lock";
|
|
6230
|
+
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
6231
|
+
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
6232
|
+
DeviceType["Cover"] = "cover";
|
|
6233
|
+
/** Pipe / water / gas valve with open/close/stop and optional
|
|
6234
|
+
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
6235
|
+
* modelled on the same open/closed lifecycle. */
|
|
6236
|
+
DeviceType["Valve"] = "valve";
|
|
6237
|
+
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
6238
|
+
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
6239
|
+
* modelled on the same target / mode lifecycle. */
|
|
6240
|
+
DeviceType["Humidifier"] = "humidifier";
|
|
6241
|
+
/** Water heater / boiler with target temperature + operation mode +
|
|
6242
|
+
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
6243
|
+
* climate-family actuator. */
|
|
6244
|
+
DeviceType["WaterHeater"] = "water-heater";
|
|
6245
|
+
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
6246
|
+
DeviceType["Fan"] = "fan";
|
|
6247
|
+
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
6248
|
+
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
6249
|
+
DeviceType["MediaPlayer"] = "media-player";
|
|
6250
|
+
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
6251
|
+
* `alarm-panel` cap. */
|
|
6252
|
+
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
6253
|
+
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
6254
|
+
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
6255
|
+
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
6256
|
+
* TextControl / DateTimeControl. */
|
|
6257
|
+
DeviceType["Control"] = "control";
|
|
6258
|
+
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
6259
|
+
* `presence` cap. */
|
|
6260
|
+
DeviceType["Presence"] = "presence";
|
|
6261
|
+
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
6262
|
+
* `weather` cap. */
|
|
6263
|
+
DeviceType["Weather"] = "weather";
|
|
6264
|
+
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
6265
|
+
DeviceType["Vacuum"] = "vacuum";
|
|
6266
|
+
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
6267
|
+
* `lawn-mower-control` cap. */
|
|
6268
|
+
DeviceType["LawnMower"] = "lawn-mower";
|
|
6269
|
+
/** Physical HA device group — parent container for entity-children
|
|
6270
|
+
* adopted from a single HA device entry. Not renderable as a
|
|
6271
|
+
* standalone device; exists only to anchor child entities. */
|
|
6272
|
+
DeviceType["Container"] = "container";
|
|
6273
|
+
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6274
|
+
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6275
|
+
DeviceType["Image"] = "image";
|
|
6276
|
+
return DeviceType;
|
|
6277
|
+
}({});
|
|
6278
|
+
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
6279
|
+
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
6280
|
+
DeviceFeature["Rebootable"] = "rebootable";
|
|
6281
|
+
/**
|
|
6282
|
+
* Device supports an on-demand re-sync of its derived spec with its
|
|
6283
|
+
* upstream source — drives the generic Re-sync button. The owning
|
|
6284
|
+
* provider implements the action via the `device-adoption.resync` cap.
|
|
6285
|
+
*/
|
|
6286
|
+
DeviceFeature["Resyncable"] = "resyncable";
|
|
6287
|
+
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6288
|
+
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6289
|
+
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6290
|
+
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6291
|
+
/**
|
|
6292
|
+
* Camera supports the on-firmware autotrack subsystem (subject-
|
|
6293
|
+
* following). Distinct from `PanTiltZoom` because not every PTZ
|
|
6294
|
+
* camera ships autotrack — the admin UI uses this flag to gate
|
|
6295
|
+
* the autotrack toggle / settings card without re-deriving from
|
|
6296
|
+
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6297
|
+
* driver sets this feature when probe confirms the firmware
|
|
6298
|
+
* surface, and registers the cap in the same code path.
|
|
6299
|
+
*/
|
|
6300
|
+
DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
|
|
6301
|
+
/**
|
|
6302
|
+
* Accessory exposes a "trigger on motion" toggle — the parent camera's
|
|
6303
|
+
* motion detection automatically activates this device. Mirrors
|
|
6304
|
+
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6305
|
+
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6306
|
+
*
|
|
6307
|
+
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
6308
|
+
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
6309
|
+
* filters that want "all devices with on-motion behaviour".
|
|
6310
|
+
*/
|
|
6311
|
+
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
6312
|
+
/** Light supports rgb-triplet color via `color` cap. */
|
|
6313
|
+
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
6314
|
+
/** Light supports HSV color via `color` cap. */
|
|
6315
|
+
DeviceFeature["LightColorHsv"] = "light-color-hsv";
|
|
6316
|
+
/** Light supports color-temperature (mired) via `color` cap. */
|
|
6317
|
+
DeviceFeature["LightColorMired"] = "light-color-mired";
|
|
6318
|
+
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
6319
|
+
* targetHigh). Gates the range slider UI. */
|
|
6320
|
+
DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
|
|
6321
|
+
/** Thermostat exposes target humidity and/or current humidity
|
|
6322
|
+
* readings. Gates the humidity controls. */
|
|
6323
|
+
DeviceFeature["ClimateHumidity"] = "climate-humidity";
|
|
6324
|
+
/** Thermostat exposes a fan-mode selector. */
|
|
6325
|
+
DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
|
|
6326
|
+
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
6327
|
+
DeviceFeature["ClimatePreset"] = "climate-preset";
|
|
6328
|
+
/** Cover exposes intermediate position control (0..100). Gates the
|
|
6329
|
+
* position slider UI. */
|
|
6330
|
+
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
6331
|
+
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
6332
|
+
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
6333
|
+
/** Valve exposes intermediate position control (0..100). Gates the
|
|
6334
|
+
* position slider / drag surface UI. */
|
|
6335
|
+
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
6336
|
+
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
6337
|
+
DeviceFeature["FanSpeed"] = "fan-speed";
|
|
6338
|
+
/** Fan exposes a preset mode selector. */
|
|
6339
|
+
DeviceFeature["FanPreset"] = "fan-preset";
|
|
6340
|
+
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
6341
|
+
* ceiling fans. */
|
|
6342
|
+
DeviceFeature["FanDirection"] = "fan-direction";
|
|
6343
|
+
/** Fan exposes an oscillation toggle. */
|
|
6344
|
+
DeviceFeature["FanOscillating"] = "fan-oscillating";
|
|
6345
|
+
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
6346
|
+
* field on the UI lock-controls panel. */
|
|
6347
|
+
DeviceFeature["LockPinRequired"] = "lock-pin-required";
|
|
6348
|
+
/** Lock supports a latch-release ("open door") action distinct from
|
|
6349
|
+
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
6350
|
+
* `supported_features`. Gates the Open Door button in the UI. */
|
|
6351
|
+
DeviceFeature["LockOpen"] = "lock-open";
|
|
6352
|
+
/** Media player exposes a seek-to-position surface. */
|
|
6353
|
+
DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
|
|
6354
|
+
/** Media player exposes a volume-level setter. */
|
|
6355
|
+
DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
|
|
6356
|
+
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
6357
|
+
DeviceFeature["MediaPlayerMute"] = "media-player-mute";
|
|
6358
|
+
/** Media player exposes a shuffle toggle. */
|
|
6359
|
+
DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
|
|
6360
|
+
/** Media player exposes a repeat mode (off / all / one). */
|
|
6361
|
+
DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
|
|
6362
|
+
/** Media player exposes a source / input selector. */
|
|
6363
|
+
DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
|
|
6364
|
+
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
6365
|
+
DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
|
|
6366
|
+
/** Media player exposes next-track. */
|
|
6367
|
+
DeviceFeature["MediaPlayerNext"] = "media-player-next";
|
|
6368
|
+
/** Media player exposes previous-track. */
|
|
6369
|
+
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
6370
|
+
/** Media player exposes stop distinct from pause. */
|
|
6371
|
+
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
6372
|
+
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
6373
|
+
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
6374
|
+
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
6375
|
+
* addition to a textual location. */
|
|
6376
|
+
DeviceFeature["PresenceGps"] = "presence-gps";
|
|
6377
|
+
/** Notifier accepts an inline / URL image attachment. */
|
|
6378
|
+
DeviceFeature["NotifierImage"] = "notifier-image";
|
|
6379
|
+
/** Notifier accepts a priority hint (high/normal/low). */
|
|
6380
|
+
DeviceFeature["NotifierPriority"] = "notifier-priority";
|
|
6381
|
+
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
6382
|
+
* fields. */
|
|
6383
|
+
DeviceFeature["NotifierData"] = "notifier-data";
|
|
6384
|
+
/** Notifier supports interactive action buttons / callbacks. */
|
|
6385
|
+
DeviceFeature["NotifierActions"] = "notifier-actions";
|
|
6386
|
+
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
6387
|
+
DeviceFeature["NotifierRecipients"] = "notifier-recipients";
|
|
6388
|
+
/** Script runner accepts a variables map on each run invocation. */
|
|
6389
|
+
DeviceFeature["ScriptVariables"] = "script-variables";
|
|
6390
|
+
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
6391
|
+
* automation's actions while bypassing its condition block. */
|
|
6392
|
+
DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
|
|
6393
|
+
return DeviceFeature;
|
|
6394
|
+
}({});
|
|
6395
|
+
/**
|
|
6396
|
+
* Semantic role a device plays within its parent. Populated by driver
|
|
6397
|
+
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
6398
|
+
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
6399
|
+
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
6400
|
+
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
6401
|
+
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
6402
|
+
*
|
|
6403
|
+
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
6404
|
+
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
6405
|
+
*/
|
|
6406
|
+
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
6407
|
+
DeviceRole["Siren"] = "siren";
|
|
6408
|
+
DeviceRole["Floodlight"] = "floodlight";
|
|
6409
|
+
DeviceRole["Spotlight"] = "spotlight";
|
|
6410
|
+
DeviceRole["PirSensor"] = "pir-sensor";
|
|
6411
|
+
DeviceRole["Chime"] = "chime";
|
|
6412
|
+
DeviceRole["Autotrack"] = "autotrack";
|
|
6413
|
+
DeviceRole["Nightvision"] = "nightvision";
|
|
6414
|
+
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
6415
|
+
DeviceRole["Doorbell"] = "doorbell";
|
|
6416
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
6417
|
+
* real Switch device for UI rendering / export adapters. */
|
|
6418
|
+
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
6419
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
6420
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
6421
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
6422
|
+
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
6423
|
+
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
6424
|
+
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
6425
|
+
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
6426
|
+
DeviceRole["COSensor"] = "co-sensor";
|
|
6427
|
+
DeviceRole["GasSensor"] = "gas-sensor";
|
|
6428
|
+
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
6429
|
+
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
6430
|
+
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
6431
|
+
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
6432
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
6433
|
+
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
6434
|
+
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
6435
|
+
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6436
|
+
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6437
|
+
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6438
|
+
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6439
|
+
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6440
|
+
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
6441
|
+
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
6442
|
+
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
6443
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
6444
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
6445
|
+
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
6446
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
6447
|
+
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
6448
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
6449
|
+
* `attributes.options`). */
|
|
6450
|
+
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
6451
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
6452
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
6453
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
6454
|
+
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
6455
|
+
/** Last-resort fallback when nothing else matches. */
|
|
6456
|
+
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
6457
|
+
DeviceRole["NumericControl"] = "numeric-control";
|
|
6458
|
+
DeviceRole["SelectControl"] = "select-control";
|
|
6459
|
+
DeviceRole["TextControl"] = "text-control";
|
|
6460
|
+
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
6461
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
6462
|
+
* rich features (image, priority, channel routing). */
|
|
6463
|
+
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
6464
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
6465
|
+
* `notify.discord_*`, etc.). */
|
|
6466
|
+
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
6467
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
6468
|
+
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
6469
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
6470
|
+
* pattern. */
|
|
6471
|
+
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
6472
|
+
return DeviceRole;
|
|
6473
|
+
}({});
|
|
6474
|
+
/**
|
|
6475
|
+
* Generic types for capability definitions.
|
|
6476
|
+
*
|
|
6477
|
+
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
6478
|
+
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
6479
|
+
*
|
|
6480
|
+
* Pattern:
|
|
6481
|
+
* 1. Define Zod schemas for data, methods, settings
|
|
6482
|
+
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
6483
|
+
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
6484
|
+
* 4. Addon implements IProvider
|
|
6485
|
+
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
6486
|
+
*/
|
|
6487
|
+
/**
|
|
6488
|
+
* Output schema shared by the contribution + live methods.
|
|
6489
|
+
*
|
|
6490
|
+
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
6491
|
+
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
6492
|
+
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
6493
|
+
* (using `z.unknown()` here collapses unrelated router branches to
|
|
6494
|
+
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
6495
|
+
*
|
|
6496
|
+
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
6497
|
+
* extensions the caller adds (showWhen, displayScale, …) without
|
|
6498
|
+
* rebuilding every time a new field kind is introduced.
|
|
6499
|
+
*/
|
|
6500
|
+
var ContributionSectionSchema = object({
|
|
6501
|
+
id: string(),
|
|
6502
|
+
title: string(),
|
|
6503
|
+
description: string().optional(),
|
|
6504
|
+
style: _enum(["card", "accordion"]).optional(),
|
|
6505
|
+
defaultCollapsed: boolean().optional(),
|
|
6506
|
+
columns: union([
|
|
6507
|
+
literal(1),
|
|
6508
|
+
literal(2),
|
|
6509
|
+
literal(3),
|
|
6510
|
+
literal(4)
|
|
6511
|
+
]).optional(),
|
|
6512
|
+
tab: string().optional(),
|
|
6513
|
+
location: _enum(["settings", "top-tab"]).optional(),
|
|
6514
|
+
order: number().optional(),
|
|
6515
|
+
fields: array(any())
|
|
6516
|
+
});
|
|
6517
|
+
object({
|
|
6518
|
+
tabs: array(object({
|
|
6519
|
+
id: string(),
|
|
6520
|
+
label: string(),
|
|
6521
|
+
icon: string(),
|
|
6522
|
+
order: number().optional()
|
|
6523
|
+
})).optional(),
|
|
6524
|
+
sections: array(ContributionSectionSchema)
|
|
6525
|
+
}).nullable();
|
|
6526
|
+
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
6527
|
+
deviceId: number(),
|
|
6528
|
+
patch: record(string(), unknown())
|
|
6529
|
+
}), object({ success: literal(true) });
|
|
6530
|
+
object({ deviceId: number() }), unknown().nullable();
|
|
6531
|
+
/** Shorthand to define a method schema */
|
|
6532
|
+
function method(input, output, options) {
|
|
6533
|
+
return {
|
|
6534
|
+
input,
|
|
6535
|
+
output,
|
|
6536
|
+
kind: options?.kind ?? "query",
|
|
6537
|
+
auth: options?.auth ?? "protected",
|
|
6538
|
+
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6539
|
+
timeoutMs: options?.timeoutMs
|
|
6540
|
+
};
|
|
6541
|
+
}
|
|
6542
|
+
/** Shorthand to define an event schema */
|
|
6543
|
+
function event(data) {
|
|
6544
|
+
return { data };
|
|
6545
|
+
}
|
|
6546
|
+
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
6547
|
+
var VersionOutputSchema = object({ version: string() });
|
|
6548
|
+
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
6549
|
+
/**
|
|
6550
|
+
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
6551
|
+
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
6552
|
+
*
|
|
6553
|
+
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
6554
|
+
* provider for this cap (per device) backed by its local
|
|
6555
|
+
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
6556
|
+
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
6557
|
+
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
6558
|
+
* so there's no parallel bridge path anymore.
|
|
6559
|
+
*
|
|
6560
|
+
* The surface is intentionally small — every method corresponds to a
|
|
6561
|
+
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
6562
|
+
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
6563
|
+
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
6564
|
+
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
6565
|
+
*/
|
|
6566
|
+
var StreamSourceEntrySchema = object({
|
|
6567
|
+
id: string(),
|
|
6568
|
+
label: string(),
|
|
6569
|
+
protocol: _enum([
|
|
6570
|
+
"rtsp",
|
|
6571
|
+
"rtmp",
|
|
6572
|
+
"annexb",
|
|
6573
|
+
"http-mjpeg",
|
|
6574
|
+
"webrtc",
|
|
6575
|
+
"custom"
|
|
6576
|
+
]),
|
|
6577
|
+
url: string().optional(),
|
|
6578
|
+
resolution: object({
|
|
6579
|
+
width: number(),
|
|
6580
|
+
height: number()
|
|
6581
|
+
}).optional(),
|
|
6582
|
+
fps: number().optional(),
|
|
6583
|
+
bitrate: number().optional(),
|
|
6584
|
+
codec: string().optional(),
|
|
6585
|
+
profileHint: CamProfileSchema.optional(),
|
|
6586
|
+
sdp: string().optional()
|
|
6587
|
+
});
|
|
6588
|
+
var ConfigEntrySchema$1 = object({
|
|
6589
|
+
key: string(),
|
|
6590
|
+
value: unknown()
|
|
6591
|
+
});
|
|
6592
|
+
var RawStateResultSchema = object({
|
|
6593
|
+
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
6594
|
+
source: string(),
|
|
6595
|
+
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
6596
|
+
data: record(string(), unknown())
|
|
6597
|
+
});
|
|
6598
|
+
method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
6599
|
+
deviceId: number(),
|
|
6600
|
+
values: record(string(), unknown())
|
|
6601
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
6602
|
+
deviceId: number(),
|
|
6603
|
+
action: string().min(1),
|
|
6604
|
+
input: unknown()
|
|
6605
|
+
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
6606
|
+
/**
|
|
6607
|
+
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
6608
|
+
* wait, back off, or schedule a retry. Before these helpers landed, each
|
|
6609
|
+
* call site re-implemented `new Promise(r => setTimeout(r, ms))` inline,
|
|
6610
|
+
* with subtle variations (some swallowing cancellation, some not). Two
|
|
6611
|
+
* shapes cover every observed use case:
|
|
6612
|
+
*
|
|
6613
|
+
* - {@link sleep} for a plain, uncancellable wait — the default choice.
|
|
6614
|
+
* - {@link sleepCancellable} for a wait that wakes early when an
|
|
6615
|
+
* abort signal trips, used by long-running pollers whose teardown
|
|
6616
|
+
* must stop a pending backoff promptly.
|
|
6617
|
+
*/
|
|
6618
|
+
/**
|
|
6619
|
+
* Resolve after `ms` milliseconds. Never rejects, never cancels. The
|
|
6620
|
+
* sleep cannot be interrupted; for a wakeable variant use
|
|
6621
|
+
* {@link sleepCancellable}.
|
|
6622
|
+
*
|
|
6623
|
+
* `ms <= 0` resolves on the next microtask via `setTimeout(0)`, which
|
|
6624
|
+
* still gives the event loop a chance to drain — useful for breaking
|
|
6625
|
+
* up tight async loops without changing call-site semantics.
|
|
6626
|
+
*/
|
|
6627
|
+
function sleep$1(ms) {
|
|
6628
|
+
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
6629
|
+
}
|
|
6630
|
+
//#endregion
|
|
6631
|
+
//#region ../types/dist/index.mjs
|
|
6632
|
+
/**
|
|
6633
|
+
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
6634
|
+
* every declared capability + widget of every installed plugin, on every
|
|
6635
|
+
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
6636
|
+
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
6637
|
+
*
|
|
6638
|
+
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
6639
|
+
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
6640
|
+
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
6641
|
+
*/
|
|
6642
|
+
/** What kind of target a probe addressed. */
|
|
6643
|
+
var wiringProbeKindSchema = _enum([
|
|
6644
|
+
"singleton",
|
|
6645
|
+
"device",
|
|
6646
|
+
"widget"
|
|
6647
|
+
]);
|
|
6648
|
+
/** Result of probing a single (cap|widget [, device]) target. */
|
|
6649
|
+
var wiringProbeResultSchema = object({
|
|
6650
|
+
capName: string(),
|
|
6651
|
+
kind: wiringProbeKindSchema,
|
|
6652
|
+
deviceId: number().optional(),
|
|
6653
|
+
reachable: boolean(),
|
|
6654
|
+
latencyMs: number(),
|
|
6655
|
+
error: string().optional()
|
|
6656
|
+
});
|
|
6657
|
+
/** Per-addon roll-up of cap + widget probe results. */
|
|
6658
|
+
var wiringAddonHealthSchema = object({
|
|
6659
|
+
addonId: string(),
|
|
6660
|
+
caps: array(wiringProbeResultSchema).readonly(),
|
|
6661
|
+
widgets: array(wiringProbeResultSchema).readonly()
|
|
6662
|
+
});
|
|
6663
|
+
/** Per-node roll-up. */
|
|
6664
|
+
var wiringNodeHealthSchema = object({
|
|
6665
|
+
nodeId: string(),
|
|
6666
|
+
addons: array(wiringAddonHealthSchema).readonly()
|
|
6667
|
+
});
|
|
6668
|
+
object({
|
|
6669
|
+
/** True only when every probed target is reachable. */
|
|
6670
|
+
ok: boolean(),
|
|
6671
|
+
/** True when at least one target is unreachable. */
|
|
6672
|
+
degraded: boolean(),
|
|
6673
|
+
checkedAt: string(),
|
|
6674
|
+
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
6675
|
+
summary: object({
|
|
6676
|
+
total: number(),
|
|
6677
|
+
reachable: number(),
|
|
6678
|
+
unreachable: number()
|
|
6679
|
+
})
|
|
6680
|
+
});
|
|
6681
|
+
var MODEL_FORMATS = [
|
|
6682
|
+
"onnx",
|
|
6683
|
+
"coreml",
|
|
6684
|
+
"openvino",
|
|
6685
|
+
"tflite",
|
|
6686
|
+
"pt"
|
|
6687
|
+
];
|
|
6688
|
+
var EU_DST = {
|
|
6689
|
+
offsetHours: 1,
|
|
6690
|
+
startMonth: 3,
|
|
6691
|
+
startWeekIndex: 5,
|
|
6692
|
+
startWeekday: "Sunday",
|
|
6693
|
+
startHour: 2,
|
|
6694
|
+
endMonth: 10,
|
|
6695
|
+
endWeekIndex: 5,
|
|
6696
|
+
endWeekday: "Sunday",
|
|
6697
|
+
endHour: 3
|
|
6698
|
+
};
|
|
6699
|
+
var US_DST = {
|
|
6700
|
+
offsetHours: 1,
|
|
6701
|
+
startMonth: 3,
|
|
6702
|
+
startWeekIndex: 2,
|
|
6703
|
+
startWeekday: "Sunday",
|
|
6704
|
+
startHour: 2,
|
|
6705
|
+
endMonth: 11,
|
|
6706
|
+
endWeekIndex: 1,
|
|
6707
|
+
endWeekday: "Sunday",
|
|
6708
|
+
endHour: 2
|
|
6709
|
+
};
|
|
6710
|
+
/**
|
|
6711
|
+
* Curated catalogue of common world zones, grouped by region. Not
|
|
6712
|
+
* exhaustive — covers the everyday zones an operator is likely to pick.
|
|
6713
|
+
*/
|
|
6714
|
+
var TIMEZONES = [
|
|
6715
|
+
{
|
|
6716
|
+
id: "UTC",
|
|
6717
|
+
label: "UTC (UTC+0)",
|
|
6718
|
+
region: "Universal",
|
|
6719
|
+
stdOffsetMinutes: 0,
|
|
6720
|
+
dst: null
|
|
6721
|
+
},
|
|
6722
|
+
{
|
|
6723
|
+
id: "Europe/London",
|
|
6724
|
+
label: "Europe/London (UTC+0 / BST)",
|
|
6725
|
+
region: "Europe",
|
|
6726
|
+
stdOffsetMinutes: 0,
|
|
6727
|
+
dst: EU_DST
|
|
6728
|
+
},
|
|
6729
|
+
{
|
|
6730
|
+
id: "Europe/Rome",
|
|
6731
|
+
label: "Europe/Rome (UTC+1 / CEST)",
|
|
6732
|
+
region: "Europe",
|
|
6733
|
+
stdOffsetMinutes: 60,
|
|
6734
|
+
dst: EU_DST
|
|
6735
|
+
},
|
|
6736
|
+
{
|
|
6737
|
+
id: "Europe/Paris",
|
|
6738
|
+
label: "Europe/Paris (UTC+1 / CEST)",
|
|
6739
|
+
region: "Europe",
|
|
6740
|
+
stdOffsetMinutes: 60,
|
|
6741
|
+
dst: EU_DST
|
|
6742
|
+
},
|
|
6743
|
+
{
|
|
6744
|
+
id: "Europe/Berlin",
|
|
6745
|
+
label: "Europe/Berlin (UTC+1 / CEST)",
|
|
6746
|
+
region: "Europe",
|
|
6747
|
+
stdOffsetMinutes: 60,
|
|
6748
|
+
dst: EU_DST
|
|
6749
|
+
},
|
|
6750
|
+
{
|
|
6751
|
+
id: "Europe/Madrid",
|
|
6752
|
+
label: "Europe/Madrid (UTC+1 / CEST)",
|
|
6753
|
+
region: "Europe",
|
|
6754
|
+
stdOffsetMinutes: 60,
|
|
6755
|
+
dst: EU_DST
|
|
6756
|
+
},
|
|
6757
|
+
{
|
|
6758
|
+
id: "Europe/Amsterdam",
|
|
6759
|
+
label: "Europe/Amsterdam (UTC+1 / CEST)",
|
|
6760
|
+
region: "Europe",
|
|
6761
|
+
stdOffsetMinutes: 60,
|
|
6762
|
+
dst: EU_DST
|
|
6763
|
+
},
|
|
6764
|
+
{
|
|
6765
|
+
id: "Europe/Istanbul",
|
|
6766
|
+
label: "Europe/Istanbul (UTC+3)",
|
|
6767
|
+
region: "Europe",
|
|
6768
|
+
stdOffsetMinutes: 180,
|
|
6769
|
+
dst: null
|
|
6770
|
+
},
|
|
6771
|
+
{
|
|
6772
|
+
id: "America/New_York",
|
|
6773
|
+
label: "America/New York (UTC−5 / EDT)",
|
|
6774
|
+
region: "Americas",
|
|
6775
|
+
stdOffsetMinutes: -300,
|
|
6776
|
+
dst: US_DST
|
|
6777
|
+
},
|
|
6778
|
+
{
|
|
6779
|
+
id: "America/Chicago",
|
|
6780
|
+
label: "America/Chicago (UTC−6 / CDT)",
|
|
6781
|
+
region: "Americas",
|
|
6782
|
+
stdOffsetMinutes: -360,
|
|
6783
|
+
dst: US_DST
|
|
6784
|
+
},
|
|
6785
|
+
{
|
|
6786
|
+
id: "America/Denver",
|
|
6787
|
+
label: "America/Denver (UTC−7 / MDT)",
|
|
6788
|
+
region: "Americas",
|
|
6789
|
+
stdOffsetMinutes: -420,
|
|
6790
|
+
dst: US_DST
|
|
6791
|
+
},
|
|
6792
|
+
{
|
|
6793
|
+
id: "America/Los_Angeles",
|
|
6794
|
+
label: "America/Los Angeles (UTC−8 / PDT)",
|
|
6795
|
+
region: "Americas",
|
|
6796
|
+
stdOffsetMinutes: -480,
|
|
6797
|
+
dst: US_DST
|
|
6798
|
+
},
|
|
6799
|
+
{
|
|
6800
|
+
id: "America/Sao_Paulo",
|
|
6801
|
+
label: "America/Sao Paulo (UTC−3)",
|
|
6802
|
+
region: "Americas",
|
|
6803
|
+
stdOffsetMinutes: -180,
|
|
6804
|
+
dst: null
|
|
6805
|
+
},
|
|
6806
|
+
{
|
|
6807
|
+
id: "Asia/Dubai",
|
|
6808
|
+
label: "Asia/Dubai (UTC+4)",
|
|
6809
|
+
region: "Asia",
|
|
6810
|
+
stdOffsetMinutes: 240,
|
|
6811
|
+
dst: null
|
|
6812
|
+
},
|
|
6813
|
+
{
|
|
6814
|
+
id: "Asia/Kolkata",
|
|
6815
|
+
label: "Asia/Kolkata (UTC+5:30)",
|
|
6816
|
+
region: "Asia",
|
|
6817
|
+
stdOffsetMinutes: 330,
|
|
6818
|
+
dst: null
|
|
6819
|
+
},
|
|
6820
|
+
{
|
|
6821
|
+
id: "Asia/Singapore",
|
|
6822
|
+
label: "Asia/Singapore (UTC+8)",
|
|
6823
|
+
region: "Asia",
|
|
6824
|
+
stdOffsetMinutes: 480,
|
|
6825
|
+
dst: null
|
|
6826
|
+
},
|
|
6827
|
+
{
|
|
6828
|
+
id: "Asia/Shanghai",
|
|
6829
|
+
label: "Asia/Shanghai (UTC+8)",
|
|
6830
|
+
region: "Asia",
|
|
6831
|
+
stdOffsetMinutes: 480,
|
|
6832
|
+
dst: null
|
|
6833
|
+
},
|
|
6834
|
+
{
|
|
6835
|
+
id: "Asia/Tokyo",
|
|
6836
|
+
label: "Asia/Tokyo (UTC+9)",
|
|
6837
|
+
region: "Asia",
|
|
6838
|
+
stdOffsetMinutes: 540,
|
|
6839
|
+
dst: null
|
|
6840
|
+
},
|
|
6841
|
+
{
|
|
6842
|
+
id: "Australia/Sydney",
|
|
6843
|
+
label: "Australia/Sydney (UTC+10 / AEDT)",
|
|
6844
|
+
region: "Oceania",
|
|
6845
|
+
stdOffsetMinutes: 600,
|
|
6846
|
+
dst: {
|
|
6847
|
+
offsetHours: 1,
|
|
6848
|
+
startMonth: 10,
|
|
6849
|
+
startWeekIndex: 1,
|
|
6850
|
+
startWeekday: "Sunday",
|
|
6851
|
+
startHour: 2,
|
|
6852
|
+
endMonth: 4,
|
|
6853
|
+
endWeekIndex: 1,
|
|
6854
|
+
endWeekday: "Sunday",
|
|
6855
|
+
endHour: 3
|
|
6856
|
+
}
|
|
6857
|
+
}
|
|
6858
|
+
];
|
|
6859
|
+
/** Resolve an IANA id to its `Timezone`, or `undefined` if unknown. */
|
|
6860
|
+
function findTimezone(id) {
|
|
6861
|
+
return TIMEZONES.find((tz) => tz.id === id);
|
|
6862
|
+
}
|
|
6429
6863
|
/**
|
|
6430
6864
|
* Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
|
|
6431
6865
|
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
@@ -7038,282 +7472,6 @@ var APPLE_SA_TO_MACRO = {
|
|
|
7038
7472
|
var _macroLookup = /* @__PURE__ */ new Map();
|
|
7039
7473
|
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7040
7474
|
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7041
|
-
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
7042
|
-
DeviceType["Camera"] = "camera";
|
|
7043
|
-
DeviceType["Hub"] = "hub";
|
|
7044
|
-
DeviceType["Light"] = "light";
|
|
7045
|
-
DeviceType["Siren"] = "siren";
|
|
7046
|
-
DeviceType["Switch"] = "switch";
|
|
7047
|
-
DeviceType["Sensor"] = "sensor";
|
|
7048
|
-
DeviceType["Thermostat"] = "thermostat";
|
|
7049
|
-
DeviceType["Button"] = "button";
|
|
7050
|
-
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
7051
|
-
* event vocabulary verbatim (no normalization). Installed with the
|
|
7052
|
-
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
7053
|
-
* HA bus events (e.g. `zha_event`, generic). */
|
|
7054
|
-
DeviceType["EventEmitter"] = "event-emitter";
|
|
7055
|
-
/** Firmware/software update entity — current vs available version,
|
|
7056
|
-
* updatable flag, update state, and an install action. Installed with
|
|
7057
|
-
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
7058
|
-
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
7059
|
-
DeviceType["Update"] = "update";
|
|
7060
|
-
DeviceType["Generic"] = "generic";
|
|
7061
|
-
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
7062
|
-
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
7063
|
-
* endpoint; the `notifier` cap defines the send surface. */
|
|
7064
|
-
DeviceType["Notifier"] = "notifier";
|
|
7065
|
-
/** Pre-recorded action sequence with optional parameters
|
|
7066
|
-
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
7067
|
-
DeviceType["Script"] = "script";
|
|
7068
|
-
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
7069
|
-
* trigger surface exposed via `automation-control` cap. */
|
|
7070
|
-
DeviceType["Automation"] = "automation";
|
|
7071
|
-
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
7072
|
-
DeviceType["Lock"] = "lock";
|
|
7073
|
-
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
7074
|
-
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
7075
|
-
DeviceType["Cover"] = "cover";
|
|
7076
|
-
/** Pipe / water / gas valve with open/close/stop and optional
|
|
7077
|
-
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
7078
|
-
* modelled on the same open/closed lifecycle. */
|
|
7079
|
-
DeviceType["Valve"] = "valve";
|
|
7080
|
-
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
7081
|
-
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
7082
|
-
* modelled on the same target / mode lifecycle. */
|
|
7083
|
-
DeviceType["Humidifier"] = "humidifier";
|
|
7084
|
-
/** Water heater / boiler with target temperature + operation mode +
|
|
7085
|
-
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
7086
|
-
* climate-family actuator. */
|
|
7087
|
-
DeviceType["WaterHeater"] = "water-heater";
|
|
7088
|
-
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
7089
|
-
DeviceType["Fan"] = "fan";
|
|
7090
|
-
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
7091
|
-
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
7092
|
-
DeviceType["MediaPlayer"] = "media-player";
|
|
7093
|
-
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
7094
|
-
* `alarm-panel` cap. */
|
|
7095
|
-
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
7096
|
-
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
7097
|
-
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
7098
|
-
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
7099
|
-
* TextControl / DateTimeControl. */
|
|
7100
|
-
DeviceType["Control"] = "control";
|
|
7101
|
-
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
7102
|
-
* `presence` cap. */
|
|
7103
|
-
DeviceType["Presence"] = "presence";
|
|
7104
|
-
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
7105
|
-
* `weather` cap. */
|
|
7106
|
-
DeviceType["Weather"] = "weather";
|
|
7107
|
-
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
7108
|
-
DeviceType["Vacuum"] = "vacuum";
|
|
7109
|
-
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
7110
|
-
* `lawn-mower-control` cap. */
|
|
7111
|
-
DeviceType["LawnMower"] = "lawn-mower";
|
|
7112
|
-
/** Physical HA device group — parent container for entity-children
|
|
7113
|
-
* adopted from a single HA device entry. Not renderable as a
|
|
7114
|
-
* standalone device; exists only to anchor child entities. */
|
|
7115
|
-
DeviceType["Container"] = "container";
|
|
7116
|
-
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
7117
|
-
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
7118
|
-
DeviceType["Image"] = "image";
|
|
7119
|
-
return DeviceType;
|
|
7120
|
-
}({});
|
|
7121
|
-
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
7122
|
-
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
7123
|
-
DeviceFeature["Rebootable"] = "rebootable";
|
|
7124
|
-
/**
|
|
7125
|
-
* Device supports an on-demand re-sync of its derived spec with its
|
|
7126
|
-
* upstream source — drives the generic Re-sync button. The owning
|
|
7127
|
-
* provider implements the action via the `device-adoption.resync` cap.
|
|
7128
|
-
*/
|
|
7129
|
-
DeviceFeature["Resyncable"] = "resyncable";
|
|
7130
|
-
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
7131
|
-
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
7132
|
-
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
7133
|
-
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
7134
|
-
/**
|
|
7135
|
-
* Camera supports the on-firmware autotrack subsystem (subject-
|
|
7136
|
-
* following). Distinct from `PanTiltZoom` because not every PTZ
|
|
7137
|
-
* camera ships autotrack — the admin UI uses this flag to gate
|
|
7138
|
-
* the autotrack toggle / settings card without re-deriving from
|
|
7139
|
-
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
7140
|
-
* driver sets this feature when probe confirms the firmware
|
|
7141
|
-
* surface, and registers the cap in the same code path.
|
|
7142
|
-
*/
|
|
7143
|
-
DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
|
|
7144
|
-
/**
|
|
7145
|
-
* Accessory exposes a "trigger on motion" toggle — the parent camera's
|
|
7146
|
-
* motion detection automatically activates this device. Mirrors
|
|
7147
|
-
* `motion-trigger` cap registration: drivers set this feature in the
|
|
7148
|
-
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
7149
|
-
*
|
|
7150
|
-
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
7151
|
-
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
7152
|
-
* filters that want "all devices with on-motion behaviour".
|
|
7153
|
-
*/
|
|
7154
|
-
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
7155
|
-
/** Light supports rgb-triplet color via `color` cap. */
|
|
7156
|
-
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
7157
|
-
/** Light supports HSV color via `color` cap. */
|
|
7158
|
-
DeviceFeature["LightColorHsv"] = "light-color-hsv";
|
|
7159
|
-
/** Light supports color-temperature (mired) via `color` cap. */
|
|
7160
|
-
DeviceFeature["LightColorMired"] = "light-color-mired";
|
|
7161
|
-
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
7162
|
-
* targetHigh). Gates the range slider UI. */
|
|
7163
|
-
DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
|
|
7164
|
-
/** Thermostat exposes target humidity and/or current humidity
|
|
7165
|
-
* readings. Gates the humidity controls. */
|
|
7166
|
-
DeviceFeature["ClimateHumidity"] = "climate-humidity";
|
|
7167
|
-
/** Thermostat exposes a fan-mode selector. */
|
|
7168
|
-
DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
|
|
7169
|
-
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
7170
|
-
DeviceFeature["ClimatePreset"] = "climate-preset";
|
|
7171
|
-
/** Cover exposes intermediate position control (0..100). Gates the
|
|
7172
|
-
* position slider UI. */
|
|
7173
|
-
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
7174
|
-
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
7175
|
-
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
7176
|
-
/** Valve exposes intermediate position control (0..100). Gates the
|
|
7177
|
-
* position slider / drag surface UI. */
|
|
7178
|
-
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
7179
|
-
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
7180
|
-
DeviceFeature["FanSpeed"] = "fan-speed";
|
|
7181
|
-
/** Fan exposes a preset mode selector. */
|
|
7182
|
-
DeviceFeature["FanPreset"] = "fan-preset";
|
|
7183
|
-
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
7184
|
-
* ceiling fans. */
|
|
7185
|
-
DeviceFeature["FanDirection"] = "fan-direction";
|
|
7186
|
-
/** Fan exposes an oscillation toggle. */
|
|
7187
|
-
DeviceFeature["FanOscillating"] = "fan-oscillating";
|
|
7188
|
-
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
7189
|
-
* field on the UI lock-controls panel. */
|
|
7190
|
-
DeviceFeature["LockPinRequired"] = "lock-pin-required";
|
|
7191
|
-
/** Lock supports a latch-release ("open door") action distinct from
|
|
7192
|
-
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
7193
|
-
* `supported_features`. Gates the Open Door button in the UI. */
|
|
7194
|
-
DeviceFeature["LockOpen"] = "lock-open";
|
|
7195
|
-
/** Media player exposes a seek-to-position surface. */
|
|
7196
|
-
DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
|
|
7197
|
-
/** Media player exposes a volume-level setter. */
|
|
7198
|
-
DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
|
|
7199
|
-
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
7200
|
-
DeviceFeature["MediaPlayerMute"] = "media-player-mute";
|
|
7201
|
-
/** Media player exposes a shuffle toggle. */
|
|
7202
|
-
DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
|
|
7203
|
-
/** Media player exposes a repeat mode (off / all / one). */
|
|
7204
|
-
DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
|
|
7205
|
-
/** Media player exposes a source / input selector. */
|
|
7206
|
-
DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
|
|
7207
|
-
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
7208
|
-
DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
|
|
7209
|
-
/** Media player exposes next-track. */
|
|
7210
|
-
DeviceFeature["MediaPlayerNext"] = "media-player-next";
|
|
7211
|
-
/** Media player exposes previous-track. */
|
|
7212
|
-
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
7213
|
-
/** Media player exposes stop distinct from pause. */
|
|
7214
|
-
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
7215
|
-
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
7216
|
-
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
7217
|
-
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
7218
|
-
* addition to a textual location. */
|
|
7219
|
-
DeviceFeature["PresenceGps"] = "presence-gps";
|
|
7220
|
-
/** Notifier accepts an inline / URL image attachment. */
|
|
7221
|
-
DeviceFeature["NotifierImage"] = "notifier-image";
|
|
7222
|
-
/** Notifier accepts a priority hint (high/normal/low). */
|
|
7223
|
-
DeviceFeature["NotifierPriority"] = "notifier-priority";
|
|
7224
|
-
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
7225
|
-
* fields. */
|
|
7226
|
-
DeviceFeature["NotifierData"] = "notifier-data";
|
|
7227
|
-
/** Notifier supports interactive action buttons / callbacks. */
|
|
7228
|
-
DeviceFeature["NotifierActions"] = "notifier-actions";
|
|
7229
|
-
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
7230
|
-
DeviceFeature["NotifierRecipients"] = "notifier-recipients";
|
|
7231
|
-
/** Script runner accepts a variables map on each run invocation. */
|
|
7232
|
-
DeviceFeature["ScriptVariables"] = "script-variables";
|
|
7233
|
-
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
7234
|
-
* automation's actions while bypassing its condition block. */
|
|
7235
|
-
DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
|
|
7236
|
-
return DeviceFeature;
|
|
7237
|
-
}({});
|
|
7238
|
-
/**
|
|
7239
|
-
* Semantic role a device plays within its parent. Populated by driver
|
|
7240
|
-
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
7241
|
-
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
7242
|
-
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
7243
|
-
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
7244
|
-
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
7245
|
-
*
|
|
7246
|
-
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
7247
|
-
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
7248
|
-
*/
|
|
7249
|
-
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
7250
|
-
DeviceRole["Siren"] = "siren";
|
|
7251
|
-
DeviceRole["Floodlight"] = "floodlight";
|
|
7252
|
-
DeviceRole["Spotlight"] = "spotlight";
|
|
7253
|
-
DeviceRole["PirSensor"] = "pir-sensor";
|
|
7254
|
-
DeviceRole["Chime"] = "chime";
|
|
7255
|
-
DeviceRole["Autotrack"] = "autotrack";
|
|
7256
|
-
DeviceRole["Nightvision"] = "nightvision";
|
|
7257
|
-
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
7258
|
-
DeviceRole["Doorbell"] = "doorbell";
|
|
7259
|
-
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
7260
|
-
* real Switch device for UI rendering / export adapters. */
|
|
7261
|
-
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
7262
|
-
/** Generic motion / occupancy / moving event source. Distinct from
|
|
7263
|
-
* the camera accessory PirSensor role: that one is a camera child;
|
|
7264
|
-
* this is a standalone HA / 3rd-party motion sensor. */
|
|
7265
|
-
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
7266
|
-
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
7267
|
-
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
7268
|
-
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
7269
|
-
DeviceRole["COSensor"] = "co-sensor";
|
|
7270
|
-
DeviceRole["GasSensor"] = "gas-sensor";
|
|
7271
|
-
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
7272
|
-
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
7273
|
-
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
7274
|
-
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
7275
|
-
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
7276
|
-
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
7277
|
-
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
7278
|
-
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
7279
|
-
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
7280
|
-
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
7281
|
-
DeviceRole["PowerSensor"] = "power-sensor";
|
|
7282
|
-
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
7283
|
-
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
7284
|
-
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
7285
|
-
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
7286
|
-
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
7287
|
-
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
7288
|
-
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
7289
|
-
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
7290
|
-
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
7291
|
-
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
7292
|
-
* `attributes.options`). */
|
|
7293
|
-
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
7294
|
-
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
7295
|
-
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
7296
|
-
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
7297
|
-
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
7298
|
-
/** Last-resort fallback when nothing else matches. */
|
|
7299
|
-
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
7300
|
-
DeviceRole["NumericControl"] = "numeric-control";
|
|
7301
|
-
DeviceRole["SelectControl"] = "select-control";
|
|
7302
|
-
DeviceRole["TextControl"] = "text-control";
|
|
7303
|
-
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
7304
|
-
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
7305
|
-
* rich features (image, priority, channel routing). */
|
|
7306
|
-
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
7307
|
-
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
7308
|
-
* `notify.discord_*`, etc.). */
|
|
7309
|
-
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
7310
|
-
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
7311
|
-
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
7312
|
-
/** Fallback when the notifier service name doesn't match a known
|
|
7313
|
-
* pattern. */
|
|
7314
|
-
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
7315
|
-
return DeviceRole;
|
|
7316
|
-
}({});
|
|
7317
7475
|
/**
|
|
7318
7476
|
* Accessory device helpers — shared across drivers.
|
|
7319
7477
|
*
|
|
@@ -7806,78 +7964,6 @@ var airQualitySensorCapability = {
|
|
|
7806
7964
|
runtimeState: AirQualitySensorStatusSchema
|
|
7807
7965
|
};
|
|
7808
7966
|
/**
|
|
7809
|
-
* Generic types for capability definitions.
|
|
7810
|
-
*
|
|
7811
|
-
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
7812
|
-
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
7813
|
-
*
|
|
7814
|
-
* Pattern:
|
|
7815
|
-
* 1. Define Zod schemas for data, methods, settings
|
|
7816
|
-
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
7817
|
-
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
7818
|
-
* 4. Addon implements IProvider
|
|
7819
|
-
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
7820
|
-
*/
|
|
7821
|
-
/**
|
|
7822
|
-
* Output schema shared by the contribution + live methods.
|
|
7823
|
-
*
|
|
7824
|
-
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
7825
|
-
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
7826
|
-
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
7827
|
-
* (using `z.unknown()` here collapses unrelated router branches to
|
|
7828
|
-
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
7829
|
-
*
|
|
7830
|
-
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
7831
|
-
* extensions the caller adds (showWhen, displayScale, …) without
|
|
7832
|
-
* rebuilding every time a new field kind is introduced.
|
|
7833
|
-
*/
|
|
7834
|
-
var ContributionSectionSchema = object({
|
|
7835
|
-
id: string(),
|
|
7836
|
-
title: string(),
|
|
7837
|
-
description: string().optional(),
|
|
7838
|
-
style: _enum(["card", "accordion"]).optional(),
|
|
7839
|
-
defaultCollapsed: boolean().optional(),
|
|
7840
|
-
columns: union([
|
|
7841
|
-
literal(1),
|
|
7842
|
-
literal(2),
|
|
7843
|
-
literal(3),
|
|
7844
|
-
literal(4)
|
|
7845
|
-
]).optional(),
|
|
7846
|
-
tab: string().optional(),
|
|
7847
|
-
location: _enum(["settings", "top-tab"]).optional(),
|
|
7848
|
-
order: number().optional(),
|
|
7849
|
-
fields: array(any())
|
|
7850
|
-
});
|
|
7851
|
-
object({
|
|
7852
|
-
tabs: array(object({
|
|
7853
|
-
id: string(),
|
|
7854
|
-
label: string(),
|
|
7855
|
-
icon: string(),
|
|
7856
|
-
order: number().optional()
|
|
7857
|
-
})).optional(),
|
|
7858
|
-
sections: array(ContributionSectionSchema)
|
|
7859
|
-
}).nullable();
|
|
7860
|
-
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
7861
|
-
deviceId: number(),
|
|
7862
|
-
patch: record(string(), unknown())
|
|
7863
|
-
}), object({ success: literal(true) });
|
|
7864
|
-
object({ deviceId: number() }), unknown().nullable();
|
|
7865
|
-
/** Shorthand to define a method schema */
|
|
7866
|
-
function method(input, output, options) {
|
|
7867
|
-
return {
|
|
7868
|
-
input,
|
|
7869
|
-
output,
|
|
7870
|
-
kind: options?.kind ?? "query",
|
|
7871
|
-
auth: options?.auth ?? "protected",
|
|
7872
|
-
...options?.access !== void 0 ? { access: options.access } : {},
|
|
7873
|
-
timeoutMs: options?.timeoutMs
|
|
7874
|
-
};
|
|
7875
|
-
}
|
|
7876
|
-
/** Shorthand to define an event schema */
|
|
7877
|
-
function event(data) {
|
|
7878
|
-
return { data };
|
|
7879
|
-
}
|
|
7880
|
-
/**
|
|
7881
7967
|
* Alarm-panel cap. Models HA `alarm_control_panel.*` on
|
|
7882
7968
|
* `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
|
|
7883
7969
|
* across disarmed / armed_(home|away|night|vacation|custom_bypass) /
|
|
@@ -14361,9 +14447,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
14361
14447
|
limit: number().optional(),
|
|
14362
14448
|
tags: record(string(), string()).optional()
|
|
14363
14449
|
}), array(LogEntrySchema).readonly());
|
|
14364
|
-
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
14365
|
-
var VersionOutputSchema = object({ version: string() });
|
|
14366
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
14367
14450
|
/**
|
|
14368
14451
|
* Zod schemas for persisted record types.
|
|
14369
14452
|
*
|
|
@@ -16664,7 +16747,7 @@ method(object({
|
|
|
16664
16747
|
}), _void(), {
|
|
16665
16748
|
kind: "mutation",
|
|
16666
16749
|
auth: "admin"
|
|
16667
|
-
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
16750
|
+
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
16668
16751
|
deviceId: number(),
|
|
16669
16752
|
values: record(string(), unknown())
|
|
16670
16753
|
}), object({ success: literal(true) }), {
|
|
@@ -17389,7 +17472,20 @@ var DiskSpaceInfoSchema = object({
|
|
|
17389
17472
|
var PidResourceStatsSchema = object({
|
|
17390
17473
|
pid: number(),
|
|
17391
17474
|
cpu: number(),
|
|
17392
|
-
memory: number()
|
|
17475
|
+
memory: number(),
|
|
17476
|
+
/**
|
|
17477
|
+
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
17478
|
+
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
17479
|
+
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
17480
|
+
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
17481
|
+
* Undefined where /proc is unavailable (e.g. macOS).
|
|
17482
|
+
*/
|
|
17483
|
+
privateBytes: number().optional(),
|
|
17484
|
+
/**
|
|
17485
|
+
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
17486
|
+
* code shared copy-on-write across runners. Undefined on macOS.
|
|
17487
|
+
*/
|
|
17488
|
+
sharedBytes: number().optional()
|
|
17393
17489
|
});
|
|
17394
17490
|
var AddonInstanceSchema = object({
|
|
17395
17491
|
addonId: string(),
|
|
@@ -17438,6 +17534,17 @@ var KillProcessResultSchema = object({
|
|
|
17438
17534
|
reason: string().optional(),
|
|
17439
17535
|
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
17440
17536
|
});
|
|
17537
|
+
var DumpHeapSnapshotInputSchema = object({
|
|
17538
|
+
/** The addon whose runner should dump a heap snapshot. */
|
|
17539
|
+
addonId: string() });
|
|
17540
|
+
var DumpHeapSnapshotResultSchema = object({
|
|
17541
|
+
success: boolean(),
|
|
17542
|
+
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
17543
|
+
path: string().optional(),
|
|
17544
|
+
/** Process pid that was signalled. */
|
|
17545
|
+
pid: number().optional(),
|
|
17546
|
+
reason: string().optional()
|
|
17547
|
+
});
|
|
17441
17548
|
var SystemMetricsSchema = object({
|
|
17442
17549
|
cpuPercent: number(),
|
|
17443
17550
|
memoryPercent: number(),
|
|
@@ -17451,6 +17558,9 @@ var SystemMetricsSchema = object({
|
|
|
17451
17558
|
method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
|
|
17452
17559
|
kind: "mutation",
|
|
17453
17560
|
auth: "admin"
|
|
17561
|
+
}), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
17562
|
+
kind: "mutation",
|
|
17563
|
+
auth: "admin"
|
|
17454
17564
|
});
|
|
17455
17565
|
var PtzPresetSchema = object({
|
|
17456
17566
|
id: string(),
|
|
@@ -17859,63 +17969,6 @@ method(object({
|
|
|
17859
17969
|
auth: "admin"
|
|
17860
17970
|
});
|
|
17861
17971
|
/**
|
|
17862
|
-
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
17863
|
-
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
17864
|
-
*
|
|
17865
|
-
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
17866
|
-
* provider for this cap (per device) backed by its local
|
|
17867
|
-
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
17868
|
-
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
17869
|
-
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
17870
|
-
* so there's no parallel bridge path anymore.
|
|
17871
|
-
*
|
|
17872
|
-
* The surface is intentionally small — every method corresponds to a
|
|
17873
|
-
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
17874
|
-
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
17875
|
-
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
17876
|
-
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
17877
|
-
*/
|
|
17878
|
-
var StreamSourceEntrySchema$1 = object({
|
|
17879
|
-
id: string(),
|
|
17880
|
-
label: string(),
|
|
17881
|
-
protocol: _enum([
|
|
17882
|
-
"rtsp",
|
|
17883
|
-
"rtmp",
|
|
17884
|
-
"annexb",
|
|
17885
|
-
"http-mjpeg",
|
|
17886
|
-
"webrtc",
|
|
17887
|
-
"custom"
|
|
17888
|
-
]),
|
|
17889
|
-
url: string().optional(),
|
|
17890
|
-
resolution: object({
|
|
17891
|
-
width: number(),
|
|
17892
|
-
height: number()
|
|
17893
|
-
}).optional(),
|
|
17894
|
-
fps: number().optional(),
|
|
17895
|
-
bitrate: number().optional(),
|
|
17896
|
-
codec: string().optional(),
|
|
17897
|
-
profileHint: CamProfileSchema.optional(),
|
|
17898
|
-
sdp: string().optional()
|
|
17899
|
-
});
|
|
17900
|
-
var ConfigEntrySchema$1 = object({
|
|
17901
|
-
key: string(),
|
|
17902
|
-
value: unknown()
|
|
17903
|
-
});
|
|
17904
|
-
var RawStateResultSchema = object({
|
|
17905
|
-
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
17906
|
-
source: string(),
|
|
17907
|
-
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
17908
|
-
data: record(string(), unknown())
|
|
17909
|
-
});
|
|
17910
|
-
method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
17911
|
-
deviceId: number(),
|
|
17912
|
-
values: record(string(), unknown())
|
|
17913
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
17914
|
-
deviceId: number(),
|
|
17915
|
-
action: string().min(1),
|
|
17916
|
-
input: unknown()
|
|
17917
|
-
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
17918
|
-
/**
|
|
17919
17972
|
* camera-credentials — device-scoped cap exposing the camera's network
|
|
17920
17973
|
* + auth surface in a vendor-neutral shape.
|
|
17921
17974
|
*
|
|
@@ -21885,6 +21938,12 @@ Object.freeze({
|
|
|
21885
21938
|
addonId: null,
|
|
21886
21939
|
access: "view"
|
|
21887
21940
|
},
|
|
21941
|
+
"metricsProvider.dumpHeapSnapshot": {
|
|
21942
|
+
capName: "metrics-provider",
|
|
21943
|
+
capScope: "system",
|
|
21944
|
+
addonId: null,
|
|
21945
|
+
access: "create"
|
|
21946
|
+
},
|
|
21888
21947
|
"metricsProvider.getAddonStats": {
|
|
21889
21948
|
capName: "metrics-provider",
|
|
21890
21949
|
capScope: "system",
|
|
@@ -24152,30 +24211,6 @@ object({
|
|
|
24152
24211
|
bootAttempts: number(),
|
|
24153
24212
|
schemaVersion: literal(1)
|
|
24154
24213
|
});
|
|
24155
|
-
/**
|
|
24156
|
-
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
24157
|
-
* wait, back off, or schedule a retry. Before these helpers landed, each
|
|
24158
|
-
* call site re-implemented `new Promise(r => setTimeout(r, ms))` inline,
|
|
24159
|
-
* with subtle variations (some swallowing cancellation, some not). Two
|
|
24160
|
-
* shapes cover every observed use case:
|
|
24161
|
-
*
|
|
24162
|
-
* - {@link sleep} for a plain, uncancellable wait — the default choice.
|
|
24163
|
-
* - {@link sleepCancellable} for a wait that wakes early when an
|
|
24164
|
-
* abort signal trips, used by long-running pollers whose teardown
|
|
24165
|
-
* must stop a pending backoff promptly.
|
|
24166
|
-
*/
|
|
24167
|
-
/**
|
|
24168
|
-
* Resolve after `ms` milliseconds. Never rejects, never cancels. The
|
|
24169
|
-
* sleep cannot be interrupted; for a wakeable variant use
|
|
24170
|
-
* {@link sleepCancellable}.
|
|
24171
|
-
*
|
|
24172
|
-
* `ms <= 0` resolves on the next microtask via `setTimeout(0)`, which
|
|
24173
|
-
* still gives the event loop a chance to drain — useful for breaking
|
|
24174
|
-
* up tight async loops without changing call-site semantics.
|
|
24175
|
-
*/
|
|
24176
|
-
function sleep$1(ms) {
|
|
24177
|
-
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
24178
|
-
}
|
|
24179
24214
|
//#endregion
|
|
24180
24215
|
//#region ../../node_modules/undici/lib/core/symbols.js
|
|
24181
24216
|
var require_symbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -218113,7 +218148,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
218113
218148
|
try {
|
|
218114
218149
|
api = await withTimeout(this.ensureApi(), 1e4, "ensureApi");
|
|
218115
218150
|
} catch (err) {
|
|
218116
|
-
throw new Error(`buildStreamCatalog: ensureApi failed for device ${this.id}: ${err instanceof Error ? err.message : String(err)}`,
|
|
218151
|
+
throw new Error(`buildStreamCatalog: ensureApi failed for device ${this.id}: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
218117
218152
|
}
|
|
218118
218153
|
let streamOptions;
|
|
218119
218154
|
const isChild = this.isHubChild();
|
|
@@ -218125,7 +218160,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
|
|
|
218125
218160
|
try {
|
|
218126
218161
|
streamOptions = await withTimeout(buildOptions ? api.buildVideoStreamOptions(buildOptions) : api.buildVideoStreamOptions(), 1e4, "buildVideoStreamOptions");
|
|
218127
218162
|
} catch (err) {
|
|
218128
|
-
throw new Error(`buildStreamCatalog: buildVideoStreamOptions failed for device ${this.id}: ${err instanceof Error ? err.message : String(err)}`,
|
|
218163
|
+
throw new Error(`buildStreamCatalog: buildVideoStreamOptions failed for device ${this.id}: ${err instanceof Error ? err.message : String(err)}`, { cause: err });
|
|
218129
218164
|
}
|
|
218130
218165
|
const channelCount = this.channelCount();
|
|
218131
218166
|
const desired = /* @__PURE__ */ new Map();
|