@camstack/addon-provider-homematic 1.2.205 → 1.2.206

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.
Files changed (17) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/_stub.js +2 -2
  3. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-BBYiqZ5h.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-DZpqsn6u.mjs} +4 -4
  4. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CiaZc7Zu.mjs +26 -0
  5. package/dist/addon.js +395 -88
  6. package/dist/addon.mjs +395 -88
  7. package/dist/{hostInit-nT-RhOBP.mjs → hostInit-DBO78Hu-.mjs} +3 -3
  8. package/dist/remoteEntry.js +1 -1
  9. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-BI01xl_h.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-D1CbMi19.mjs} +1 -1
  10. package/dist/widgets/_stub.js +1 -1
  11. package/dist/widgets/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-B0ssCAy7.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-Bwve1HPK.mjs} +2 -2
  12. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DaUa1YeZ.mjs +26 -0
  13. package/dist/widgets/{hostInit-phYEFIYx.mjs → hostInit-DSjxilwJ.mjs} +2 -2
  14. package/dist/widgets/remoteEntry.js +1 -1
  15. package/package.json +3 -3
  16. package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Civ5HlCQ.mjs +0 -26
  17. package/dist/widgets/_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-De1hiEmR.mjs +0 -26
package/dist/addon.js CHANGED
@@ -8,7 +8,7 @@ let crypto$1 = require("crypto");
8
8
  let fs_promises = require("fs/promises");
9
9
  let path = require("path");
10
10
  let node_os = require("node:os");
11
- //#region ../types/dist/event-category-Hwx_JSCU.mjs
11
+ //#region ../types/dist/event-category-CY27-fF0.mjs
12
12
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
13
13
  EventCategory["SystemBoot"] = "system.boot";
14
14
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -508,7 +508,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
508
508
  */
509
509
  EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
510
510
  /**
511
- * Emitted by the battery cap provider WHEN `wakeForStream` enters the
511
+ * Emitted by the battery cap provider WHEN `wakeUp` enters the
512
512
  * "wake in progress" window — between the Baichuan wake-up issue and
513
513
  * the camera's first dialed-back RTP packet. The stream-broker
514
514
  * manager subscribes to flip the per-broker placeholder reason to
@@ -840,7 +840,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
840
840
  return EventCategory;
841
841
  }({});
842
842
  //#endregion
843
- //#region ../types/dist/composed-stable-id-BBL71oUQ.mjs
843
+ //#region ../types/dist/composed-stable-id-BNTaDZEh.mjs
844
844
  /**
845
845
  import { errMsg } from '@camstack/types'
846
846
  * Extract a human-readable message from an unknown error value.
@@ -979,12 +979,19 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
979
979
  return DeviceType;
980
980
  }({});
981
981
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
982
+ /** The device reports a battery reading (the `battery` cap). Says nothing about sleep. */
982
983
  DeviceFeature["BatteryOperated"] = "battery-operated";
984
+ /**
985
+ * The device goes into low-power sleep and must be WOKEN before it streams
986
+ * (the `low-power-sleep` cap, `wakeUp`). A battery reading alone is
987
+ * not this: a battery sensor reports charge and never sleeps (#459, Q2).
988
+ */
989
+ DeviceFeature["Sleeps"] = "sleeps";
983
990
  DeviceFeature["Rebootable"] = "rebootable";
984
991
  /**
985
992
  * Device supports an on-demand re-sync of its derived spec with its
986
- * upstream source — drives the generic Re-sync button. The owning
987
- * provider implements the action via the `device-adoption.resync` cap.
993
+ * upstream source — drives the generic Re-sync button. Present when the
994
+ * device has the `resync` cap bound (#459, Q6).
988
995
  */
989
996
  DeviceFeature["Resyncable"] = "resyncable";
990
997
  DeviceFeature["NativeSnapshot"] = "native-snapshot";
@@ -1068,9 +1075,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1068
1075
  DeviceFeature["FanDirection"] = "fan-direction";
1069
1076
  /** Fan exposes an oscillation toggle. */
1070
1077
  DeviceFeature["FanOscillating"] = "fan-oscillating";
1071
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
1072
- * field on the UI lock-controls panel. */
1073
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
1074
1078
  /** Lock supports a latch-release ("open door") action distinct from
1075
1079
  * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
1076
1080
  * `supported_features`. Gates the Open Door button in the UI. */
@@ -1101,8 +1105,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1101
1105
  DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1102
1106
  /** Media player exposes power on / off. */
1103
1107
  DeviceFeature["MediaPlayerPower"] = "media-player-power";
1104
- /** Alarm panel requires a PIN code on arm/disarm. */
1105
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1106
1108
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
1107
1109
  * addition to a textual location. */
1108
1110
  DeviceFeature["PresenceGps"] = "presence-gps";
@@ -1122,15 +1124,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
1122
1124
  /** Automation `trigger` accepts a skipCondition flag — fires the
1123
1125
  * automation's actions while bypassing its condition block. */
1124
1126
  DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
1125
- /** Robot vacuum exposes a live cleaning map (image child). Gates the
1126
- * map tile in the vacuum UI. */
1127
- DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
1128
1127
  /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
1129
1128
  * switches group. */
1130
1129
  DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
