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