1131
- /** Robot mower exposes a live mowing map (SVG image child). Gates the
1132
- * mower map tile. */
1133
- DeviceFeature["MowerHasMap"] = "mower-has-map";
1134
1130
  /** Robot mower exposes targeted mowing (all-area / zones / edges /
1135
1131
  * spots) — gates the Mow action + map selectors. */
1136
1132
  DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
@@ -6118,7 +6114,7 @@ var ZodIssueCode = {
6118
6114
  var ZodFirstPartyTypeKind;
6119
6115
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6120
6116
  //#endregion
6121
- //#region ../types/dist/sleep-D6Pih0Qt.mjs
6117
+ //#region ../types/dist/sleep-BT1bLgPq.mjs
6122
6118
  /**
6123
6119
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6124
6120
  * window to float samples (D455).
@@ -17477,6 +17473,14 @@ var CAP_VOCABULARY_BY_NAME = {
17477
17473
  icon: "refresh-cw"
17478
17474
  }]
17479
17475
  },
17476
+ "resync": {
17477
+ scope: "device",
17478
+ noun: {
17479
+ en: "Re-sync",
17480
+ it: "Risincronizzazione"
17481
+ },
17482
+ notOperatorFacing: { resync: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action" }
17483
+ },
17480
17484
  "recording": {
17481
17485
  scope: "device",
17482
17486
  noun: {
@@ -19488,7 +19492,6 @@ var CAP_VOCABULARY_BY_NAME = {
19488
19492
  en: "Battery",
19489
19493
  it: "Batteria"
19490
19494
  },
19491
- notOperatorFacing: { wakeForStream: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" },
19492
19495
  state: [
19493
19496
  {
19494
19497
  kind: "numeric",
@@ -19598,6 +19601,14 @@ var CAP_VOCABULARY_BY_NAME = {
19598
19601
  icon: "moon"
19599
19602
  }]
19600
19603
  },
19604
+ "low-power-sleep": {
19605
+ scope: "device",
19606
+ noun: {
19607
+ en: "Low-power sleep",
19608
+ it: "Sospensione a basso consumo"
19609
+ },
19610
+ notOperatorFacing: { wakeUp: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" }
19611
+ },
19601
19612
  "network-link": {
19602
19613
  scope: "device",
19603
19614
  noun: {
@@ -20509,6 +20520,7 @@ var CAP_NAMES = Object.freeze([
20509
20520
  "log-channels",
20510
20521
  "log-destination",
20511
20522
  "login-method",
20523
+ "low-power-sleep",
20512
20524
  "media-player",
20513
20525
  "mesh-network",
20514
20526
  "meter",
@@ -20562,6 +20574,7 @@ var CAP_NAMES = Object.freeze([
20562
20574
  "records",
20563
20575
  "remote",
20564
20576
  "remote-layout-components",
20577
+ "resync",
20565
20578
  "running-state",
20566
20579
  "scene-monitor",
20567
20580
  "schedulers",
@@ -20665,7 +20678,7 @@ Object.freeze({
20665
20678
  ]
20666
20679
  },
20667
20680
  {
20668
- "path": "requiresCode",
20681
+ "path": "codeRequired",
20669
20682
  "valueType": "boolean"
20670
20683
  }
20671
20684
  ],
@@ -21733,7 +21746,24 @@ Object.freeze({
21733
21746
  "jammed",
21734
21747
  "door-open"
21735
21748
  ]
21749
+ }, {
21750
+ "path": "codeRequired",
21751
+ "valueType": "boolean"
21736
21752
  }],
21753
+ "low-power-sleep": [
21754
+ {
21755
+ "path": "sleeping",
21756
+ "valueType": "boolean"
21757
+ },
21758
+ {
21759
+ "path": "lastContactAt",
21760
+ "valueType": "number"
21761
+ },
21762
+ {
21763
+ "path": "lastUpdated",
21764
+ "valueType": "number"
21765
+ }
21766
+ ],
21737
21767
  "media-player": [
21738
21768
  {
21739
21769
  "path": "state",
@@ -22903,7 +22933,7 @@ Object.freeze({
22903
22933
  }
22904
22934
  });
22905
22935
  //#endregion
22906
- //#region ../types/dist/implemented-methods-u7ddjc-_.mjs
22936
+ //#region ../types/dist/implemented-methods-k3KProJd.mjs
22907
22937
  /**
22908
22938
  * The ffmpeg build every CamStack node downloads, per platform and arch.
22909
22939
  *
@@ -49339,6 +49369,67 @@ object({
49339
49369
  /** Namespaces the client listed that no longer exist. */
49340
49370
  deleted: array(PreferenceNamespaceSchema)
49341
49371
  });
49372
+ /**
49373
+ * The wire shapes of `apiCatalog.*` — the API explorer's data (planning#595).
49374
+ *
49375
+ * One entry per tRPC method the hub serves, capability and core routes alike,
49376
+ * read off the live router by the hub (never a hand-written list).
49377
+ */
49378
+ var ApiProcedureKindSchema = _enum([
49379
+ "query",
49380
+ "mutation",
49381
+ "subscription"
49382
+ ]);
49383
+ /** The gate a method runs behind. */
49384
+ var ApiProcedureTierSchema = _enum([
49385
+ "public",
49386
+ "protected",
49387
+ "admin"
49388
+ ]);
49389
+ /** The token scope a capability route is matched against (its `METHOD_ACCESS_MAP` row). */
49390
+ var ApiCatalogScopeSchema = object({
49391
+ capName: string(),
49392
+ capScope: _enum(["device", "system"]),
49393
+ access: _enum([
49394
+ "view",
49395
+ "create",
49396
+ "delete"
49397
+ ]),
49398
+ role: string()
49399
+ });
49400
+ var ApiCatalogEntrySchema = object({
49401
+ /** `<router>.<method>` — the tRPC path. */
49402
+ path: string(),
49403
+ router: string(),
49404
+ method: string(),
49405
+ kind: ApiProcedureKindSchema,
49406
+ tier: ApiProcedureTierSchema,
49407
+ source: _enum(["capability", "core"]),
49408
+ /** `null` on a core route: it needs authentication only (plus admin where its tier says so). */
49409
+ scope: ApiCatalogScopeSchema.nullable(),
49410
+ hasInput: boolean()
49411
+ });
49412
+ /**
49413
+ * May the CALLER call a method. The list has no input, so a method reached
49414
+ * only through a device grant is `per-device`: the real call is allowed or
49415
+ * refused on the device its input names.
49416
+ */
49417
+ var ApiCallableSchema = _enum([
49418
+ "yes",
49419
+ "no",
49420
+ "per-device"
49421
+ ]);
49422
+ object({ methods: array(ApiCatalogEntrySchema.extend({ callable: ApiCallableSchema })) });
49423
+ /** A JSON Schema document, as the explorer receives it. */
49424
+ var JsonSchemaDocumentSchema = record$1(string(), unknown());
49425
+ object({
49426
+ path: string(),
49427
+ hasInput: boolean(),
49428
+ /** The INPUT JSON schema (what the caller sends); `null` without input or when it could not be produced. */
49429
+ schema: JsonSchemaDocumentSchema.nullable(),
49430
+ /** Why no schema could be produced (a non-Zod parser, an unrepresentable type). */
49431
+ error: string().nullable()
49432
+ });
49342
49433
  _enum(["new-session", "step-up"]);
49343
49434
  /** The languages the hub's app landing pages are written in (D858). */
49344
49435
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -53197,9 +53288,8 @@ var airQualitySensorCapability = {
53197
53288
  * Many panels require a PIN code on arm / disarm — the optional
53198
53289
  * `code` field on the methods passes it through to the upstream
53199
53290
  * service; it's NEVER persisted in the runtime slice or any event
53200
- * payload. The presence of a required code is signalled by
53201
- * `DeviceFeature.AlarmPinRequired` so the UI gates a code-entry
53202
- * field without a slice fetch.
53291
+ * payload. Whether a code is required is the slice's `codeRequired`
53292
+ * (#459): `null` when the provider cannot tell (D393).
53203
53293
  *
53204
53294
  * `availableModes` mirrors HA's `supported_features`-derived arm
53205
53295
  * mode list — the UI renders only the buttons the panel accepts.
@@ -53238,9 +53328,13 @@ var AlarmPanelStatusSchema = object({
53238
53328
  /** Subset of arm modes the panel accepts. UI renders one button per
53239
53329
  * mode in this list. */
53240
53330
  availableModes: array(AlarmArmModeSchema),
53241
- /** Whether the panel requires a PIN on arm / disarm. Mirrors
53242
- * `DeviceFeature.AlarmPinRequired` for slice consumers. */
53243
- requiresCode: boolean(),
53331
+ /**
53332
+ * Whether the panel requires a PIN on arm / disarm (#459; the field was
53333
+ * `requiresCode`, and the `alarm-pin-required` device feature is gone).
53334
+ * `null` = the provider cannot tell (D393), never `false`. A slice restored
53335
+ * from before the rename is upgraded at boot by `restoredFieldRenames`.
53336
+ */
53337
+ codeRequired: boolean().nullable(),
53244
53338
  /** Ms epoch when the slice was last updated. */
53245
53339
  lastChangedAt: number$1()
53246
53340
  });
@@ -53297,7 +53391,7 @@ var alarmPanelCapability = {
53297
53391
  arm: method(object({
53298
53392
  deviceId: number$1().int().nonnegative(),
53299
53393
  mode: AlarmArmModeSchema,
53300
- /** Optional PIN code. Required when `requiresCode === true`.
53394
+ /** Optional PIN code. Required when `codeRequired === true`.
53301
53395
  * Passed through to the upstream service; never persisted. */
53302
53396
  code: string().min(1).optional()
53303
53397
  }), _void(), {
@@ -53414,7 +53508,7 @@ var alarmPanelCapability = {
53414
53508
  /**
53415
53509
  * Runtime-state slice — mirrored by the kernel. UI panel reads the
53416
53510
  * full slice; renders an arm button per `availableModes` entry and
53417
- * a PIN field iff `requiresCode === true`.
53511
+ * a PIN field iff `codeRequired === true`.
53418
53512
  */
53419
53513
  runtimeState: AlarmPanelStatusSchema,
53420
53514
  /**
@@ -53425,6 +53519,13 @@ var alarmPanelCapability = {
53425
53519
  */
53426
53520
  durability: "restored",
53427
53521
  /**
53522
+ * A slice persisted before #459 carries `requiresCode`; the boot seed reads it
53523
+ * once into `codeRequired` (`restoredPart`), so no reader meets the old key,
53524
+ * and rewrites the row once without it (`seedMirrorFromRow`) — so this entry
53525
+ * can be dropped after every node has booted once on a release that has it.
53526
+ */
53527
+ restoredFieldRenames: { requiresCode: "codeRequired" },
53528
+ /**
53428
53529
  * History (D850): the panel's lifecycle state as an `enum` series —
53429
53530
  * change-only, no floor, so an `arming -> pending -> triggered` sequence of a
53430
53531
  * few seconds keeps every step. Who armed it stays in the events ledger.
@@ -54622,9 +54723,9 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
54622
54723
  auth: "admin"
54623
54724
  });
54624
54725
  /**
54625
- * Battery status snapshot. Emitted by providers whose device is
54626
- * battery-operated (cameras with `DeviceFeature.BatteryOperated`,
54627
- * future sensor/button accessories). Consumers build their own "low
54726
+ * Battery status snapshot. Emitted by providers whose device reports a
54727
+ * battery (`DeviceFeature.BatteryOperated`): battery cameras, sensors,
54728
+ * buttons. Whether the device SLEEPS is `low-power-sleep`, not this cap. Consumers build their own "low
54628
54729
  * battery" alerting on top — the cap deliberately does NOT enforce a
54629
54730
  * threshold.
54630
54731
  */
@@ -54781,47 +54882,12 @@ var batteryCapability = {
54781
54882
  deviceNative: true,
54782
54883
  mode: "singleton",
54783
54884
  deviceTypes: BATTERY_DEVICE_TYPES,
54784
- methods: {
54785
54885
  /**
54786
- * Explicitly wake the camera from low-power sleep ahead of a
54787
- * streaming session start. Consumers that initiate a stream
54788
- * against a sleeping battery cam (HomeKit Secure Video, Alexa
54789
- * RTCSession, snapshot wrappers) call this with a short timeout
54790
- * before establishing the media pipeline — the broker's own
54791
- * passive wake-on-dial works but adds 5–7 seconds to first-frame,
54792
- * during which the consumer renders a black screen. Pre-waking
54793
- * compresses that gap.
54794
- *
54795
- * Returns `awoke: true` when the firmware acknowledged the wake
54796
- * before `timeoutMs`. Returns `awoke: false` when it timed out OR
54797
- * the cap surface is unavailable (no Baichuan / firmware
54798
- * channel); the caller should still attempt the stream — the
54799
- * passive broker wake remains as fallback.
54800
- */
54801
- wakeForStream: method(object({
54802
- deviceId: number$1(),
54803
- /** Bound on the wait. Sensible range 3000–10000ms. */
54804
- timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
54805
- }), object({
54806
- awoke: boolean(),
54807
- durationMs: number$1()
54808
- }), {
54809
- kind: "mutation",
54810
- notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
54811
- }) },
54812
- /**
54813
- * A composed provider (battery ADDED to a pet feeder or container that has
54814
- * no wake surface) answers `wakeForStream` with the same "unavailable"
54815
- * result the contract already defines above: "Returns `awoke: false` when
54816
- * … the cap surface is unavailable." (D663).
54886
+ * No methods: waking a sleeping camera is `low-power-sleep.wakeUp`
54887
+ * (#459, Q2). A battery reading says nothing about sleep — a battery sensor
54888
+ * reports charge and never needs waking.
54817
54889
  */
54818
- composedMethods: { wakeForStream: {
54819
- kind: "answer",
54820
- value: {
54821
- awoke: false,
54822
- durationMs: 0
54823
- }
54824
- } },
54890
+ methods: {},
54825
54891
  events: {
54826
54892
  /**
54827
54893
  * Emitted whenever the cached status changes (firmware push OR
@@ -61853,6 +61919,69 @@ function normaliseIdentifiers(raw, options = {}) {
61853
61919
  rejected: refused
61854
61920
  };
61855
61921
  }
61922
+ /**
61923
+ * Cross-integration identity candidates (planning#593, step 2 of D1059's epic).
61924
+ *
61925
+ * Two devices brought by DIFFERENT integrations that share provider-declared
61926
+ * identifiers ({@link DeviceIdentifiers}) are candidates for being the same
61927
+ * physical object. This module holds the answer's shape; the device-manager
61928
+ * keeps the index that finds the pairs and the ONE rule that grades a match
61929
+ * (`classifyIdentityMatch`, `device-identity-index.ts`).
61930
+ *
61931
+ * The rule (operator, planning#590):
61932
+ *
61933
+ * | Matched keys | Confidence |
61934
+ * | ---------------------------------------------- | ----------- |
61935
+ * | two strong KINDS (e.g. `mac` + `serial`) | `auto` |
61936
+ * | `mac` + `ip` | `auto` |
61937
+ * | exactly one strong kind | `proposal` |
61938
+ * | weak keys only (`hostname`, `ip`) | no candidate|
61939
+ *
61940
+ * Strength counts distinct KINDS, not values: two MACs of one device matching
61941
+ * the other's two MACs are still one kind of evidence, so a proposal. In doubt,
61942
+ * no match.
61943
+ *
61944
+ * Read-only: a candidate is NOT a link. Links are step 3.
61945
+ */
61946
+ var IdentityConfidenceSchema = _enum(["auto", "proposal"]);
61947
+ /** One identifier both devices declared, with the same normalised value. */
61948
+ var IdentityMatchedKeySchema = object({
61949
+ key: DeviceIdentifierKeySchema,
61950
+ value: string()
61951
+ });
61952
+ /** One side of a pair: the device and the integration that brought it. */
61953
+ var IdentityCandidateDeviceSchema = object({
61954
+ deviceId: number$1().int(),
61955
+ addonId: string(),
61956
+ /** The integration instance (`int_NNNN`) that adopted it; `null` when none was stamped. */
61957
+ integrationId: string().nullable()
61958
+ });
61959
+ /** Two devices of different integrations sharing at least one strong identifier. `a.deviceId < b.deviceId`. */
61960
+ var IdentityCandidatePairSchema = object({
61961
+ a: IdentityCandidateDeviceSchema,
61962
+ b: IdentityCandidateDeviceSchema,
61963
+ /** Every identifier the two share, weak ones included, ordered by key then value. */
61964
+ keys: array(IdentityMatchedKeySchema).readonly(),
61965
+ confidence: IdentityConfidenceSchema
61966
+ });
61967
+ /**
61968
+ * The answer of `device-manager.listIdentityCandidates`.
61969
+ *
61970
+ * - `unknown` — the index has not loaded yet: nothing can be said, and it is
61971
+ * NOT an empty list (D315).
61972
+ * - `answered` — `pairs` holds every candidate. `undeclaredDeviceIds` are the
61973
+ * devices with no identifiers on record: whether they match anything is
61974
+ * UNKNOWN, never "no match" (D393). A device absent from both lists declared
61975
+ * identifiers and matched nobody.
61976
+ */
61977
+ var IdentityCandidatesSchema = discriminatedUnion("status", [object({
61978
+ status: literal("unknown"),
61979
+ reason: string()
61980
+ }), object({
61981
+ status: literal("answered"),
61982
+ pairs: array(IdentityCandidatePairSchema).readonly(),
61983
+ undeclaredDeviceIds: array(number$1().int()).readonly()
61984
+ })]);
61856
61985
  var DeviceSearchRequiresSchema = object({
61857
61986
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
61858
61987
  caps: array(string()).readonly().optional(),
@@ -62893,6 +63022,9 @@ method(object({
62893
63022
  }), _void(), {
62894
63023
  kind: "mutation",
62895
63024
  auth: "admin"
63025
+ }), method(object({}), IdentityCandidatesSchema, {
63026
+ kind: "query",
63027
+ auth: "admin"
62896
63028
  }), method(_void(), array(string())), method(object({ name: string() }), _void(), {
62897
63029
  kind: "mutation",
62898
63030
  auth: "admin"
@@ -71431,6 +71563,13 @@ var LockControlStatusSchema = object({
71431
71563
  "jammed",
71432
71564
  "door-open"
71433
71565
  ]),
71566
+ /**
71567
+ * Whether lock / unlock need a PIN `code` (#459, replaces the
71568
+ * `lock-pin-required` device feature). `null` = the provider cannot tell
71569
+ * (D393) — never `false`. `.optional()` so a restored slice written before
71570
+ * the field still parses; readers treat absent exactly like `null`.
71571
+ */
71572
+ codeRequired: boolean().nullable().optional(),
71434
71573
  /** Ms epoch when the slice was last updated. */
71435
71574
  lastChangedAt: number$1()
71436
71575
  });
@@ -71888,6 +72027,90 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
71888
72027
  ]);
71889
72028
  method(_void(), array(LoginMethodContributionSchema).readonly()), NOT_A_DEVICE.IDENTITY;
71890
72029
  /**
72030
+ * low-power-sleep — a device that goes into low-power sleep and must be WOKEN
72031
+ * before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
72032
+ * on-board camera) is one; a battery SENSOR is not: it reports charge on the
72033
+ * `battery` cap and never sleeps. The two meanings used to share
72034
+ * `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
72035
+ * and `DeviceFeature.Sleeps` is derived from it being bound with
72036
+ * `wakeUp` implemented.
72037
+ *
72038
+ * The state is the sleep inputs (`deriveBatteryPresence`): whether the device
72039
+ * is asleep, and the last time it PROVED it was reachable. Read from this slice
72040
+ * by the stream broker (`readBatterySleepFacts`), the recorder
72041
+ * (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
72042
+ * mirror is still also fed by `BatteryOnStatusChanged` events.
72043
+ */
72044
+ var LowPowerSleepStatusSchema = object({
72045
+ /**
72046
+ * True while the firmware is in low-power mode. A provider MUST avoid polling
72047
+ * during sleep — a read wakes the device and drains charge.
72048
+ */
72049
+ sleeping: boolean().meta({ label: "Sleeping" }),
72050
+ /**
72051
+ * Ms epoch of the last time the device proved it was reachable, from
72052
+ * PASSIVE signals only (a completed round-trip, an observed wake, a push).
72053
+ * Absent = never since this slice was born. The only input that separates
72054
+ * "asleep" from "gone".
72055
+ */
72056
+ lastContactAt: number$1().optional(),
72057
+ /** Ms epoch of the last observation. */
72058
+ lastUpdated: number$1().meta(readingMeta("none"))
72059
+ });
72060
+ var lowPowerSleepCapability = {
72061
+ name: "low-power-sleep",
72062
+ scope: "device",
72063
+ deviceNative: true,
72064
+ mode: "singleton",
72065
+ deviceTypes: [DeviceType.Camera],
72066
+ methods: {
72067
+ /**
72068
+ * Explicitly wake the device from low-power sleep ahead of a streaming
72069
+ * session start. Consumers that initiate a stream against a sleeping
72070
+ * camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
72071
+ * call this with a short timeout before establishing the media pipeline —
72072
+ * the broker's own passive wake-on-dial works but adds 5–7 seconds to
72073
+ * first-frame. Pre-waking compresses that gap.
72074
+ *
72075
+ * Returns `awoke: true` when the firmware acknowledged the wake before
72076
+ * `timeoutMs`, `awoke: false` when it timed out; the caller should still
72077
+ * attempt the stream — the passive broker wake remains as fallback.
72078
+ */
72079
+ wakeUp: method(object({
72080
+ deviceId: number$1(),
72081
+ /** Bound on the wait. Sensible range 3000–10000ms. */
72082
+ timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
72083
+ }), object({
72084
+ awoke: boolean(),
72085
+ durationMs: number$1()
72086
+ }), {
72087
+ kind: "mutation",
72088
+ notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
72089
+ }) },
72090
+ status: {
72091
+ schema: LowPowerSleepStatusSchema,
72092
+ kind: "push",
72093
+ empty: {
72094
+ sleeping: false,
72095
+ lastUpdated: 0
72096
+ }
72097
+ },
72098
+ runtimeState: LowPowerSleepStatusSchema,
72099
+ /**
72100
+ * Runtime-state durability: **restored** — a sleeping camera may not report
72101
+ * for hours; the restored sleep inputs are the only thing the sleep gate and
72102
+ * the presence derivation have (the same argument as `battery`).
72103
+ */
72104
+ durability: "restored",
72105
+ /** History (D850): none — battery never recorded a sleep series either. */
72106
+ history: "none",
72107
+ volatileStateFields: ["lastUpdated"],
72108
+ vocabulary: {
72109
+ noun: t("Low-power sleep", "Sospensione a basso consumo"),
72110
+ order: 5245
72111
+ }
72112
+ };
72113
+ /**
71891
72114
  * mesh-network — collection cap for mesh-VPN providers.
71892
72115
  *
71893
72116
  * Different shape from `network-access` (public tunnels):
@@ -89040,6 +89263,42 @@ var RemoteLayoutComponentSchema = object({
89040
89263
  });
89041
89264
  });
89042
89265
  method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
89266
+ /**
89267
+ * resync — a device whose derived spec can be re-aligned on demand with its
89268
+ * upstream source (#459, Q6). Registered by the containers an integration
89269
+ * adopted; `DeviceFeature.Resyncable` (the generic Re-sync button) is derived
89270
+ * from it being bound with `resync` implemented.
89271
+ *
89272
+ * The work itself stays where it is: the owning addon's `device-adoption`
89273
+ * provider, reached through `deviceManager.adoptionResync` (which also owns
89274
+ * the "resync from zero" child purge). A provider answers this method by
89275
+ * asking for exactly that — see `resyncThroughAdoption`.
89276
+ */
89277
+ var ResyncDeviceInputSchema = object({
89278
+ deviceId: number$1().int().nonnegative(),
89279
+ /** "Resync from zero": purge the accessory children before re-deriving. */
89280
+ resetToSource: boolean().optional()
89281
+ });
89282
+ var resyncCapability = {
89283
+ name: "resync",
89284
+ scope: "device",
89285
+ deviceNative: true,
89286
+ mode: "singleton",
89287
+ deviceTypes: [
89288
+ DeviceType.Container,
89289
+ DeviceType.Workload,
89290
+ DeviceType.WeatherStation
89291
+ ],
89292
+ methods: { resync: method(ResyncDeviceInputSchema, ResyncResultSchema, {
89293
+ kind: "mutation",
89294
+ auth: "admin",
89295
+ notOperatorFacing: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action"
89296
+ }) },
89297
+ vocabulary: {
89298
+ noun: t("Re-sync", "Risincronizzazione"),
89299
+ order: 3245
89300
+ }
89301
+ };
89043
89302
  var RUNNING_POWER_START_DELAY_MS = 3e4;
89044
89303
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
89045
89304
  /**
@@ -97337,6 +97596,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
97337
97596
  irTransmitter: irTransmitterCapability,
97338
97597
  lawnMowerControl: lawnMowerControlCapability,
97339
97598
  lockControl: lockControlCapability,
97599
+ lowPowerSleep: lowPowerSleepCapability,
97340
97600
  mediaPlayer: mediaPlayerCapability,
97341
97601
  meter: meterCapability,
97342
97602
  motion: motionCapability,
@@ -98816,6 +99076,21 @@ var BaseDeviceProvider = class extends BaseAddon {
98816
99076
  return toDeviceSummary(device, this.addonId);
98817
99077
  }
98818
99078
  };
99079
+ /**
99080
+ * The `resync` provider of an adopted container (#459, Q6): the work is the
99081
+ * owning addon's `device-adoption.resync`, reached through
99082
+ * `deviceManager.adoptionResync`, which also owns the "resync from zero" child
99083
+ * purge. Registering this is what makes `DeviceFeature.Resyncable` true.
99084
+ */
99085
+ function resyncThroughAdoption(deviceManager, ownDeviceId) {
99086
+ return { resync: async ({ deviceId, resetToSource }) => {
99087
+ if (deviceId !== ownDeviceId) throw new Error(`resync: deviceId mismatch, expected ${ownDeviceId}, got ${deviceId}`);
99088
+ return deviceManager.adoptionResync.mutate({
99089
+ camDeviceId: deviceId,
99090
+ ...resetToSource !== void 0 ? { resetToSource } : {}
99091
+ });
99092
+ } };
99093
+ }
98819
99094
  DeviceType.HeatPump;
98820
99095
  DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.WeatherStation, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
98821
99096
  new Set(Object.values(DeviceType));
@@ -99026,8 +99301,8 @@ var ALARM_MODES = [
99026
99301
  "vacation",
99027
99302
  "custom_bypass"
99028
99303
  ];
99029
- function alarmControls(state, modes, requiresCode) {
99030
- if (requiresCode) return [];
99304
+ function alarmControls(state, modes, codeRequired) {
99305
+ if (codeRequired) return [];
99031
99306
  const disarm = asAction(action("alarm.disarm", t("Disarm", "Disinserisci"), "shield-off", "alarm-panel", "disarm", {}, "primary"));
99032
99307
  const arm = (primaryFirst) => modes.map((mode, i) => asAction(action(`alarm.arm.${mode}`, ARM_LABELS[mode], "shield-check", "alarm-panel", "arm", { mode }, primaryFirst && i === 0 ? "primary" : "normal")));
99033
99308
  switch (state) {
@@ -99047,7 +99322,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
99047
99322
  const modes = slice === void 0 ? ALARM_MODES : slice.availableModes;
99048
99323
  return {
99049
99324
  reading: reading$1("alarm-panel", words?.state ?? "unknown", false, words?.title),
99050
- rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.requiresCode ?? false))],
99325
+ rows: [row$1("alarm", state === "triggered" ? "shield-alert" : state === "disarmed" ? "shield-off" : "shield-check", joinText([words?.title ?? NOT_REPORTED, since]), alarmControls(state, modes, slice?.codeRequired !== false))],
99051
99326
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
99052
99327
  ...words === null ? {} : { tiles: {
99053
99328
  left: [{
@@ -102430,13 +102705,6 @@ Object.freeze({
102430
102705
  access: "view",
102431
102706
  role: "viewer"
102432
102707
  },
102433
- "battery.wakeForStream": {
102434
- capName: "battery",
102435
- capScope: "device",
102436
- addonId: null,
102437
- access: "create",
102438
- role: "viewer"
102439
- },
102440
102708
  "binary.getStatus": {
102441
102709
  capName: "binary",
102442
102710
  capScope: "device",
@@ -103963,6 +104231,13 @@ Object.freeze({
103963
104231
  access: "view",
103964
104232
  role: "admin"
103965
104233
  },
104234
+ "deviceManager.listIdentityCandidates": {
104235
+ capName: "device-manager",
104236
+ capScope: "system",
104237
+ addonId: null,
104238
+ access: "view",
104239
+ role: "admin"
104240
+ },
103966
104241
  "deviceManager.listLocationDescriptions": {
103967
104242
  capName: "device-manager",
103968
104243
  capScope: "system",
@@ -106084,6 +106359,20 @@ Object.freeze({
106084
106359
  access: "view",
106085
106360
  role: "admin"
106086
106361
  },
106362
+ "lowPowerSleep.getStatus": {
106363
+ capName: "low-power-sleep",
106364
+ capScope: "device",
106365
+ addonId: null,
106366
+ access: "view",
106367
+ role: "viewer"
106368
+ },
106369
+ "lowPowerSleep.wakeUp": {
106370
+ capName: "low-power-sleep",
106371
+ capScope: "device",
106372
+ addonId: null,
106373
+ access: "create",
106374
+ role: "viewer"
106375
+ },
106087
106376
  "mediaPlayer.channelDown": {
106088
106377
  capName: "media-player",
106089
106378
  capScope: "device",
@@ -109759,6 +110048,13 @@ Object.freeze({
109759
110048
  access: "view",
109760
110049
  role: "admin"
109761
110050
  },
110051
+ "resync.resync": {
110052
+ capName: "resync",
110053
+ capScope: "device",
110054
+ addonId: null,
110055
+ access: "create",
110056
+ role: "admin"
110057
+ },
109762
110058
  "runningState.getStatus": {
109763
110059
  capName: "running-state",
109764
110060
  capScope: "device",
@@ -112154,7 +112450,7 @@ Object.freeze({
112154
112450
  role: "admin"
112155
112451
  }
112156
112452
  });
112157
- DeviceFeature.BatteryOperated;
112453
+ DeviceFeature.Sleeps;
112158
112454
  function bound(cap, methods = [], authority = "reported") {
112159
112455
  return {
112160
112456
  kind: "cap",
@@ -112166,11 +112462,11 @@ function bound(cap, methods = [], authority = "reported") {
112166
112462
  function derived(cap, methods = []) {
112167
112463
  return bound(cap, methods, "derived");
112168
112464
  }
112169
- DeviceFeature.BatteryOperated, DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
112465
+ DeviceFeature.BatteryOperated, DeviceFeature.Sleeps, derived("low-power-sleep", ["wakeUp"]), DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, derived("resync", ["resync"]), DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
112170
112466
  "startTalkSession",
112171
112467
  "pushTalkAudio",
112172
112468
  "endTalkSession"
112173
- ]), DeviceFeature.PanTiltZoom, derived("ptz"), DeviceFeature.PtzAutotrack, derived("ptz-autotrack"), DeviceFeature.MotionTrigger, derived("motion-trigger", ["setMotionTrigger"]), DeviceFeature.TimedRun, derived("timed-run", ["runFor"]), DeviceFeature.Switch, DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired, DeviceFeature.ClimateDualSetpoint, DeviceFeature.ClimateHumidity, DeviceFeature.ClimateFanMode, DeviceFeature.ClimatePreset, DeviceFeature.ClimateSwingVertical, DeviceFeature.ClimateSwingHorizontal, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.CoverStoppable, DeviceFeature.ValvePositionable, DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.LockPinRequired, DeviceFeature.LockOpen, DeviceFeature.MediaPlayerSeek, DeviceFeature.MediaPlayerVolume, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerShuffle, DeviceFeature.MediaPlayerRepeat, DeviceFeature.MediaPlayerSelectSource, DeviceFeature.MediaPlayerPlayMedia, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerPower, DeviceFeature.AlarmPinRequired, DeviceFeature.PresenceGps, DeviceFeature.NotifierImage, DeviceFeature.NotifierPriority, DeviceFeature.NotifierData, DeviceFeature.NotifierActions, DeviceFeature.NotifierRecipients, DeviceFeature.ScriptVariables, DeviceFeature.AutomationSkipCondition, DeviceFeature.VacuumHasMap, DeviceFeature.VacuumHasAi, DeviceFeature.MowerHasMap, DeviceFeature.MowerHasTargetedMowing, DeviceFeature.Navigation, derived("navigation"), DeviceFeature.NetworkLink, derived("network-link");
112469
+ ]), DeviceFeature.PanTiltZoom, derived("ptz"), DeviceFeature.PtzAutotrack, derived("ptz-autotrack"), DeviceFeature.MotionTrigger, derived("motion-trigger", ["setMotionTrigger"]), DeviceFeature.TimedRun, derived("timed-run", ["runFor"]), DeviceFeature.Switch, DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired, DeviceFeature.ClimateDualSetpoint, DeviceFeature.ClimateHumidity, DeviceFeature.ClimateFanMode, DeviceFeature.ClimatePreset, DeviceFeature.ClimateSwingVertical, DeviceFeature.ClimateSwingHorizontal, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.CoverStoppable, DeviceFeature.ValvePositionable, DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.LockOpen, DeviceFeature.MediaPlayerSeek, DeviceFeature.MediaPlayerVolume, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerShuffle, DeviceFeature.MediaPlayerRepeat, DeviceFeature.MediaPlayerSelectSource, DeviceFeature.MediaPlayerPlayMedia, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerPower, DeviceFeature.PresenceGps, DeviceFeature.NotifierImage, DeviceFeature.NotifierPriority, DeviceFeature.NotifierData, DeviceFeature.NotifierActions, DeviceFeature.NotifierRecipients, DeviceFeature.ScriptVariables, DeviceFeature.AutomationSkipCondition, DeviceFeature.VacuumHasAi, DeviceFeature.MowerHasTargetedMowing, DeviceFeature.Navigation, derived("navigation"), DeviceFeature.NetworkLink, derived("network-link");
112174
112470
  var ALL_FEATURES = Object.values(DeviceFeature);
112175
112471
  new Set(ALL_FEATURES);
112176
112472
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
@@ -112509,11 +112805,6 @@ Object.freeze({
112509
112805
  form: "single",
112510
112806
  optional: false
112511
112807
  }],
112512
- "battery.wakeForStream": [{
112513
- name: "deviceId",
112514
- form: "single",
112515
- optional: false
112516
- }],
112517
112808
  "binary.getStatus": [{
112518
112809
  name: "deviceId",
112519
112810
  form: "single",
@@ -113697,6 +113988,16 @@ Object.freeze({
113697
113988
  form: "single",
113698
113989
  optional: true
113699
113990
  }],
113991
+ "lowPowerSleep.getStatus": [{
113992
+ name: "deviceId",
113993
+ form: "single",
113994
+ optional: false
113995
+ }],
113996
+ "lowPowerSleep.wakeUp": [{
113997
+ name: "deviceId",
113998
+ form: "single",
113999
+ optional: false
114000
+ }],
113700
114001
  "mediaPlayer.channelDown": [{
113701
114002
  name: "deviceId",
113702
114003
  form: "single",
@@ -114982,6 +115283,11 @@ Object.freeze({
114982
115283
  form: "single",
114983
115284
  optional: false
114984
115285
  }],
115286
+ "resync.resync": [{
115287
+ name: "deviceId",
115288
+ form: "single",
115289
+ optional: false
115290
+ }],
114985
115291
  "runningState.getStatus": [{
114986
115292
  name: "deviceId",
114987
115293
  form: "single",
@@ -146759,6 +147065,7 @@ var HmContainerDevice = class HmContainerDevice extends BaseDevice {
146759
147065
  constructor(ctx) {
146760
147066
  const cfg = hmContainerSchema.parse(ctx.persistedConfig ?? {});
146761
147067
  super(ctx, hmContainerSchema, { type: DeviceType.Container });
147068
+ this.ctx.registerNativeCap(resyncCapability, resyncThroughAdoption(this.ctx.api.deviceManager, this.id));
146762
147069
  this.address = cfg.address;
146763
147070
  this.integrationId = cfg.integrationId;
146764
147071
  const hmDevice = this.resolveHmDevice();