@camstack/addon-provider-reolink 1.2.243 → 1.2.245

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 CHANGED
@@ -100698,7 +100698,7 @@ function parseBaichuanWebhookObject(mess) {
100698
100698
  return parsed;
100699
100699
  }
100700
100700
  //#endregion
100701
- //#region ../types/dist/event-category-Hwx_JSCU.mjs
100701
+ //#region ../types/dist/event-category-7P4A3bYA.mjs
100702
100702
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
100703
100703
  EventCategory["SystemBoot"] = "system.boot";
100704
100704
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -100929,6 +100929,20 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
100929
100929
  * dropped) — consumers MUST also gate on the device record's `probed` flag.
100930
100930
  */
100931
100931
  EventCategory["DeviceReady"] = "device.ready";
100932
+ /**
100933
+ * An identity link (D1063) became `linked` — auto on strong evidence or
100934
+ * confirmed by the operator — or a confirmed link's evidence came back. Telemetry: the `identity-links` record is the
100935
+ * truth, and core-blocks reconciles its contributions from it as well.
100936
+ * Payload: `IdentityLinkEventPayload`.
100937
+ */
100938
+ EventCategory["IdentityLinkCreated"] = "identity-link.created";
100939
+ /**
100940
+ * A `linked` identity link stopped acting: its evidence is gone (an auto link
100941
+ * is deleted; an operator-confirmed one stays `linked`, flagged
100942
+ * `evidenceGone`, and no longer acts), a side was removed, or the operator
100943
+ * unlinked it. Payload: `IdentityLinkEventPayload` with `reason`.
100944
+ */
100945
+ EventCategory["IdentityLinkLost"] = "identity-link.lost";
100932
100946
  EventCategory["IntegrationEnabled"] = "integration.enabled";
100933
100947
  EventCategory["IntegrationDisabled"] = "integration.disabled";
100934
100948
  EventCategory["IntegrationDeleted"] = "integration.deleted";
@@ -101198,7 +101212,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
101198
101212
  */
101199
101213
  EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
101200
101214
  /**
101201
- * Emitted by the battery cap provider WHEN `wakeForStream` enters the
101215
+ * Emitted by the battery cap provider WHEN `wakeUp` enters the
101202
101216
  * "wake in progress" window — between the Baichuan wake-up issue and
101203
101217
  * the camera's first dialed-back RTP packet. The stream-broker
101204
101218
  * manager subscribes to flip the per-broker placeholder reason to
@@ -101530,7 +101544,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
101530
101544
  return EventCategory;
101531
101545
  }({});
101532
101546
  //#endregion
101533
- //#region ../types/dist/composed-stable-id-BBL71oUQ.mjs
101547
+ //#region ../types/dist/composed-stable-id-DIeNz933.mjs
101534
101548
  /**
101535
101549
  import { errMsg } from '@camstack/types'
101536
101550
  * Extract a human-readable message from an unknown error value.
@@ -101669,12 +101683,19 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
101669
101683
  return DeviceType;
101670
101684
  }({});
101671
101685
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
101686
+ /** The device reports a battery reading (the `battery` cap). Says nothing about sleep. */
101672
101687
  DeviceFeature["BatteryOperated"] = "battery-operated";
101688
+ /**
101689
+ * The device goes into low-power sleep and must be WOKEN before it streams
101690
+ * (the `low-power-sleep` cap, `wakeUp`). A battery reading alone is
101691
+ * not this: a battery sensor reports charge and never sleeps (#459, Q2).
101692
+ */
101693
+ DeviceFeature["Sleeps"] = "sleeps";
101673
101694
  DeviceFeature["Rebootable"] = "rebootable";
101674
101695
  /**
101675
101696
  * Device supports an on-demand re-sync of its derived spec with its
101676
- * upstream source — drives the generic Re-sync button. The owning
101677
- * provider implements the action via the `device-adoption.resync` cap.
101697
+ * upstream source — drives the generic Re-sync button. Present when the
101698
+ * device has the `resync` cap bound (#459, Q6).
101678
101699
  */
101679
101700
  DeviceFeature["Resyncable"] = "resyncable";
101680
101701
  DeviceFeature["NativeSnapshot"] = "native-snapshot";
@@ -101758,9 +101779,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
101758
101779
  DeviceFeature["FanDirection"] = "fan-direction";
101759
101780
  /** Fan exposes an oscillation toggle. */
101760
101781
  DeviceFeature["FanOscillating"] = "fan-oscillating";
101761
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
101762
- * field on the UI lock-controls panel. */
101763
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
101764
101782
  /** Lock supports a latch-release ("open door") action distinct from
101765
101783
  * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
101766
101784
  * `supported_features`. Gates the Open Door button in the UI. */
@@ -101791,8 +101809,6 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
101791
101809
  DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
101792
101810
  /** Media player exposes power on / off. */
101793
101811
  DeviceFeature["MediaPlayerPower"] = "media-player-power";
101794
- /** Alarm panel requires a PIN code on arm/disarm. */
101795
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
101796
101812
  /** Presence device carries GPS coordinates (lat/lng/accuracy) in
101797
101813
  * addition to a textual location. */
101798
101814
  DeviceFeature["PresenceGps"] = "presence-gps";
@@ -101812,15 +101828,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
101812
101828
  /** Automation `trigger` accepts a skipCondition flag — fires the
101813
101829
  * automation's actions while bypassing its condition block. */
101814
101830
  DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
101815
- /** Robot vacuum exposes a live cleaning map (image child). Gates the
101816
- * map tile in the vacuum UI. */
101817
- DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
101818
101831
  /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
101819
101832
  * switches group. */
101820
101833
  DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
101821
- /** Robot mower exposes a live mowing map (SVG image child). Gates the
101822
- * mower map tile. */
101823
- DeviceFeature["MowerHasMap"] = "mower-has-map";
101824
101834
  /** Robot mower exposes targeted mowing (all-area / zones / edges /
101825
101835
  * spots) — gates the Mow action + map selectors. */
101826
101836
  DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
@@ -101982,6 +101992,9 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
101982
101992
  /** A machine that runs workloads or is an appliance with its own OS: a
101983
101993
  * server, a hypervisor, a gateway console, a CCU. */
101984
101994
  DeviceRole["Host"] = "host";
101995
+ /** An uninterruptible power supply: battery charge, mains status and load. A
101996
+ * `DeviceType.Sensor` device. */
101997
+ DeviceRole["Ups"] = "ups";
101985
101998
  return DeviceRole;
101986
101999
  }({});
101987
102000
  /**
@@ -106808,7 +106821,7 @@ var ZodIssueCode = {
106808
106821
  var ZodFirstPartyTypeKind;
106809
106822
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
106810
106823
  //#endregion
106811
- //#region ../types/dist/sleep-D6Pih0Qt.mjs
106824
+ //#region ../types/dist/runtime-capabilities-qX7BpOYT.mjs
106812
106825
  /**
106813
106826
  * The audio chunk plane's byte format, and the ONE expansion from a coded
106814
106827
  * window to float samples (D455).
@@ -108024,6 +108037,18 @@ function isInstanceEnabled(body) {
108024
108037
  }
108025
108038
  /** The body key of the switch; only {@link RecordIntegrationInstances.setInstanceEnabled} writes it. */
108026
108039
  var SWITCH_KEY = "enabled";
108040
+ /**
108041
+ * The "Add device" mode an instance gets when its provider states none, from how the provider's
108042
+ * devices are found: `lan` scans, `account` adopts the account's children, anything else is manual.
108043
+ * The one place this default lives.
108044
+ */
108045
+ function defaultAddDeviceMode(description) {
108046
+ switch (description.discovery?.mode) {
108047
+ case "lan": return "scan";
108048
+ case "account": return "children";
108049
+ default: return "none";
108050
+ }
108051
+ }
108027
108052
  /** The keys of the kind's secret fields that sit at the top level of the body. */
108028
108053
  function topLevelSecretKeys(paths) {
108029
108054
  return new Set(paths.filter((p) => !p.includes(".") && !p.includes("[") && !p.includes("{")));
@@ -108126,6 +108151,7 @@ var RecordIntegrationInstances = class {
108126
108151
  enabled: isInstanceEnabled(record.data),
108127
108152
  formValues: shown,
108128
108153
  kind,
108154
+ addDevice: this.hooks.addDevice?.(record.data) ?? defaultAddDeviceMode(this.hooks.description),
108129
108155
  ...health?.status !== void 0 ? { status: health.status } : {},
108130
108156
  ...health?.lastCheckedAt !== void 0 ? { lastCheckedAt: health.lastCheckedAt } : {}
108131
108157
  };
@@ -111646,6 +111672,10 @@ var CAP_VOCABULARY_BY_NAME = {
111646
111672
  it: "Commuta {device}"
111647
111673
  },
111648
111674
  icon: "toggle-right",
111675
+ sideEffects: [{
111676
+ field: "on",
111677
+ negate: true
111678
+ }],
111649
111679
  offeredWhen: {
111650
111680
  method: "getOptions",
111651
111681
  field: "supportsSetState"
@@ -112760,7 +112790,15 @@ var CAP_VOCABULARY_BY_NAME = {
112760
112790
  effect: {
112761
112791
  field: "state",
112762
112792
  value: "locked"
112763
- }
112793
+ },
112794
+ hold: { effects: [{
112795
+ field: "state",
112796
+ value: "locking",
112797
+ when: {
112798
+ field: "state",
112799
+ notIn: ["locked"]
112800
+ }
112801
+ }] }
112764
112802
  },
112765
112803
  {
112766
112804
  id: "lock.unlock",
@@ -112789,7 +112827,15 @@ var CAP_VOCABULARY_BY_NAME = {
112789
112827
  effect: {
112790
112828
  field: "state",
112791
112829
  value: "unlocked"
112792
- }
112830
+ },
112831
+ hold: { effects: [{
112832
+ field: "state",
112833
+ value: "unlocking",
112834
+ when: {
112835
+ field: "state",
112836
+ notIn: ["unlocked"]
112837
+ }
112838
+ }] }
112793
112839
  },
112794
112840
  {
112795
112841
  id: "lock.open",
@@ -113103,6 +113149,14 @@ var CAP_VOCABULARY_BY_NAME = {
113103
113149
  step: .5,
113104
113150
  unit: "°C"
113105
113151
  }
113152
+ }],
113153
+ effect: {
113154
+ field: "targetLow",
113155
+ fromArg: "targetLow"
113156
+ },
113157
+ sideEffects: [{
113158
+ field: "targetHigh",
113159
+ fromArg: "targetHigh"
113106
113160
  }]
113107
113161
  },
113108
113162
  {
@@ -113159,7 +113213,11 @@ var CAP_VOCABULARY_BY_NAME = {
113159
113213
  from: "status",
113160
113214
  field: "availableFanModes"
113161
113215
  }
113162
- }]
113216
+ }],
113217
+ effect: {
113218
+ field: "fanMode",
113219
+ fromArg: "fanMode"
113220
+ }
113163
113221
  },
113164
113222
  {
113165
113223
  id: "climate.preset",
@@ -113184,7 +113242,11 @@ var CAP_VOCABULARY_BY_NAME = {
113184
113242
  from: "status",
113185
113243
  field: "availablePresets"
113186
113244
  }
113187
- }]
113245
+ }],
113246
+ effect: {
113247
+ field: "preset",
113248
+ fromArg: "preset"
113249
+ }
113188
113250
  },
113189
113251
  {
113190
113252
  id: "climate.swingVerticalOn",
@@ -113417,7 +113479,15 @@ var CAP_VOCABULARY_BY_NAME = {
113417
113479
  effect: {
113418
113480
  field: "speed",
113419
113481
  value: 100
113420
- }
113482
+ },
113483
+ sideEffects: [{
113484
+ field: "preset",
113485
+ value: "",
113486
+ when: {
113487
+ field: "preset",
113488
+ notIn: [""]
113489
+ }
113490
+ }]
113421
113491
  },
113422
113492
  {
113423
113493
  id: "fan.speed",
@@ -113448,7 +113518,15 @@ var CAP_VOCABULARY_BY_NAME = {
113448
113518
  effect: {
113449
113519
  field: "speed",
113450
113520
  fromArg: "speed"
113451
- }
113521
+ },
113522
+ sideEffects: [{
113523
+ field: "preset",
113524
+ value: "",
113525
+ when: {
113526
+ field: "preset",
113527
+ notIn: [""]
113528
+ }
113529
+ }]
113452
113530
  },
113453
113531
  {
113454
113532
  id: "fan.preset",
@@ -113473,7 +113551,11 @@ var CAP_VOCABULARY_BY_NAME = {
113473
113551
  from: "status",
113474
113552
  field: "availablePresets"
113475
113553
  }
113476
- }]
113554
+ }],
113555
+ effect: {
113556
+ field: "preset",
113557
+ fromArg: "preset"
113558
+ }
113477
113559
  },
113478
113560
  {
113479
113561
  id: "fan.forward",
@@ -114018,7 +114100,15 @@ var CAP_VOCABULARY_BY_NAME = {
114018
114100
  effect: {
114019
114101
  field: "state",
114020
114102
  value: "disarmed"
114021
- }
114103
+ },
114104
+ hold: { effects: [{
114105
+ field: "state",
114106
+ value: "disarming",
114107
+ when: {
114108
+ field: "state",
114109
+ notIn: ["disarmed"]
114110
+ }
114111
+ }] }
114022
114112
  },
114023
114113
  {
114024
114114
  id: "alarm.arm.home",
@@ -114048,7 +114138,15 @@ var CAP_VOCABULARY_BY_NAME = {
114048
114138
  effect: {
114049
114139
  field: "state",
114050
114140
  value: "armed_home"
114051
- }
114141
+ },
114142
+ hold: { effects: [{
114143
+ field: "state",
114144
+ value: "arming",
114145
+ when: {
114146
+ field: "state",
114147
+ notIn: ["armed_home"]
114148
+ }
114149
+ }] }
114052
114150
  },
114053
114151
  {
114054
114152
  id: "alarm.arm.away",
@@ -114078,7 +114176,15 @@ var CAP_VOCABULARY_BY_NAME = {
114078
114176
  effect: {
114079
114177
  field: "state",
114080
114178
  value: "armed_away"
114081
- }
114179
+ },
114180
+ hold: { effects: [{
114181
+ field: "state",
114182
+ value: "arming",
114183
+ when: {
114184
+ field: "state",
114185
+ notIn: ["armed_away"]
114186
+ }
114187
+ }] }
114082
114188
  },
114083
114189
  {
114084
114190
  id: "alarm.arm.night",
@@ -114108,7 +114214,15 @@ var CAP_VOCABULARY_BY_NAME = {
114108
114214
  effect: {
114109
114215
  field: "state",
114110
114216
  value: "armed_night"
114111
- }
114217
+ },
114218
+ hold: { effects: [{
114219
+ field: "state",
114220
+ value: "arming",
114221
+ when: {
114222
+ field: "state",
114223
+ notIn: ["armed_night"]
114224
+ }
114225
+ }] }
114112
114226
  },
114113
114227
  {
114114
114228
  id: "alarm.arm.vacation",
@@ -114138,7 +114252,15 @@ var CAP_VOCABULARY_BY_NAME = {
114138
114252
  effect: {
114139
114253
  field: "state",
114140
114254
  value: "armed_vacation"
114141
- }
114255
+ },
114256
+ hold: { effects: [{
114257
+ field: "state",
114258
+ value: "arming",
114259
+ when: {
114260
+ field: "state",
114261
+ notIn: ["armed_vacation"]
114262
+ }
114263
+ }] }
114142
114264
  },
114143
114265
  {
114144
114266
  id: "alarm.arm.custom_bypass",
@@ -114168,7 +114290,15 @@ var CAP_VOCABULARY_BY_NAME = {
114168
114290
  effect: {
114169
114291
  field: "state",
114170
114292
  value: "armed_custom_bypass"
114171
- }
114293
+ },
114294
+ hold: { effects: [{
114295
+ field: "state",
114296
+ value: "arming",
114297
+ when: {
114298
+ field: "state",
114299
+ notIn: ["armed_custom_bypass"]
114300
+ }
114301
+ }] }
114172
114302
  }
114173
114303
  ],
114174
114304
  state: [{
@@ -115310,7 +115440,14 @@ var CAP_VOCABULARY_BY_NAME = {
115310
115440
  quantity: "mass"
115311
115441
  },
115312
115442
  optional: true
115313
- }]
115443
+ }],
115444
+ hold: {
115445
+ effects: [{
115446
+ field: "feeding",
115447
+ value: true
115448
+ }],
115449
+ holdMs: 1e4
115450
+ }
115314
115451
  },
115315
115452
  {
115316
115453
  id: "petFeeder.feedHoppers",
@@ -115354,7 +115491,14 @@ var CAP_VOCABULARY_BY_NAME = {
115354
115491
  quantity: "mass"
115355
115492
  },
115356
115493
  optional: true
115357
- }]
115494
+ }],
115495
+ hold: {
115496
+ effects: [{
115497
+ field: "feeding",
115498
+ value: true
115499
+ }],
115500
+ holdMs: 1e4
115501
+ }
115358
115502
  },
115359
115503
  {
115360
115504
  id: "petFeeder.cancelFeed",
@@ -115445,7 +115589,11 @@ var CAP_VOCABULARY_BY_NAME = {
115445
115589
  it: "Attiva il blocco bambini di {device}"
115446
115590
  },
115447
115591
  icon: "lock",
115448
- args: { on: true }
115592
+ args: { on: true },
115593
+ effect: {
115594
+ field: "childLock",
115595
+ value: true
115596
+ }
115449
115597
  },
115450
115598
  {
115451
115599
  id: "petFeeder.childLockOff",
@@ -115459,7 +115607,11 @@ var CAP_VOCABULARY_BY_NAME = {
115459
115607
  it: "Disattiva il blocco bambini di {device}"
115460
115608
  },
115461
115609
  icon: "lock-open",
115462
- args: { on: false }
115610
+ args: { on: false },
115611
+ effect: {
115612
+ field: "childLock",
115613
+ value: false
115614
+ }
115463
115615
  },
115464
115616
  {
115465
115617
  id: "petFeeder.lightOn",
@@ -115473,7 +115625,11 @@ var CAP_VOCABULARY_BY_NAME = {
115473
115625
  it: "Accendi la spia di {device}"
115474
115626
  },
115475
115627
  icon: "lightbulb",
115476
- args: { on: true }
115628
+ args: { on: true },
115629
+ effect: {
115630
+ field: "indicatorLight",
115631
+ value: true
115632
+ }
115477
115633
  },
115478
115634
  {
115479
115635
  id: "petFeeder.lightOff",
@@ -115487,7 +115643,11 @@ var CAP_VOCABULARY_BY_NAME = {
115487
115643
  it: "Spegni la spia di {device}"
115488
115644
  },
115489
115645
  icon: "lightbulb-off",
115490
- args: { on: false }
115646
+ args: { on: false },
115647
+ effect: {
115648
+ field: "indicatorLight",
115649
+ value: false
115650
+ }
115491
115651
  },
115492
115652
  {
115493
115653
  id: "petFeeder.feedSoundOn",
@@ -115501,7 +115661,11 @@ var CAP_VOCABULARY_BY_NAME = {
115501
115661
  it: "Attiva il suono di erogazione di {device}"
115502
115662
  },
115503
115663
  icon: "volume-2",
115504
- args: { on: true }
115664
+ args: { on: true },
115665
+ effect: {
115666
+ field: "feedSound",
115667
+ value: true
115668
+ }
115505
115669
  },
115506
115670
  {
115507
115671
  id: "petFeeder.feedSoundOff",
@@ -115515,7 +115679,11 @@ var CAP_VOCABULARY_BY_NAME = {
115515
115679
  it: "Disattiva il suono di erogazione di {device}"
115516
115680
  },
115517
115681
  icon: "volume-x",
115518
- args: { on: false }
115682
+ args: { on: false },
115683
+ effect: {
115684
+ field: "feedSound",
115685
+ value: false
115686
+ }
115519
115687
  },
115520
115688
  {
115521
115689
  id: "petFeeder.volume",
@@ -115540,7 +115708,11 @@ var CAP_VOCABULARY_BY_NAME = {
115540
115708
  min: 0,
115541
115709
  step: 1
115542
115710
  }
115543
- }]
115711
+ }],
115712
+ effect: {
115713
+ field: "volume",
115714
+ fromArg: "level"
115715
+ }
115544
115716
  }
115545
115717
  ],
115546
115718
  state: [
@@ -115612,7 +115784,11 @@ var CAP_VOCABULARY_BY_NAME = {
115612
115784
  it: "Avvia la pompa di {device}"
115613
115785
  },
115614
115786
  icon: "play",
115615
- args: { on: true }
115787
+ args: { on: true },
115788
+ effect: {
115789
+ field: "pumpRunning",
115790
+ value: true
115791
+ }
115616
115792
  }, {
115617
115793
  id: "petFountain.pumpOff",
115618
115794
  method: "setPump",
@@ -115625,7 +115801,11 @@ var CAP_VOCABULARY_BY_NAME = {
115625
115801
  it: "Ferma la pompa di {device}"
115626
115802
  },
115627
115803
  icon: "square",
115628
- args: { on: false }
115804
+ args: { on: false },
115805
+ effect: {
115806
+ field: "pumpRunning",
115807
+ value: false
115808
+ }
115629
115809
  }],
115630
115810
  state: [{
115631
115811
  kind: "boolean",
@@ -115677,7 +115857,11 @@ var CAP_VOCABULARY_BY_NAME = {
115677
115857
  it: "Fai lavorare la pompa di {device} a ciclo acceso/spento"
115678
115858
  },
115679
115859
  icon: "timer",
115680
- args: { on: true }
115860
+ args: { on: true },
115861
+ effect: {
115862
+ field: "enabled",
115863
+ value: true
115864
+ }
115681
115865
  },
115682
115866
  {
115683
115867
  id: "pumpCycle.off",
@@ -115691,7 +115875,11 @@ var CAP_VOCABULARY_BY_NAME = {
115691
115875
  it: "Fai lavorare la pompa di {device} in continuo"
115692
115876
  },
115693
115877
  icon: "timer-off",
115694
- args: { on: false }
115878
+ args: { on: false },
115879
+ effect: {
115880
+ field: "enabled",
115881
+ value: false
115882
+ }
115695
115883
  },
115696
115884
  {
115697
115885
  id: "pumpCycle.onMinutes",
@@ -115717,7 +115905,12 @@ var CAP_VOCABULARY_BY_NAME = {
115717
115905
  step: 1,
115718
115906
  unit: "min"
115719
115907
  }
115720
- }]
115908
+ }],
115909
+ effect: {
115910
+ field: "onTime",
115911
+ fromArg: "minutes",
115912
+ scale: 60
115913
+ }
115721
115914
  },
115722
115915
  {
115723
115916
  id: "pumpCycle.offMinutes",
@@ -115743,7 +115936,12 @@ var CAP_VOCABULARY_BY_NAME = {
115743
115936
  step: 1,
115744
115937
  unit: "min"
115745
115938
  }
115746
- }]
115939
+ }],
115940
+ effect: {
115941
+ field: "offTime",
115942
+ fromArg: "minutes",
115943
+ scale: 60
115944
+ }
115747
115945
  }
115748
115946
  ],
115749
115947
  state: [{
@@ -115860,7 +116058,11 @@ var CAP_VOCABULARY_BY_NAME = {
115860
116058
  en: "Play on {device}",
115861
116059
  it: "Avvia la riproduzione su {device}"
115862
116060
  },
115863
- icon: "play"
116061
+ icon: "play",
116062
+ effect: {
116063
+ field: "state",
116064
+ value: "playing"
116065
+ }
115864
116066
  },
115865
116067
  {
115866
116068
  id: "media.pause",
@@ -115873,7 +116075,11 @@ var CAP_VOCABULARY_BY_NAME = {
115873
116075
  en: "Pause {device}",
115874
116076
  it: "Metti in pausa {device}"
115875
116077
  },
115876
- icon: "pause"
116078
+ icon: "pause",
116079
+ effect: {
116080
+ field: "state",
116081
+ value: "paused"
116082
+ }
115877
116083
  },
115878
116084
  {
115879
116085
  id: "media.stop",
@@ -115939,7 +116145,11 @@ var CAP_VOCABULARY_BY_NAME = {
115939
116145
  step: 1,
115940
116146
  unit: "%"
115941
116147
  }
115942
- }]
116148
+ }],
116149
+ effect: {
116150
+ field: "volumeLevel",
116151
+ fromArg: "volumeLevel"
116152
+ }
115943
116153
  },
115944
116154
  {
115945
116155
  id: "media.mute",
@@ -115953,7 +116163,11 @@ var CAP_VOCABULARY_BY_NAME = {
115953
116163
  it: "Silenzia {device}"
115954
116164
  },
115955
116165
  icon: "volume-x",
115956
- args: { muted: true }
116166
+ args: { muted: true },
116167
+ effect: {
116168
+ field: "isMuted",
116169
+ value: true
116170
+ }
115957
116171
  },
115958
116172
  {
115959
116173
  id: "media.unmute",
@@ -115967,7 +116181,11 @@ var CAP_VOCABULARY_BY_NAME = {
115967
116181
  it: "Riattiva l’audio di {device}"
115968
116182
  },
115969
116183
  icon: "volume-2",
115970
- args: { muted: false }
116184
+ args: { muted: false },
116185
+ effect: {
116186
+ field: "isMuted",
116187
+ value: false
116188
+ }
115971
116189
  },
115972
116190
  {
115973
116191
  id: "media.shuffleOn",
@@ -115981,7 +116199,11 @@ var CAP_VOCABULARY_BY_NAME = {
115981
116199
  it: "Attiva la riproduzione casuale su {device}"
115982
116200
  },
115983
116201
  icon: "shuffle",
115984
- args: { shuffle: true }
116202
+ args: { shuffle: true },
116203
+ effect: {
116204
+ field: "shuffle",
116205
+ value: true
116206
+ }
115985
116207
  },
115986
116208
  {
115987
116209
  id: "media.shuffleOff",
@@ -115995,7 +116217,11 @@ var CAP_VOCABULARY_BY_NAME = {
115995
116217
  it: "Disattiva la riproduzione casuale su {device}"
115996
116218
  },
115997
116219
  icon: "shuffle",
115998
- args: { shuffle: false }
116220
+ args: { shuffle: false },
116221
+ effect: {
116222
+ field: "shuffle",
116223
+ value: false
116224
+ }
115999
116225
  },
116000
116226
  {
116001
116227
  id: "media.repeat",
@@ -116041,7 +116267,11 @@ var CAP_VOCABULARY_BY_NAME = {
116041
116267
  }
116042
116268
  ]
116043
116269
  }
116044
- }]
116270
+ }],
116271
+ effect: {
116272
+ field: "repeat",
116273
+ fromArg: "repeat"
116274
+ }
116045
116275
  },
116046
116276
  {
116047
116277
  id: "media.source",
@@ -116066,7 +116296,11 @@ var CAP_VOCABULARY_BY_NAME = {
116066
116296
  from: "status",
116067
116297
  field: "availableSources"
116068
116298
  }
116069
- }]
116299
+ }],
116300
+ effect: {
116301
+ field: "source",
116302
+ fromArg: "source"
116303
+ }
116070
116304
  },
116071
116305
  {
116072
116306
  id: "media.seek",
@@ -116606,7 +116840,14 @@ var CAP_VOCABULARY_BY_NAME = {
116606
116840
  en: "Run {device}",
116607
116841
  it: "Esegui {device}"
116608
116842
  },
116609
- icon: "scroll-text"
116843
+ icon: "scroll-text",
116844
+ hold: {
116845
+ effects: [{
116846
+ field: "isRunning",
116847
+ value: true
116848
+ }],
116849
+ holdMs: 1e4
116850
+ }
116610
116851
  }, {
116611
116852
  id: "script.stop",
116612
116853
  method: "stop",
@@ -116618,7 +116859,11 @@ var CAP_VOCABULARY_BY_NAME = {
116618
116859
  en: "Stop {device}",
116619
116860
  it: "Ferma {device}"
116620
116861
  },
116621
- icon: "square"
116862
+ icon: "square",
116863
+ effect: {
116864
+ field: "isRunning",
116865
+ value: false
116866
+ }
116622
116867
  }],
116623
116868
  state: [{
116624
116869
  kind: "boolean",
@@ -116656,7 +116901,11 @@ var CAP_VOCABULARY_BY_NAME = {
116656
116901
  en: "Enable {device}",
116657
116902
  it: "Abilita {device}"
116658
116903
  },
116659
- icon: "toggle-right"
116904
+ icon: "toggle-right",
116905
+ effect: {
116906
+ field: "enabled",
116907
+ value: true
116908
+ }
116660
116909
  },
116661
116910
  {
116662
116911
  id: "haAutomation.disable",
@@ -116669,7 +116918,11 @@ var CAP_VOCABULARY_BY_NAME = {
116669
116918
  en: "Disable {device}",
116670
116919
  it: "Disabilita {device}"
116671
116920
  },
116672
- icon: "toggle-left"
116921
+ icon: "toggle-left",
116922
+ effect: {
116923
+ field: "enabled",
116924
+ value: false
116925
+ }
116673
116926
  },
116674
116927
  {
116675
116928
  id: "haAutomation.trigger",
@@ -118263,6 +118516,25 @@ var CAP_VOCABULARY_BY_NAME = {
118263
118516
  icon: "refresh-cw"
118264
118517
  }]
118265
118518
  },
118519
+ "resync": {
118520
+ scope: "device",
118521
+ noun: {
118522
+ en: "Re-sync",
118523
+ it: "Risincronizzazione"
118524
+ },
118525
+ notOperatorFacing: { resync: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action" }
118526
+ },
118527
+ "device-state-refresh": {
118528
+ scope: "device",
118529
+ noun: {
118530
+ en: "State refresh",
118531
+ it: "Aggiornamento dello stato"
118532
+ },
118533
+ notOperatorFacing: {
118534
+ refresh: "the core schedules state refreshes itself; an operator never asks for one",
118535
+ resubscribe: "the core schedules state refreshes itself; an operator never asks for one"
118536
+ }
118537
+ },
118266
118538
  "recording": {
118267
118539
  scope: "device",
118268
118540
  noun: {
@@ -120274,7 +120546,6 @@ var CAP_VOCABULARY_BY_NAME = {
120274
120546
  en: "Battery",
120275
120547
  it: "Batteria"
120276
120548
  },
120277
- notOperatorFacing: { wakeForStream: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" },
120278
120549
  state: [
120279
120550
  {
120280
120551
  kind: "numeric",
@@ -120384,6 +120655,14 @@ var CAP_VOCABULARY_BY_NAME = {
120384
120655
  icon: "moon"
120385
120656
  }]
120386
120657
  },
120658
+ "low-power-sleep": {
120659
+ scope: "device",
120660
+ noun: {
120661
+ en: "Low-power sleep",
120662
+ it: "Sospensione a basso consumo"
120663
+ },
120664
+ notOperatorFacing: { wakeUp: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage" }
120665
+ },
120387
120666
  "network-link": {
120388
120667
  scope: "device",
120389
120668
  noun: {
@@ -121244,6 +121523,7 @@ var CAP_NAMES = Object.freeze([
121244
121523
  "device-removal-hook",
121245
121524
  "device-runs",
121246
121525
  "device-state",
121526
+ "device-state-refresh",
121247
121527
  "device-status",
121248
121528
  "device-transitions",
121249
121529
  "dishwasher",
@@ -121289,6 +121569,7 @@ var CAP_NAMES = Object.freeze([
121289
121569
  "log-channels",
121290
121570
  "log-destination",
121291
121571
  "login-method",
121572
+ "low-power-sleep",
121292
121573
  "media-player",
121293
121574
  "mesh-network",
121294
121575
  "meter",
@@ -121342,6 +121623,7 @@ var CAP_NAMES = Object.freeze([
121342
121623
  "records",
121343
121624
  "remote",
121344
121625
  "remote-layout-components",
121626
+ "resync",
121345
121627
  "running-state",
121346
121628
  "scene-monitor",
121347
121629
  "schedulers",
@@ -121445,7 +121727,7 @@ Object.freeze({
121445
121727
  ]
121446
121728
  },
121447
121729
  {
121448
- "path": "requiresCode",
121730
+ "path": "codeRequired",
121449
121731
  "valueType": "boolean"
121450
121732
  }
121451
121733
  ],
@@ -122513,7 +122795,24 @@ Object.freeze({
122513
122795
  "jammed",
122514
122796
  "door-open"
122515
122797
  ]
122798
+ }, {
122799
+ "path": "codeRequired",
122800
+ "valueType": "boolean"
122516
122801
  }],
122802
+ "low-power-sleep": [
122803
+ {
122804
+ "path": "sleeping",
122805
+ "valueType": "boolean"
122806
+ },
122807
+ {
122808
+ "path": "lastContactAt",
122809
+ "valueType": "number"
122810
+ },
122811
+ {
122812
+ "path": "lastUpdated",
122813
+ "valueType": "number"
122814
+ }
122815
+ ],
122517
122816
  "media-player": [
122518
122817
  {
122519
122818
  "path": "state",
@@ -122865,6 +123164,10 @@ Object.freeze({
122865
123164
  "path": "power",
122866
123165
  "valueType": "number"
122867
123166
  },
123167
+ {
123168
+ "path": "deliveredPower",
123169
+ "valueType": "number"
123170
+ },
122868
123171
  {
122869
123172
  "path": "energy",
122870
123173
  "valueType": "number"
@@ -123707,7 +124010,7 @@ function sleep(ms) {
123707
124010
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
123708
124011
  }
123709
124012
  //#endregion
123710
- //#region ../types/dist/implemented-methods-u7ddjc-_.mjs
124013
+ //#region ../types/dist/implemented-methods-wFScvZ40.mjs
123711
124014
  /**
123712
124015
  * The ffmpeg build every CamStack node downloads, per platform and arch.
123713
124016
  *
@@ -124867,6 +125170,8 @@ var CompositionItemEntrySchema = object({
124867
125170
  */
124868
125171
  reset: CompositionForwardCommandSchema.optional()
124869
125172
  });
125173
+ /** Which identity link added a feature (D1063). */
125174
+ var CompositionContributedBySchema = object({ linkId: string().min(1) });
124870
125175
  var CompositionFeatureSchema = discriminatedUnion("kind", [object({
124871
125176
  kind: literal("fields"),
124872
125177
  cap: string().min(1),
@@ -124878,7 +125183,14 @@ var CompositionFeatureSchema = discriminatedUnion("kind", [object({
124878
125183
  */
124879
125184
  items: record(string().regex(COMPOSITION_ITEM_KEY_RE), CompositionItemEntrySchema).refine((items) => Object.keys(items).length <= 16, { message: `at most 16 items` }).optional(),
124880
125185
  /** Method name → what serves it. Only a BUILT capability takes commands (D967). */
124881
- commands: record(string().min(1), CompositionCommandTargetSchema).optional()
125186
+ commands: record(string().min(1), CompositionCommandTargetSchema).optional(),
125187
+ /**
125188
+ * Provenance only (D1063): the identity link that added this feature. The
125189
+ * source ref stays in `fields`; `enabled` stays the operator's switch. An
125190
+ * operator edit of the source drops the stamp and the feature becomes the
125191
+ * operator's; a lost link removes only stamped features.
125192
+ */
125193
+ contributedBy: CompositionContributedBySchema.optional()
124882
125194
  }), object({
124883
125195
  kind: literal("passthrough"),
124884
125196
  cap: string().min(1),
@@ -127567,7 +127879,7 @@ function ordinalOf(id) {
127567
127879
  function defaultIntegrationOf(integrations, eligible) {
127568
127880
  return [...eligible === void 0 ? integrations : integrations.filter(eligible)].sort((a, b) => ordinalOf(a.id) - ordinalOf(b.id) || (a.id < b.id ? -1 : 1))[0] ?? null;
127569
127881
  }
127570
- function unstamped(device) {
127882
+ function unstamped$1(device) {
127571
127883
  return device.integrationId === void 0 || device.integrationId === null || device.integrationId === "";
127572
127884
  }
127573
127885
  /**
@@ -127584,8 +127896,8 @@ async function claimDevicesToDefaultIntegration(ports, spec) {
127584
127896
  const all = await ports.listDevices(spec.addonId);
127585
127897
  const byId = new Map(all.map((d) => [d.id, d]));
127586
127898
  const reservations = /* @__PURE__ */ new Set();
127587
- for (const device of all) if (unstamped(device) && await isReservation(ports, device)) reservations.add(device.id);
127588
- const orphans = all.filter((d) => unstamped(d) && !reservations.has(d.id));
127899
+ for (const device of all) if (unstamped$1(device) && await isReservation(ports, device)) reservations.add(device.id);
127900
+ const orphans = all.filter((d) => unstamped$1(d) && !reservations.has(d.id));
127589
127901
  const summaryBase = { reservations: reservations.size };
127590
127902
  if (orphans.length === 0) return {
127591
127903
  outcome: "already-done",
@@ -127600,7 +127912,7 @@ async function claimDevicesToDefaultIntegration(ports, spec) {
127600
127912
  const unresolved = /* @__PURE__ */ new Set();
127601
127913
  const failed = /* @__PURE__ */ new Set();
127602
127914
  const resolve = (device, seen) => {
127603
- if (!unstamped(device)) return device.integrationId ?? null;
127915
+ if (!unstamped$1(device)) return device.integrationId ?? null;
127604
127916
  const planned = plan.get(device.id);
127605
127917
  if (planned !== void 0) return planned;
127606
127918
  if (failed.has(device.id)) return null;
@@ -150897,6 +151209,67 @@ object({
150897
151209
  /** Namespaces the client listed that no longer exist. */
150898
151210
  deleted: array(PreferenceNamespaceSchema)
150899
151211
  });
151212
+ /**
151213
+ * The wire shapes of `apiCatalog.*` — the API explorer's data (planning#595).
151214
+ *
151215
+ * One entry per tRPC method the hub serves, capability and core routes alike,
151216
+ * read off the live router by the hub (never a hand-written list).
151217
+ */
151218
+ var ApiProcedureKindSchema = _enum([
151219
+ "query",
151220
+ "mutation",
151221
+ "subscription"
151222
+ ]);
151223
+ /** The gate a method runs behind. */
151224
+ var ApiProcedureTierSchema = _enum([
151225
+ "public",
151226
+ "protected",
151227
+ "admin"
151228
+ ]);
151229
+ /** The token scope a capability route is matched against (its `METHOD_ACCESS_MAP` row). */
151230
+ var ApiCatalogScopeSchema = object({
151231
+ capName: string(),
151232
+ capScope: _enum(["device", "system"]),
151233
+ access: _enum([
151234
+ "view",
151235
+ "create",
151236
+ "delete"
151237
+ ]),
151238
+ role: string()
151239
+ });
151240
+ var ApiCatalogEntrySchema = object({
151241
+ /** `<router>.<method>` — the tRPC path. */
151242
+ path: string(),
151243
+ router: string(),
151244
+ method: string(),
151245
+ kind: ApiProcedureKindSchema,
151246
+ tier: ApiProcedureTierSchema,
151247
+ source: _enum(["capability", "core"]),
151248
+ /** `null` on a core route: it needs authentication only (plus admin where its tier says so). */
151249
+ scope: ApiCatalogScopeSchema.nullable(),
151250
+ hasInput: boolean()
151251
+ });
151252
+ /**
151253
+ * May the CALLER call a method. The list has no input, so a method reached
151254
+ * only through a device grant is `per-device`: the real call is allowed or
151255
+ * refused on the device its input names.
151256
+ */
151257
+ var ApiCallableSchema = _enum([
151258
+ "yes",
151259
+ "no",
151260
+ "per-device"
151261
+ ]);
151262
+ object({ methods: array(ApiCatalogEntrySchema.extend({ callable: ApiCallableSchema })) });
151263
+ /** A JSON Schema document, as the explorer receives it. */
151264
+ var JsonSchemaDocumentSchema = record(string(), unknown());
151265
+ object({
151266
+ path: string(),
151267
+ hasInput: boolean(),
151268
+ /** The INPUT JSON schema (what the caller sends); `null` without input or when it could not be produced. */
151269
+ schema: JsonSchemaDocumentSchema.nullable(),
151270
+ /** Why no schema could be produced (a non-Zod parser, an unrepresentable type). */
151271
+ error: string().nullable()
151272
+ });
150900
151273
  _enum(["new-session", "step-up"]);
150901
151274
  /** The languages the hub's app landing pages are written in (D858). */
150902
151275
  var AppPageLangSchema = _enum(["en", "it"]);
@@ -154642,9 +155015,8 @@ var airQualitySensorCapability = {
154642
155015
  * Many panels require a PIN code on arm / disarm — the optional
154643
155016
  * `code` field on the methods passes it through to the upstream
154644
155017
  * service; it's NEVER persisted in the runtime slice or any event
154645
- * payload. The presence of a required code is signalled by
154646
- * `DeviceFeature.AlarmPinRequired` so the UI gates a code-entry
154647
- * field without a slice fetch.
155018
+ * payload. Whether a code is required is the slice's `codeRequired`
155019
+ * (#459): `null` when the provider cannot tell (D393).
154648
155020
  *
154649
155021
  * `availableModes` mirrors HA's `supported_features`-derived arm
154650
155022
  * mode list — the UI renders only the buttons the panel accepts.
@@ -154683,9 +155055,13 @@ var AlarmPanelStatusSchema = object({
154683
155055
  /** Subset of arm modes the panel accepts. UI renders one button per
154684
155056
  * mode in this list. */
154685
155057
  availableModes: array(AlarmArmModeSchema),
154686
- /** Whether the panel requires a PIN on arm / disarm. Mirrors
154687
- * `DeviceFeature.AlarmPinRequired` for slice consumers. */
154688
- requiresCode: boolean(),
155058
+ /**
155059
+ * Whether the panel requires a PIN on arm / disarm (#459; the field was
155060
+ * `requiresCode`, and the `alarm-pin-required` device feature is gone).
155061
+ * `null` = the provider cannot tell (D393), never `false`. A slice restored
155062
+ * from before the rename is upgraded at boot by `restoredFieldRenames`.
155063
+ */
155064
+ codeRequired: boolean().nullable(),
154689
155065
  /** Ms epoch when the slice was last updated. */
154690
155066
  lastChangedAt: number$1()
154691
155067
  });
@@ -154728,6 +155104,14 @@ var alarmPanelCapability = {
154728
155104
  field: "state",
154729
155105
  value: "disarmed"
154730
155106
  },
155107
+ hold: { effects: [{
155108
+ field: "state",
155109
+ value: "disarming",
155110
+ when: {
155111
+ field: "state",
155112
+ notIn: ["disarmed"]
155113
+ }
155114
+ }] },
154731
155115
  openArgs: [{
154732
155116
  key: "code",
154733
155117
  label: t("PIN code", "Codice PIN"),
@@ -154742,7 +155126,7 @@ var alarmPanelCapability = {
154742
155126
  arm: method(object({
154743
155127
  deviceId: number$1().int().nonnegative(),
154744
155128
  mode: AlarmArmModeSchema,
154745
- /** Optional PIN code. Required when `requiresCode === true`.
155129
+ /** Optional PIN code. Required when `codeRequired === true`.
154746
155130
  * Passed through to the upstream service; never persisted. */
154747
155131
  code: string().min(1).optional()
154748
155132
  }), _void(), {
@@ -154758,6 +155142,14 @@ var alarmPanelCapability = {
154758
155142
  field: "state",
154759
155143
  value: "armed_home"
154760
155144
  },
155145
+ hold: { effects: [{
155146
+ field: "state",
155147
+ value: "arming",
155148
+ when: {
155149
+ field: "state",
155150
+ notIn: ["armed_home"]
155151
+ }
155152
+ }] },
154761
155153
  args: { mode: "home" },
154762
155154
  openArgs: [{
154763
155155
  key: "code",
@@ -154778,6 +155170,14 @@ var alarmPanelCapability = {
154778
155170
  field: "state",
154779
155171
  value: "armed_away"
154780
155172
  },
155173
+ hold: { effects: [{
155174
+ field: "state",
155175
+ value: "arming",
155176
+ when: {
155177
+ field: "state",
155178
+ notIn: ["armed_away"]
155179
+ }
155180
+ }] },
154781
155181
  args: { mode: "away" },
154782
155182
  openArgs: [{
154783
155183
  key: "code",
@@ -154798,6 +155198,14 @@ var alarmPanelCapability = {
154798
155198
  field: "state",
154799
155199
  value: "armed_night"
154800
155200
  },
155201
+ hold: { effects: [{
155202
+ field: "state",
155203
+ value: "arming",
155204
+ when: {
155205
+ field: "state",
155206
+ notIn: ["armed_night"]
155207
+ }
155208
+ }] },
154801
155209
  args: { mode: "night" },
154802
155210
  openArgs: [{
154803
155211
  key: "code",
@@ -154818,6 +155226,14 @@ var alarmPanelCapability = {
154818
155226
  field: "state",
154819
155227
  value: "armed_vacation"
154820
155228
  },
155229
+ hold: { effects: [{
155230
+ field: "state",
155231
+ value: "arming",
155232
+ when: {
155233
+ field: "state",
155234
+ notIn: ["armed_vacation"]
155235
+ }
155236
+ }] },
154821
155237
  args: { mode: "vacation" },
154822
155238
  openArgs: [{
154823
155239
  key: "code",
@@ -154838,6 +155254,14 @@ var alarmPanelCapability = {
154838
155254
  field: "state",
154839
155255
  value: "armed_custom_bypass"
154840
155256
  },
155257
+ hold: { effects: [{
155258
+ field: "state",
155259
+ value: "arming",
155260
+ when: {
155261
+ field: "state",
155262
+ notIn: ["armed_custom_bypass"]
155263
+ }
155264
+ }] },
154841
155265
  args: { mode: "custom_bypass" },
154842
155266
  openArgs: [{
154843
155267
  key: "code",
@@ -154859,7 +155283,7 @@ var alarmPanelCapability = {
154859
155283
  /**
154860
155284
  * Runtime-state slice — mirrored by the kernel. UI panel reads the
154861
155285
  * full slice; renders an arm button per `availableModes` entry and
154862
- * a PIN field iff `requiresCode === true`.
155286
+ * a PIN field iff `codeRequired === true`.
154863
155287
  */
154864
155288
  runtimeState: AlarmPanelStatusSchema,
154865
155289
  /**
@@ -154870,6 +155294,13 @@ var alarmPanelCapability = {
154870
155294
  */
154871
155295
  durability: "restored",
154872
155296
  /**
155297
+ * A slice persisted before #459 carries `requiresCode`; the boot seed reads it
155298
+ * once into `codeRequired` (`restoredPart`), so no reader meets the old key,
155299
+ * and rewrites the row once without it (`seedMirrorFromRow`) — so this entry
155300
+ * can be dropped after every node has booted once on a release that has it.
155301
+ */
155302
+ restoredFieldRenames: { requiresCode: "codeRequired" },
155303
+ /**
154873
155304
  * History (D850): the panel's lifecycle state as an `enum` series —
154874
155305
  * change-only, no floor, so an `arming -> pending -> triggered` sequence of a
154875
155306
  * few seconds keeps every step. Who armed it stays in the events ledger.
@@ -155514,6 +155945,10 @@ var automationControlCapability = {
155514
155945
  auth: "admin",
155515
155946
  actions: [{
155516
155947
  id: "haAutomation.enable",
155948
+ effect: {
155949
+ field: "enabled",
155950
+ value: true
155951
+ },
155517
155952
  label: t("Enable automation", "Abilita l’automazione"),
155518
155953
  phrase: t("Enable {device}", "Abilita {device}"),
155519
155954
  icon: "toggle-right"
@@ -155524,6 +155959,10 @@ var automationControlCapability = {
155524
155959
  auth: "admin",
155525
155960
  actions: [{
155526
155961
  id: "haAutomation.disable",
155962
+ effect: {
155963
+ field: "enabled",
155964
+ value: false
155965
+ },
155527
155966
  label: t("Disable automation", "Disabilita l’automazione"),
155528
155967
  phrase: t("Disable {device}", "Disabilita {device}"),
155529
155968
  icon: "toggle-left"
@@ -156067,9 +156506,9 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
156067
156506
  auth: "admin"
156068
156507
  });
156069
156508
  /**
156070
- * Battery status snapshot. Emitted by providers whose device is
156071
- * battery-operated (cameras with `DeviceFeature.BatteryOperated`,
156072
- * future sensor/button accessories). Consumers build their own "low
156509
+ * Battery status snapshot. Emitted by providers whose device reports a
156510
+ * battery (`DeviceFeature.BatteryOperated`): battery cameras, sensors,
156511
+ * buttons. Whether the device SLEEPS is `low-power-sleep`, not this cap. Consumers build their own "low
156073
156512
  * battery" alerting on top — the cap deliberately does NOT enforce a
156074
156513
  * threshold.
156075
156514
  */
@@ -156226,47 +156665,12 @@ var batteryCapability = {
156226
156665
  deviceNative: true,
156227
156666
  mode: "singleton",
156228
156667
  deviceTypes: BATTERY_DEVICE_TYPES,
156229
- methods: {
156230
- /**
156231
- * Explicitly wake the camera from low-power sleep ahead of a
156232
- * streaming session start. Consumers that initiate a stream
156233
- * against a sleeping battery cam (HomeKit Secure Video, Alexa
156234
- * RTCSession, snapshot wrappers) call this with a short timeout
156235
- * before establishing the media pipeline — the broker's own
156236
- * passive wake-on-dial works but adds 5–7 seconds to first-frame,
156237
- * during which the consumer renders a black screen. Pre-waking
156238
- * compresses that gap.
156239
- *
156240
- * Returns `awoke: true` when the firmware acknowledged the wake
156241
- * before `timeoutMs`. Returns `awoke: false` when it timed out OR
156242
- * the cap surface is unavailable (no Baichuan / firmware
156243
- * channel); the caller should still attempt the stream — the
156244
- * passive broker wake remains as fallback.
156245
- */
156246
- wakeForStream: method(object({
156247
- deviceId: number$1(),
156248
- /** Bound on the wait. Sensible range 3000–10000ms. */
156249
- timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
156250
- }), object({
156251
- awoke: boolean(),
156252
- durationMs: number$1()
156253
- }), {
156254
- kind: "mutation",
156255
- notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
156256
- }) },
156257
156668
  /**
156258
- * A composed provider (battery ADDED to a pet feeder or container that has
156259
- * no wake surface) answers `wakeForStream` with the same "unavailable"
156260
- * result the contract already defines above: "Returns `awoke: false` when
156261
- * … the cap surface is unavailable." (D663).
156669
+ * No methods: waking a sleeping camera is `low-power-sleep.wakeUp`
156670
+ * (#459, Q2). A battery reading says nothing about sleep — a battery sensor
156671
+ * reports charge and never needs waking.
156262
156672
  */
156263
- composedMethods: { wakeForStream: {
156264
- kind: "answer",
156265
- value: {
156266
- awoke: false,
156267
- durationMs: 0
156268
- }
156269
- } },
156673
+ methods: {},
156270
156674
  events: {
156271
156675
  /**
156272
156676
  * Emitted whenever the cached status changes (firmware push OR
@@ -158369,6 +158773,14 @@ var climateControlCapability = {
158369
158773
  label: t("Set temperature range", "Imposta l’intervallo di temperatura"),
158370
158774
  phrase: t("Keep {device} between {targetLow} and {targetHigh}", "Mantieni {device} tra {targetLow} e {targetHigh}"),
158371
158775
  icon: "thermometer",
158776
+ effect: {
158777
+ field: "targetLow",
158778
+ fromArg: "targetLow"
158779
+ },
158780
+ sideEffects: [{
158781
+ field: "targetHigh",
158782
+ fromArg: "targetHigh"
158783
+ }],
158372
158784
  openArgs: [{
158373
158785
  key: "targetLow",
158374
158786
  label: t("Lowest", "Minima"),
@@ -158427,6 +158839,10 @@ var climateControlCapability = {
158427
158839
  label: t("Set fan mode", "Imposta la ventilazione"),
158428
158840
  phrase: t("Set the fan of {device} to {fanMode}", "Imposta la ventilazione di {device} su {fanMode}"),
158429
158841
  icon: "fan",
158842
+ effect: {
158843
+ field: "fanMode",
158844
+ fromArg: "fanMode"
158845
+ },
158430
158846
  openArgs: [{
158431
158847
  key: "fanMode",
158432
158848
  label: t("Fan mode", "Ventilazione"),
@@ -158449,6 +158865,10 @@ var climateControlCapability = {
158449
158865
  label: t("Set preset", "Imposta il preset"),
158450
158866
  phrase: t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
158451
158867
  icon: "list",
158868
+ effect: {
158869
+ field: "preset",
158870
+ fromArg: "preset"
158871
+ },
158452
158872
  openArgs: [{
158453
158873
  key: "preset",
158454
158874
  label: t("Preset", "Preset"),
@@ -159036,7 +159456,8 @@ var CompositionProblemSchema = object({
159036
159456
  "command-source-unknown",
159037
159457
  "command-input-unknown",
159038
159458
  "command-input-missing",
159039
- "power-source-is-actuator"
159459
+ "power-source-is-actuator",
159460
+ "link-contribution-removed"
159040
159461
  ]),
159041
159462
  path: string(),
159042
159463
  message: string()
@@ -160463,6 +160884,10 @@ var mediaPlayerCapability = {
160463
160884
  auth: "protected",
160464
160885
  actions: [{
160465
160886
  id: "media.play",
160887
+ effect: {
160888
+ field: "state",
160889
+ value: "playing"
160890
+ },
160466
160891
  label: t("Play", "Riproduci"),
160467
160892
  phrase: t("Play on {device}", "Avvia la riproduzione su {device}"),
160468
160893
  icon: "play"
@@ -160473,6 +160898,10 @@ var mediaPlayerCapability = {
160473
160898
  auth: "protected",
160474
160899
  actions: [{
160475
160900
  id: "media.pause",
160901
+ effect: {
160902
+ field: "state",
160903
+ value: "paused"
160904
+ },
160476
160905
  label: t("Pause media", "Metti in pausa"),
160477
160906
  phrase: t("Pause {device}", "Metti in pausa {device}"),
160478
160907
  icon: "pause"
@@ -160516,6 +160945,10 @@ var mediaPlayerCapability = {
160516
160945
  auth: "protected",
160517
160946
  actions: [{
160518
160947
  id: "media.volume",
160948
+ effect: {
160949
+ field: "volumeLevel",
160950
+ fromArg: "volumeLevel"
160951
+ },
160519
160952
  label: t("Set volume", "Imposta il volume"),
160520
160953
  phrase: t("Set the volume of {device} to {volumeLevel}", "Imposta il volume di {device} al {volumeLevel}"),
160521
160954
  icon: "volume-2",
@@ -160540,12 +160973,20 @@ var mediaPlayerCapability = {
160540
160973
  auth: "protected",
160541
160974
  actions: [{
160542
160975
  id: "media.mute",
160976
+ effect: {
160977
+ field: "isMuted",
160978
+ value: true
160979
+ },
160543
160980
  label: t("Mute", "Silenzia"),
160544
160981
  phrase: t("Mute {device}", "Silenzia {device}"),
160545
160982
  icon: "volume-x",
160546
160983
  args: { muted: true }
160547
160984
  }, {
160548
160985
  id: "media.unmute",
160986
+ effect: {
160987
+ field: "isMuted",
160988
+ value: false
160989
+ },
160549
160990
  label: t("Unmute", "Riattiva l’audio"),
160550
160991
  phrase: t("Unmute {device}", "Riattiva l’audio di {device}"),
160551
160992
  icon: "volume-2",
@@ -160560,12 +161001,20 @@ var mediaPlayerCapability = {
160560
161001
  auth: "protected",
160561
161002
  actions: [{
160562
161003
  id: "media.shuffleOn",
161004
+ effect: {
161005
+ field: "shuffle",
161006
+ value: true
161007
+ },
160563
161008
  label: t("Shuffle on", "Riproduzione casuale attiva"),
160564
161009
  phrase: t("Turn on shuffle on {device}", "Attiva la riproduzione casuale su {device}"),
160565
161010
  icon: "shuffle",
160566
161011
  args: { shuffle: true }
160567
161012
  }, {
160568
161013
  id: "media.shuffleOff",
161014
+ effect: {
161015
+ field: "shuffle",
161016
+ value: false
161017
+ },
160569
161018
  label: t("Shuffle off", "Riproduzione casuale spenta"),
160570
161019
  phrase: t("Turn off shuffle on {device}", "Disattiva la riproduzione casuale su {device}"),
160571
161020
  icon: "shuffle",
@@ -160580,6 +161029,10 @@ var mediaPlayerCapability = {
160580
161029
  auth: "protected",
160581
161030
  actions: [{
160582
161031
  id: "media.repeat",
161032
+ effect: {
161033
+ field: "repeat",
161034
+ fromArg: "repeat"
161035
+ },
160583
161036
  label: t("Set repeat", "Imposta la ripetizione"),
160584
161037
  phrase: t("Set repeat on {device} to {repeat}", "Imposta la ripetizione di {device} su {repeat}"),
160585
161038
  icon: "repeat",
@@ -160614,6 +161067,10 @@ var mediaPlayerCapability = {
160614
161067
  auth: "protected",
160615
161068
  actions: [{
160616
161069
  id: "media.source",
161070
+ effect: {
161071
+ field: "source",
161072
+ fromArg: "source"
161073
+ },
160617
161074
  label: t("Select source", "Scegli la sorgente"),
160618
161075
  phrase: t("Switch {device} to {source}", "Passa {device} alla sorgente {source}"),
160619
161076
  icon: "cast",
@@ -160782,7 +161239,7 @@ var mediaPlayerCapability = {
160782
161239
  ]
160783
161240
  }
160784
161241
  };
160785
- DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, 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, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
161242
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Climate, DeviceType.Climate, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, 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, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Workload, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation, DeviceType.WeatherStation;
160786
161243
  var NUMBER = {
160787
161244
  kind: "fixed",
160788
161245
  result: ["number"]
@@ -161274,7 +161731,9 @@ var PowerSourceRefusalReasonSchema = _enum([
161274
161731
  "switch-call-failed",
161275
161732
  "switch-options-unreadable",
161276
161733
  "not-settable",
161277
- "switch-is-actuator"
161734
+ "switch-is-actuator",
161735
+ "link-lost",
161736
+ "link-unknown"
161278
161737
  ]);
161279
161738
  var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
161280
161739
  accepted: literal(false),
@@ -163298,6 +163757,142 @@ function normaliseIdentifiers(raw, options = {}) {
163298
163757
  rejected: refused
163299
163758
  };
163300
163759
  }
163760
+ /**
163761
+ * Cross-integration identity candidates (planning#593, step 2 of D1059's epic).
163762
+ *
163763
+ * Two devices brought by DIFFERENT integrations that share provider-declared
163764
+ * identifiers ({@link DeviceIdentifiers}) are candidates for being the same
163765
+ * physical object. This module holds the answer's shape; the device-manager
163766
+ * keeps the index that finds the pairs and the ONE rule that grades a match
163767
+ * (`classifyIdentityMatch`, `device-identity-index.ts`).
163768
+ *
163769
+ * The rule (operator, planning#590):
163770
+ *
163771
+ * | Matched keys | Confidence |
163772
+ * | ---------------------------------------------- | ----------- |
163773
+ * | two strong KINDS (e.g. `mac` + `serial`) | `auto` |
163774
+ * | `mac` + `ip` | `auto` |
163775
+ * | exactly one strong kind | `proposal` |
163776
+ * | weak keys only (`hostname`, `ip`) | no candidate|
163777
+ *
163778
+ * Strength counts distinct KINDS, not values: two MACs of one device matching
163779
+ * the other's two MACs are still one kind of evidence, so a proposal. In doubt,
163780
+ * no match.
163781
+ *
163782
+ * Read-only: a candidate is NOT a link. Links are step 3.
163783
+ */
163784
+ var IdentityConfidenceSchema = _enum(["auto", "proposal"]);
163785
+ /** One identifier both devices declared, with the same normalised value. */
163786
+ var IdentityMatchedKeySchema = object({
163787
+ key: DeviceIdentifierKeySchema,
163788
+ value: string()
163789
+ });
163790
+ /** One side of a pair: the device and the integration that brought it. */
163791
+ var IdentityCandidateDeviceSchema = object({
163792
+ deviceId: number$1().int(),
163793
+ addonId: string(),
163794
+ /** The integration instance (`int_NNNN`) that adopted it; `null` when none was stamped. */
163795
+ integrationId: string().nullable()
163796
+ });
163797
+ /** Two devices of different integrations sharing at least one strong identifier. `a.deviceId < b.deviceId`. */
163798
+ var IdentityCandidatePairSchema = object({
163799
+ a: IdentityCandidateDeviceSchema,
163800
+ b: IdentityCandidateDeviceSchema,
163801
+ /** Every identifier the two share, weak ones included, ordered by key then value. */
163802
+ keys: array(IdentityMatchedKeySchema).readonly(),
163803
+ confidence: IdentityConfidenceSchema
163804
+ });
163805
+ /**
163806
+ * The answer of `device-manager.listIdentityCandidates`.
163807
+ *
163808
+ * - `unknown` — the index has not loaded yet: nothing can be said, and it is
163809
+ * NOT an empty list (D315).
163810
+ * - `answered` — `pairs` holds every candidate. `undeclaredDeviceIds` are the
163811
+ * devices with no identifiers on record: whether they match anything is
163812
+ * UNKNOWN, never "no match" (D393). A device absent from both lists declared
163813
+ * identifiers and matched nobody.
163814
+ */
163815
+ var IdentityCandidatesSchema = discriminatedUnion("status", [object({
163816
+ status: literal("unknown"),
163817
+ reason: string()
163818
+ }), object({
163819
+ status: literal("answered"),
163820
+ pairs: array(IdentityCandidatePairSchema).readonly(),
163821
+ undeclaredDeviceIds: array(number$1().int()).readonly()
163822
+ })]);
163823
+ var IdentityLinkKindSchema = _enum(["same-device", "poe-power"]);
163824
+ /**
163825
+ * - `proposed` — one strong key matched: waits for the operator;
163826
+ * - `linked` — confirmed by the operator, or auto-linked on strong evidence;
163827
+ * - `dismissed` — the operator said no (or unlinked): sticky, never re-proposed.
163828
+ */
163829
+ var IdentityLinkStateSchema = _enum([
163830
+ "proposed",
163831
+ "linked",
163832
+ "dismissed"
163833
+ ]);
163834
+ /** Who decided the current state: the matcher (`auto`) or the operator. */
163835
+ var IdentityLinkOriginSchema = _enum(["auto", "operator"]);
163836
+ /** One side: the device ref that survives re-registration, plus its current numeric id. */
163837
+ var IdentityLinkSideSchema = object({
163838
+ addonId: string().min(1),
163839
+ stableId: string().min(1),
163840
+ deviceId: number$1().int()
163841
+ });
163842
+ var IdentityLinkSchema = object({
163843
+ kind: IdentityLinkKindSchema,
163844
+ a: IdentityLinkSideSchema,
163845
+ b: IdentityLinkSideSchema,
163846
+ state: IdentityLinkStateSchema,
163847
+ origin: IdentityLinkOriginSchema,
163848
+ /** The identifiers that matched when the link was last evaluated, ordered by key then value. */
163849
+ evidence: array(IdentityMatchedKeySchema).readonly(),
163850
+ /** An operator-confirmed link whose evidence no longer matches: kept, flagged. */
163851
+ evidenceGone: literal(true).optional(),
163852
+ createdAt: number$1().int().nonnegative(),
163853
+ decidedAt: number$1().int().nonnegative().optional()
163854
+ }).extend({ id: string().min(1) });
163855
+ DeviceRole.PoePort;
163856
+ /**
163857
+ * The answer of `device-manager.listIdentityLinks`. `not-loaded` until the
163858
+ * links have been read — never an empty list (D315).
163859
+ */
163860
+ var IdentityLinksReadSchema = discriminatedUnion("status", [object({
163861
+ status: literal("not-loaded"),
163862
+ reason: string()
163863
+ }), object({
163864
+ status: literal("answered"),
163865
+ links: array(IdentityLinkSchema).readonly()
163866
+ })]);
163867
+ /** Why an operator decision on a link was refused. */
163868
+ var IdentityLinkDecisionRefusalSchema = _enum([
163869
+ "not-loaded",
163870
+ "unknown-link",
163871
+ "wrong-state"
163872
+ ]);
163873
+ /** The answer of `confirmIdentityLink` / `dismissIdentityLink` / `unlinkIdentity`. */
163874
+ var IdentityLinkDecisionSchema = discriminatedUnion("ok", [object({
163875
+ ok: literal(true),
163876
+ link: IdentityLinkSchema
163877
+ }), object({
163878
+ ok: literal(false),
163879
+ reason: IdentityLinkDecisionRefusalSchema,
163880
+ message: string()
163881
+ })]);
163882
+ /** Why a link was lost. */
163883
+ var IdentityLinkLostReasonSchema = _enum([
163884
+ "evidence-gone",
163885
+ "device-removed",
163886
+ "operator-unlinked"
163887
+ ]);
163888
+ object({
163889
+ linkId: string(),
163890
+ kind: IdentityLinkKindSchema,
163891
+ aDeviceId: number$1().int(),
163892
+ bDeviceId: number$1().int(),
163893
+ origin: IdentityLinkOriginSchema,
163894
+ reason: IdentityLinkLostReasonSchema.optional()
163895
+ });
163301
163896
  var DeviceSearchRequiresSchema = object({
163302
163897
  /** Capability names the field wants a value of. Absent when the field wants actions only. */
163303
163898
  caps: array(string()).readonly().optional(),
@@ -163864,6 +164459,11 @@ var DeviceInfoSchema = object({
163864
164459
  * the owning provider via `setIdentifiers`; read-only for the operator.
163865
164460
  * Absent ⇒ the provider declared none. */
163866
164461
  identifiers: DeviceIdentifiersSchema.optional(),
164462
+ /** The identity of the device at the far end of this device's physical
164463
+ * link (D1059 amended by D1063) — a PoE port's wired client. Written only by
164464
+ * the owning provider via `setAttachedIdentifiers`; it never makes the two
164465
+ * devices the same device. Absent ⇒ none declared. */
164466
+ attachedIdentifiers: DeviceIdentifiersSchema.optional(),
163867
164467
  /** Optional upstream-system identity + rendering envelope. See
163868
164468
  * `SourceInfo` in `packages/types/src/device/source-info.ts`. */
163869
164469
  sourceInfo: SourceInfoSchema.optional(),
@@ -164017,6 +164617,8 @@ var DeviceMetaSchema = object({
164017
164617
  metadata: record(string(), unknown()).nullable().optional(),
164018
164618
  /** Provider-declared identifiers (D1059). See `DeviceMeta.identifiers`. */
164019
164619
  identifiers: DeviceIdentifiersSchema.optional(),
164620
+ /** The far end of the device's physical link (D1063). See `DeviceMeta.attachedIdentifiers`. */
164621
+ attachedIdentifiers: DeviceIdentifiersSchema.optional(),
164020
164622
  /** Optional upstream-system identity + rendering envelope. See
164021
164623
  * `SourceInfo`. Present when the device has been persisted with a
164022
164624
  * non-synthetic source identifier (HA entities, vendor MAC, …);
@@ -164338,6 +164940,29 @@ method(object({
164338
164940
  }), _void(), {
164339
164941
  kind: "mutation",
164340
164942
  auth: "admin"
164943
+ }), method(object({}), IdentityCandidatesSchema, {
164944
+ kind: "query",
164945
+ auth: "admin"
164946
+ }), method(object({
164947
+ deviceId: number$1(),
164948
+ identifiers: DeviceIdentifiersSchema.nullable(),
164949
+ /** Kinds the provider tried to read and could not: their stored value is kept. */
164950
+ unread: array(DeviceIdentifierKeySchema).optional()
164951
+ }), _void(), {
164952
+ kind: "mutation",
164953
+ auth: "admin"
164954
+ }), method(object({ deviceId: number$1().int().optional() }), IdentityLinksReadSchema, {
164955
+ kind: "query",
164956
+ auth: "admin"
164957
+ }), method(object({ linkId: string().min(1) }), IdentityLinkDecisionSchema, {
164958
+ kind: "mutation",
164959
+ auth: "admin"
164960
+ }), method(object({ linkId: string().min(1) }), IdentityLinkDecisionSchema, {
164961
+ kind: "mutation",
164962
+ auth: "admin"
164963
+ }), method(object({ linkId: string().min(1) }), IdentityLinkDecisionSchema, {
164964
+ kind: "mutation",
164965
+ auth: "admin"
164341
164966
  }), method(_void(), array(string())), method(object({ name: string() }), _void(), {
164342
164967
  kind: "mutation",
164343
164968
  auth: "admin"
@@ -165302,8 +165927,12 @@ var ClaimsListingSchema = discriminatedUnion("state", [object({
165302
165927
  })]);
165303
165928
  method(object({ deviceId: number$1() }), record(string(), record(string(), unknown()))), method(object({
165304
165929
  deviceId: number$1(),
165305
- capName: string()
165306
- }), record(string(), unknown()).nullable()), method(object({}), record(string(), record(string(), record(string(), unknown())))), method(object({
165930
+ capName: string(),
165931
+ /** The slice the device CONFIRMED, without a held command (D1061) — history and automations. */
165932
+ confirmed: boolean().optional()
165933
+ }), record(string(), unknown()).nullable()), method(object({
165934
+ /** The slices the devices CONFIRMED, without held commands (D1061). */
165935
+ confirmed: boolean().optional() }), record(string(), record(string(), record(string(), unknown())))), method(object({
165307
165936
  deviceId: number$1(),
165308
165937
  capName: string(),
165309
165938
  slice: record(string(), unknown())
@@ -165341,6 +165970,88 @@ method(object({ deviceId: number$1() }), record(string(), record(string(), unkno
165341
165970
  slice: record(string(), unknown())
165342
165971
  }));
165343
165972
  /**
165973
+ * Server-driven device state refresh (D1062): the core decides WHEN a device is
165974
+ * re-read, the integration only knows HOW.
165975
+ *
165976
+ * A provider states its policy where it registers the device's
165977
+ * `device-state-refresh` cap (`ctx.registerNativeCap(cap, provider, {
165978
+ * stateRefresh })`). It reaches the hub by the road the command-hold options
165979
+ * take (D1061): written directly in-process, carried on a forked child's cap
165980
+ * descriptors otherwise. Plain data, wire-safe.
165981
+ */
165982
+ /** Why the core asks for a refresh. */
165983
+ var StateRefreshReasonSchema = _enum([
165984
+ "schedule",
165985
+ "command",
165986
+ "burst"
165987
+ ]);
165988
+ /**
165989
+ * What arrives without asking: `none` (everything is read), `partial` (some
165990
+ * fields arrive by push, the rest is read on the schedule), `full` (everything
165991
+ * arrives by push — never read on a schedule).
165992
+ */
165993
+ var StateRefreshPushSchema = _enum([
165994
+ "none",
165995
+ "partial",
165996
+ "full"
165997
+ ]);
165998
+ object({
165999
+ /**
166000
+ * The integration instance the device belongs to. Devices of one instance
166001
+ * share one schedule group: a batching provider is asked once for all of
166002
+ * them, and the heartbeat is judged across them.
166003
+ */
166004
+ integrationId: string().min(1),
166005
+ /** The fastest interval the integration can afford for its devices. The core polls at it by default. */
166006
+ minIntervalMs: number$1().int().min(1e3),
166007
+ /**
166008
+ * The operator's per-integration setting, when there is one. It can only SLOW
166009
+ * the cadence: the core polls at `max(minIntervalMs, intervalMs)`.
166010
+ */
166011
+ intervalMs: number$1().int().positive().optional(),
166012
+ /** One `refresh` call can read every device of the integration at once. */
166013
+ batch: boolean(),
166014
+ push: StateRefreshPushSchema,
166015
+ /** Longest silence a push integration may keep before the core re-reads it and asks it to resubscribe. */
166016
+ heartbeatMs: number$1().int().positive().optional(),
166017
+ /**
166018
+ * Bumped by the provider each time its push subscription reconnected on its
166019
+ * own. A change makes the core re-read every device of the integration
166020
+ * (pushes lost while it was down; events may be dropped, D8).
166021
+ */
166022
+ connectionEpoch: number$1().int().nonnegative().optional()
166023
+ });
166024
+ /**
166025
+ * device-state-refresh — the HOW of a device's state refresh, called by the
166026
+ * core, which owns the WHEN (D1062).
166027
+ *
166028
+ * The provider registers it per device with its policy
166029
+ * (`registerNativeCap(cap, provider, { stateRefresh })`). The hub's scheduler
166030
+ * calls `refresh` on the schedule, after a command and in the burst that
166031
+ * follows it, and `resubscribe` when a push integration fell silent. The
166032
+ * provider re-reads and writes the slices it already writes; nothing is
166033
+ * returned but completion.
166034
+ */
166035
+ var DeviceStateRefreshInputSchema = object({
166036
+ /** The device the call is routed by (one of `deviceIds`). */
166037
+ deviceId: number$1().int().nonnegative(),
166038
+ /** Every device to re-read: one, or the integration's whole set when the provider batches. */
166039
+ deviceIds: array(number$1().int().nonnegative()).min(1),
166040
+ reason: StateRefreshReasonSchema
166041
+ });
166042
+ var DeviceStateResubscribeInputSchema = object({ deviceId: number$1().int().nonnegative() });
166043
+ var DeviceStateRefreshResultSchema = object({ ok: literal(true) });
166044
+ var NOT_OPERATOR_FACING = "the core schedules state refreshes itself; an operator never asks for one";
166045
+ method(DeviceStateRefreshInputSchema, DeviceStateRefreshResultSchema, {
166046
+ kind: "mutation",
166047
+ auth: "admin",
166048
+ notOperatorFacing: NOT_OPERATOR_FACING
166049
+ }), method(DeviceStateResubscribeInputSchema, DeviceStateRefreshResultSchema, {
166050
+ kind: "mutation",
166051
+ auth: "admin",
166052
+ notOperatorFacing: NOT_OPERATOR_FACING
166053
+ });
166054
+ /**
165344
166055
  * Generic device-level status snapshot. Auto-registered by `BaseDevice`
165345
166056
  * for every device, regardless of provider — the kernel needs a uniform
165346
166057
  * cap-keyed slice for the basic device flags every consumer expects to
@@ -167770,7 +168481,15 @@ var fanControlCapability = {
167770
168481
  field: "speed",
167771
168482
  value: 100
167772
168483
  },
167773
- args: { speed: 100 }
168484
+ args: { speed: 100 },
168485
+ sideEffects: [{
168486
+ field: "preset",
168487
+ value: "",
168488
+ when: {
168489
+ field: "preset",
168490
+ notIn: [""]
168491
+ }
168492
+ }]
167774
168493
  },
167775
168494
  {
167776
168495
  id: "fan.speed",
@@ -167781,6 +168500,14 @@ var fanControlCapability = {
167781
168500
  field: "speed",
167782
168501
  fromArg: "speed"
167783
168502
  },
168503
+ sideEffects: [{
168504
+ field: "preset",
168505
+ value: "",
168506
+ when: {
168507
+ field: "preset",
168508
+ notIn: [""]
168509
+ }
168510
+ }],
167784
168511
  openArgs: [{
167785
168512
  key: "speed",
167786
168513
  label: t("Speed", "Velocità"),
@@ -167806,6 +168533,10 @@ var fanControlCapability = {
167806
168533
  label: t("Set preset", "Imposta il preset"),
167807
168534
  phrase: t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
167808
168535
  icon: "list",
168536
+ effect: {
168537
+ field: "preset",
168538
+ fromArg: "preset"
168539
+ },
167809
168540
  openArgs: [{
167810
168541
  key: "preset",
167811
168542
  label: t("Preset", "Preset"),
@@ -169536,7 +170267,7 @@ var HeroSceneSchema = object({
169536
170267
  level: number$1().min(0).max(1).nullable()
169537
170268
  });
169538
170269
  DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Fan, 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;
169539
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
170270
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host, DeviceRole.Ups;
169540
170271
  var HeroRowIdSchema = _enum([
169541
170272
  "progress",
169542
170273
  "run-for",
@@ -170808,6 +171539,16 @@ var IntegrationInstanceStatusSchema = object({
170808
171539
  /** A short human word for the state ("Signed in", "Token expired"); shown instead of `state`. */
170809
171540
  label: string().optional()
170810
171541
  });
171542
+ /**
171543
+ * What "Add device" inside ONE instance offers, decided per instance by its provider. `scan`: the
171544
+ * LAN scan finds devices this instance holds; `children`: only the instance's own children, via
171545
+ * adoption (a scan would offer other hosts, which are new integrations); `none`: manual add only.
171546
+ */
171547
+ var IntegrationInstanceAddDeviceSchema = _enum([
171548
+ "scan",
171549
+ "children",
171550
+ "none"
171551
+ ]);
170811
171552
  var IntegrationInstanceSchema = object({
170812
171553
  id: IntegrationInstanceIdSchema,
170813
171554
  name: string(),
@@ -170825,7 +171566,9 @@ var IntegrationInstanceSchema = object({
170825
171566
  formValues: record(string(), unknown()),
170826
171567
  status: IntegrationInstanceStatusSchema.optional(),
170827
171568
  /** Epoch ms of the last probe of the remote that produced `status`; absent when never checked. */
170828
- lastCheckedAt: number$1().optional()
171569
+ lastCheckedAt: number$1().optional(),
171570
+ /** What "Add device" inside this instance offers; see {@link IntegrationInstanceAddDeviceSchema}. Absent means the caller derives it from `describe().discovery` with `defaultAddDeviceMode` (lan → scan, account → children, else none). */
171571
+ addDevice: IntegrationInstanceAddDeviceSchema.optional()
170829
171572
  });
170830
171573
  var IntegrationInstancePatchSchema = object({
170831
171574
  id: IntegrationInstanceIdSchema,
@@ -172910,6 +173653,13 @@ var LockControlStatusSchema = object({
172910
173653
  "jammed",
172911
173654
  "door-open"
172912
173655
  ]),
173656
+ /**
173657
+ * Whether lock / unlock need a PIN `code` (#459, replaces the
173658
+ * `lock-pin-required` device feature). `null` = the provider cannot tell
173659
+ * (D393) — never `false`. `.optional()` so a restored slice written before
173660
+ * the field still parses; readers treat absent exactly like `null`.
173661
+ */
173662
+ codeRequired: boolean().nullable().optional(),
172913
173663
  /** Ms epoch when the slice was last updated. */
172914
173664
  lastChangedAt: number$1()
172915
173665
  });
@@ -172969,6 +173719,14 @@ var lockControlCapability = {
172969
173719
  field: "state",
172970
173720
  value: "locked"
172971
173721
  },
173722
+ hold: { effects: [{
173723
+ field: "state",
173724
+ value: "locking",
173725
+ when: {
173726
+ field: "state",
173727
+ notIn: ["locked"]
173728
+ }
173729
+ }] },
172972
173730
  openArgs: [{
172973
173731
  key: "code",
172974
173732
  label: t("PIN code", "Codice PIN"),
@@ -173002,6 +173760,14 @@ var lockControlCapability = {
173002
173760
  field: "state",
173003
173761
  value: "unlocked"
173004
173762
  },
173763
+ hold: { effects: [{
173764
+ field: "state",
173765
+ value: "unlocking",
173766
+ when: {
173767
+ field: "state",
173768
+ notIn: ["unlocked"]
173769
+ }
173770
+ }] },
173005
173771
  openArgs: [{
173006
173772
  key: "code",
173007
173773
  label: t("PIN code", "Codice PIN"),
@@ -173389,6 +174155,90 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
173389
174155
  ]);
173390
174156
  method(_void(), array(LoginMethodContributionSchema).readonly()), NOT_A_DEVICE.IDENTITY;
173391
174157
  /**
174158
+ * low-power-sleep — a device that goes into low-power sleep and must be WOKEN
174159
+ * before it streams (#459, Q2). A battery camera (Reolink Argus, a robot's
174160
+ * on-board camera) is one; a battery SENSOR is not: it reports charge on the
174161
+ * `battery` cap and never sleeps. The two meanings used to share
174162
+ * `DeviceFeature.BatteryOperated`; this cap is the one that answers "sleeps",
174163
+ * and `DeviceFeature.Sleeps` is derived from it being bound with
174164
+ * `wakeUp` implemented.
174165
+ *
174166
+ * The state is the sleep inputs (`deriveBatteryPresence`): whether the device
174167
+ * is asleep, and the last time it PROVED it was reachable. Read from this slice
174168
+ * by the stream broker (`readBatterySleepFacts`), the recorder
174169
+ * (`recordingWakeDeps`) and the snapshot builtin. The broker's per-device
174170
+ * mirror is still also fed by `BatteryOnStatusChanged` events.
174171
+ */
174172
+ var LowPowerSleepStatusSchema = object({
174173
+ /**
174174
+ * True while the firmware is in low-power mode. A provider MUST avoid polling
174175
+ * during sleep — a read wakes the device and drains charge.
174176
+ */
174177
+ sleeping: boolean().meta({ label: "Sleeping" }),
174178
+ /**
174179
+ * Ms epoch of the last time the device proved it was reachable, from
174180
+ * PASSIVE signals only (a completed round-trip, an observed wake, a push).
174181
+ * Absent = never since this slice was born. The only input that separates
174182
+ * "asleep" from "gone".
174183
+ */
174184
+ lastContactAt: number$1().optional(),
174185
+ /** Ms epoch of the last observation. */
174186
+ lastUpdated: number$1().meta(readingMeta("none"))
174187
+ });
174188
+ var lowPowerSleepCapability = {
174189
+ name: "low-power-sleep",
174190
+ scope: "device",
174191
+ deviceNative: true,
174192
+ mode: "singleton",
174193
+ deviceTypes: [DeviceType.Camera],
174194
+ methods: {
174195
+ /**
174196
+ * Explicitly wake the device from low-power sleep ahead of a streaming
174197
+ * session start. Consumers that initiate a stream against a sleeping
174198
+ * camera (wake-on-play, the recorder, HomeKit, Alexa, snapshot wrappers)
174199
+ * call this with a short timeout before establishing the media pipeline —
174200
+ * the broker's own passive wake-on-dial works but adds 5–7 seconds to
174201
+ * first-frame. Pre-waking compresses that gap.
174202
+ *
174203
+ * Returns `awoke: true` when the firmware acknowledged the wake before
174204
+ * `timeoutMs`, `awoke: false` when it timed out; the caller should still
174205
+ * attempt the stream — the passive broker wake remains as fallback.
174206
+ */
174207
+ wakeUp: method(object({
174208
+ deviceId: number$1(),
174209
+ /** Bound on the wait. Sensible range 3000–10000ms. */
174210
+ timeoutMs: number$1().int().min(500).max(3e4).default(8e3)
174211
+ }), object({
174212
+ awoke: boolean(),
174213
+ durationMs: number$1()
174214
+ }), {
174215
+ kind: "mutation",
174216
+ notOperatorFacing: "a stream consumer wakes a sleeping camera to watch it; an automation that wants footage asks for the footage"
174217
+ }) },
174218
+ status: {
174219
+ schema: LowPowerSleepStatusSchema,
174220
+ kind: "push",
174221
+ empty: {
174222
+ sleeping: false,
174223
+ lastUpdated: 0
174224
+ }
174225
+ },
174226
+ runtimeState: LowPowerSleepStatusSchema,
174227
+ /**
174228
+ * Runtime-state durability: **restored** — a sleeping camera may not report
174229
+ * for hours; the restored sleep inputs are the only thing the sleep gate and
174230
+ * the presence derivation have (the same argument as `battery`).
174231
+ */
174232
+ durability: "restored",
174233
+ /** History (D850): none — battery never recorded a sleep series either. */
174234
+ history: "none",
174235
+ volatileStateFields: ["lastUpdated"],
174236
+ vocabulary: {
174237
+ noun: t("Low-power sleep", "Sospensione a basso consumo"),
174238
+ order: 5245
174239
+ }
174240
+ };
174241
+ /**
173392
174242
  * mesh-network — collection cap for mesh-VPN providers.
173393
174243
  *
173394
174244
  * Different shape from `network-access` (public tunnels):
@@ -177329,6 +178179,16 @@ DeviceType.Camera, method(object({ deviceId: number$1() }), array(TrackSchema).r
177329
178179
  timestamp: number$1()
177330
178180
  }), EventCategory.PipelineAnalyticsDetectionEvent, EventCategory.PipelineAnalyticsPackageDelivered, EventCategory.PipelineAnalyticsPackagePickedUp;
177331
178181
  /**
178182
+ * A rectangle as a fraction of a frame, `[0, 1]` on both axes — the wire shape
178183
+ * of `NormalizedRect` (which is derived from it).
178184
+ */
178185
+ var NormalizedRectSchema = object({
178186
+ x: number$1(),
178187
+ y: number$1(),
178188
+ w: number$1(),
178189
+ h: number$1()
178190
+ });
178191
+ /**
177332
178192
  * A root model's boxes standing in for one crop-kind step's own inference
177333
178193
  * (D730) — see `runPipeline.suppliedRoot`.
177334
178194
  */
@@ -177721,7 +178581,16 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
177721
178581
  * reader) run on them through their own crop policy. Boxes are in the
177722
178582
  * PIXELS of the image this call carries. Absent ⇒ the root step runs.
177723
178583
  */
177724
- suppliedRoot: SuppliedRootOutputSchema.optional()
178584
+ suppliedRoot: SuppliedRootOutputSchema.optional(),
178585
+ /**
178586
+ * The motion analyzer's merged subjects (D394) for this camera, fresh,
178587
+ * normalised to the frame (0..1). Feeds the motion-guided root crop
178588
+ * (D1060): the executor picks per frame whether the object-detection
178589
+ * root runs on the full frame or on a crop around them. Honoured only
178590
+ * on the live `frame` plane with a `frameRef`. Absent or empty ⇒ no
178591
+ * motion known ⇒ full frame.
178592
+ */
178593
+ motionRegions: array(NormalizedRectSchema).optional()
177725
178594
  }), PipelineRunResultBridge, { kind: "mutation" }), method(object({
177726
178595
  steps: array(PipelineStepInputSchema).min(1),
177727
178596
  frames: array(FrameInputSchema).min(1).max(255),
@@ -178813,7 +179682,15 @@ var RunnerInferenceDeviceSchema = object({
178813
179682
  * Absent field ⇒ an orchestrator that predates D650: the jumped step keeps
178814
179683
  * the elected device's provisioning, as before.
178815
179684
  */
178816
- steps: record(string(), RunnerJumpStepProvisioningSchema).optional()
179685
+ steps: record(string(), RunnerJumpStepProvisioningSchema).optional(),
179686
+ /**
179687
+ * Steps switched OFF on this device (D1065, `inferenceDevices[key].steps[s]
179688
+ * .enabled === false`). The runner never runs a subtree containing one of
179689
+ * them here: it auto-jumps it to an allowed device, and when none can take
179690
+ * it the subtree is skipped (`disabled-on-device`), never run here anyway.
179691
+ * Absent ⇒ none (an orchestrator that predates D1065).
179692
+ */
179693
+ disabledSteps: array(string()).readonly().optional()
178817
179694
  });
178818
179695
  /**
178819
179696
  * Camera assignment payload sent by `addon-pipeline-orchestrator` to a
@@ -184530,6 +185407,14 @@ method(object({ deviceId: number$1().int() }), object({
184530
185407
  auth: "admin"
184531
185408
  }), NOT_A_DEVICE.PIPELINE;
184532
185409
  /**
185410
+ * Hold limits a cap's vocabulary may declare on an action (D1061).
185411
+ *
185412
+ * A one-shot command (feed, run a script) has no lasting state to confirm; it
185413
+ * holds its in-progress flag just long enough that a second tap, before the
185414
+ * device reports, is seen as "already running" and refused.
185415
+ */
185416
+ var ONE_SHOT_HOLD_MS = 1e4;
185417
+ /**
184533
185418
  * Feeder connectivity / power status — mirrors the HA petkit device-status
184534
185419
  * enum: `normal` (online, mains), `offline` (not reaching PetKit cloud),
184535
185420
  * `on_batteries` (running on battery backup). `null` until first reported.
@@ -184647,6 +185532,13 @@ var petFeederCapability = {
184647
185532
  label: t("Feed", "Dai da mangiare"),
184648
185533
  phrase: t("Dispense {grams} from {device}", "Eroga {grams} da {device}"),
184649
185534
  icon: "paw-print",
185535
+ hold: {
185536
+ effects: [{
185537
+ field: "feeding",
185538
+ value: true
185539
+ }],
185540
+ holdMs: ONE_SHOT_HOLD_MS
185541
+ },
184650
185542
  openArgs: [{
184651
185543
  key: "grams",
184652
185544
  label: t("Grams", "Grammi"),
@@ -184665,6 +185557,13 @@ var petFeederCapability = {
184665
185557
  label: t("Feed from both hoppers", "Eroga da entrambi i serbatoi"),
184666
185558
  phrase: t("Dispense {hopper1} and {hopper2} from {device}", "Eroga {hopper1} e {hopper2} da {device}"),
184667
185559
  icon: "paw-print",
185560
+ hold: {
185561
+ effects: [{
185562
+ field: "feeding",
185563
+ value: true
185564
+ }],
185565
+ holdMs: ONE_SHOT_HOLD_MS
185566
+ },
184668
185567
  openArgs: [{
184669
185568
  key: "hopper1",
184670
185569
  label: t("Hopper 1", "Serbatoio 1"),
@@ -184770,12 +185669,20 @@ var petFeederCapability = {
184770
185669
  auth: "protected",
184771
185670
  actions: [{
184772
185671
  id: "petFeeder.childLockOn",
185672
+ effect: {
185673
+ field: "childLock",
185674
+ value: true
185675
+ },
184773
185676
  label: t("Child lock on", "Blocco bambini attivo"),
184774
185677
  phrase: t("Turn on the child lock of {device}", "Attiva il blocco bambini di {device}"),
184775
185678
  icon: "lock",
184776
185679
  args: { on: true }
184777
185680
  }, {
184778
185681
  id: "petFeeder.childLockOff",
185682
+ effect: {
185683
+ field: "childLock",
185684
+ value: false
185685
+ },
184779
185686
  label: t("Child lock off", "Blocco bambini spento"),
184780
185687
  phrase: t("Turn off the child lock of {device}", "Disattiva il blocco bambini di {device}"),
184781
185688
  icon: "lock-open",
@@ -184791,12 +185698,20 @@ var petFeederCapability = {
184791
185698
  auth: "protected",
184792
185699
  actions: [{
184793
185700
  id: "petFeeder.lightOn",
185701
+ effect: {
185702
+ field: "indicatorLight",
185703
+ value: true
185704
+ },
184794
185705
  label: t("Indicator light on", "Spia accesa"),
184795
185706
  phrase: t("Turn on the indicator light of {device}", "Accendi la spia di {device}"),
184796
185707
  icon: "lightbulb",
184797
185708
  args: { on: true }
184798
185709
  }, {
184799
185710
  id: "petFeeder.lightOff",
185711
+ effect: {
185712
+ field: "indicatorLight",
185713
+ value: false
185714
+ },
184800
185715
  label: t("Indicator light off", "Spia spenta"),
184801
185716
  phrase: t("Turn off the indicator light of {device}", "Spegni la spia di {device}"),
184802
185717
  icon: "lightbulb-off",
@@ -184812,12 +185727,20 @@ var petFeederCapability = {
184812
185727
  auth: "protected",
184813
185728
  actions: [{
184814
185729
  id: "petFeeder.feedSoundOn",
185730
+ effect: {
185731
+ field: "feedSound",
185732
+ value: true
185733
+ },
184815
185734
  label: t("Feeding sound on", "Suono di erogazione attivo"),
184816
185735
  phrase: t("Turn on the feeding sound of {device}", "Attiva il suono di erogazione di {device}"),
184817
185736
  icon: "volume-2",
184818
185737
  args: { on: true }
184819
185738
  }, {
184820
185739
  id: "petFeeder.feedSoundOff",
185740
+ effect: {
185741
+ field: "feedSound",
185742
+ value: false
185743
+ },
184821
185744
  label: t("Feeding sound off", "Suono di erogazione spento"),
184822
185745
  phrase: t("Turn off the feeding sound of {device}", "Disattiva il suono di erogazione di {device}"),
184823
185746
  icon: "volume-x",
@@ -184833,6 +185756,10 @@ var petFeederCapability = {
184833
185756
  auth: "protected",
184834
185757
  actions: [{
184835
185758
  id: "petFeeder.volume",
185759
+ effect: {
185760
+ field: "volume",
185761
+ fromArg: "level"
185762
+ },
184836
185763
  label: t("Set volume", "Imposta il volume"),
184837
185764
  phrase: t("Set the volume of {device} to {level}", "Imposta il volume di {device} a {level}"),
184838
185765
  icon: "volume-2",
@@ -184978,12 +185905,20 @@ setPump: method(object({
184978
185905
  auth: "protected",
184979
185906
  actions: [{
184980
185907
  id: "petFountain.pumpOn",
185908
+ effect: {
185909
+ field: "pumpRunning",
185910
+ value: true
185911
+ },
184981
185912
  label: t("Pump on", "Pompa accesa"),
184982
185913
  phrase: t("Start the pump of {device}", "Avvia la pompa di {device}"),
184983
185914
  icon: "play",
184984
185915
  args: { on: true }
184985
185916
  }, {
184986
185917
  id: "petFountain.pumpOff",
185918
+ effect: {
185919
+ field: "pumpRunning",
185920
+ value: false
185921
+ },
184987
185922
  label: t("Pump off", "Pompa spenta"),
184988
185923
  phrase: t("Stop the pump of {device}", "Ferma la pompa di {device}"),
184989
185924
  icon: "square",
@@ -185530,7 +186465,15 @@ var DeviceStepConfigSchema = object({
185530
186465
  * at a disabled/absent device on that node at save time. Absent ⇒ the runner
185531
186466
  * auto-jumps only when the effective device's format cannot run the step.
185532
186467
  */
185533
- jumpDeviceKey: string().optional()
186468
+ jumpDeviceKey: string().optional(),
186469
+ /**
186470
+ * DEVICE switch for this step (D1065). `false` = the step is never
186471
+ * provisioned on this accelerator: a detail step jumps to another enabled
186472
+ * device of the node where it is allowed, else it is skipped with reason
186473
+ * `disabled-on-device`; a root is skipped. Absent = inherit (on). Written by
186474
+ * `setDeviceStepEnabled`.
186475
+ */
186476
+ enabled: boolean().optional()
185534
186477
  });
185535
186478
  var AgentPipelineSettingsSchema = object({
185536
186479
  maxCameras: number$1().int().nonnegative().nullable().default(null),
@@ -185574,6 +186517,12 @@ var AgentPipelineSettingsSchema = object({
185574
186517
  */
185575
186518
  stepSettings: record(string(), record(string(), unknown()).readonly()).optional(),
185576
186519
  /**
186520
+ * NODE switch per step (D1065): `stepId → enabled`. `false` = the step never
186521
+ * runs on a camera whose pipeline runs on this node (skip reason
186522
+ * `disabled-on-node`). Absent = inherit. Written by `setNodeStepEnabled`.
186523
+ */
186524
+ stepEnabled: record(string(), boolean()).optional(),
186525
+ /**
185577
186526
  * Multi-device inference opt-in (Phase 4). Per-node map deviceKey → {enabled,
185578
186527
  * weight, steps}. Absent / all-disabled ⇒ the node's single default
185579
186528
  * accelerator (safe default); two+ enabled ⇒ the dispatcher balances
@@ -185895,7 +186844,8 @@ var InferenceDeviceExclusionReasonSchema = _enum([
185895
186844
  "disabled",
185896
186845
  "unavailable",
185897
186846
  "cannot-host-camera-root",
185898
- "accelerator-preferred"
186847
+ "accelerator-preferred",
186848
+ "root-switched-off"
185899
186849
  ]);
185900
186850
  var NodeInferenceDeviceSchema = object({
185901
186851
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
@@ -185981,6 +186931,75 @@ var NodeInferenceDevicesSchema = object({
185981
186931
  devices: array(NodeInferenceDeviceSchema).readonly()
185982
186932
  });
185983
186933
  /**
186934
+ * The CLUSTER switch of one pipeline step (D1065):
186935
+ * - `off` — hard off: no camera, node or device can turn it on;
186936
+ * - `on` — on by default; a camera may turn it off (`stepToggles`);
186937
+ * - `opt-in` — off by default; a camera turns it on (`stepToggles`).
186938
+ * Absent = the catalog's `enabledByDefault` (`true` → `on`, `false` → `opt-in`).
186939
+ */
186940
+ var StepClusterModeSchema = _enum([
186941
+ "off",
186942
+ "on",
186943
+ "opt-in"
186944
+ ]);
186945
+ /**
186946
+ * What one step does on one (node, device) — computed by the orchestrator with
186947
+ * the SAME placement function the attach path runs (`pipeline-resolver.ts`),
186948
+ * so a client never re-derives it. Precedence: cluster off > camera toggle
186949
+ * (else the cluster default) > node off > device off / jump.
186950
+ */
186951
+ var StepSwitchCellSchema = discriminatedUnion("kind", [
186952
+ object({ kind: literal("on") }),
186953
+ object({ kind: literal("off-cluster") }),
186954
+ object({ kind: literal("off-node") }),
186955
+ object({ kind: literal("off-device") }),
186956
+ object({
186957
+ kind: literal("jump"),
186958
+ toDeviceKey: string()
186959
+ }),
186960
+ object({
186961
+ kind: literal("skip"),
186962
+ reason: _enum(["no-compatible-model", "root-not-runnable-on-elected-device"])
186963
+ }),
186964
+ object({ kind: literal("zone-driven") }),
186965
+ object({
186966
+ kind: literal("supplied-by-root"),
186967
+ rootModelId: string()
186968
+ }),
186969
+ object({ kind: literal("opt-in-unused") })
186970
+ ]);
186971
+ var StepSwitchDeviceSchema = object({
186972
+ deviceKey: string(),
186973
+ format: _enum(MODEL_FORMATS),
186974
+ /** The device switch as stored (`inferenceDevices[key].steps[step].enabled`); `null` = inherit. */
186975
+ stepEnabled: boolean().nullable(),
186976
+ /** Whether the device is in the node's dispatch roster (enabled, available, not excluded). */
186977
+ eligible: boolean(),
186978
+ cell: StepSwitchCellSchema
186979
+ });
186980
+ var StepSwitchNodeSchema = object({
186981
+ nodeId: string(),
186982
+ /** False when the node's catalog or device probe did not answer — no cells are claimed. */
186983
+ reachable: boolean(),
186984
+ /** The node switch as stored (`stepEnabled[step]`); `null` = inherit. */
186985
+ stepEnabled: boolean().nullable(),
186986
+ devices: array(StepSwitchDeviceSchema).readonly()
186987
+ });
186988
+ var StepSwitchMatrixSchema = object({ steps: array(object({
186989
+ stepId: string(),
186990
+ name: string(),
186991
+ slot: string(),
186992
+ /** The stored cluster mode; `null` = the catalog default applies. */
186993
+ clusterMode: StepClusterModeSchema.nullable(),
186994
+ /** The mode in force (stored, else derived from `enabledByDefault`). */
186995
+ effectiveMode: StepClusterModeSchema,
186996
+ /** Cameras whose `stepToggles[step]` is `true`. */
186997
+ camerasEnabling: number$1().int().nonnegative(),
186998
+ /** Cameras whose `stepToggles[step]` is `false`. */
186999
+ camerasDisabling: number$1().int().nonnegative(),
187000
+ nodes: array(StepSwitchNodeSchema).readonly()
187001
+ })).readonly() });
187002
+ /**
185984
187003
  * Pipeline Orchestrator capability — global load balancer + camera dispatcher.
185985
187004
  *
185986
187005
  * Lives on the hub. Tracks the camera-to-agent assignment map, listens to
@@ -186151,7 +187170,28 @@ method(object({
186151
187170
  }), object({ success: literal(true) }), {
186152
187171
  kind: "mutation",
186153
187172
  auth: "admin"
186154
- }), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({
187173
+ }), method(object({
187174
+ stepId: string(),
187175
+ mode: StepClusterModeSchema.nullable()
187176
+ }), object({ success: literal(true) }), {
187177
+ kind: "mutation",
187178
+ auth: "admin"
187179
+ }), method(object({
187180
+ agentNodeId: string(),
187181
+ stepId: string(),
187182
+ enabled: boolean().nullable()
187183
+ }), object({ success: literal(true) }), {
187184
+ kind: "mutation",
187185
+ auth: "admin"
187186
+ }), method(object({
187187
+ agentNodeId: string(),
187188
+ deviceKey: string(),
187189
+ stepId: string(),
187190
+ enabled: boolean().nullable()
187191
+ }), object({ success: literal(true) }), {
187192
+ kind: "mutation",
187193
+ auth: "admin"
187194
+ }), method(_void(), StepSwitchMatrixSchema), method(object({ nodeId: string() }), NodeInferenceDevicesSchema), method(object({
186155
187195
  agentNodeId: string(),
186156
187196
  deviceKey: string()
186157
187197
  }), object({ success: literal(true) }), {
@@ -186566,6 +187606,16 @@ var CoralInfoSchema = object({
186566
187606
  reason: _enum(["driver-missing", "device-not-accessible"])
186567
187607
  })).readonly().optional()
186568
187608
  });
187609
+ var NvidiaInfoBaseSchema = object({
187610
+ type: literal("nvidia"),
187611
+ name: string(),
187612
+ memoryMB: number$1().optional()
187613
+ });
187614
+ /** An NVIDIA GPU: usable ⇔ the CUDA execution provider exists; otherwise the reason. */
187615
+ var NvidiaInfoSchema = discriminatedUnion("usable", [NvidiaInfoBaseSchema.extend({ usable: literal(true) }), NvidiaInfoBaseSchema.extend({
187616
+ usable: literal(false),
187617
+ reason: _enum(["no-cuda-execution-provider"])
187618
+ })]);
186569
187619
  var HardwareInfoSchema = object({
186570
187620
  platform: HardwarePlatformSchema,
186571
187621
  arch: HardwareArchSchema,
@@ -186576,6 +187626,7 @@ var HardwareInfoSchema = object({
186576
187626
  gpu: GpuInfoSchema.nullable(),
186577
187627
  npu: NpuInfoSchema.nullable(),
186578
187628
  coral: CoralInfoSchema.nullable().optional(),
187629
+ nvidia: NvidiaInfoSchema.nullable().optional(),
186579
187630
  /**
186580
187631
  * Per-accelerator compute (D930). Omitted by a node that has not probed it.
186581
187632
  * `null` fields inside an entry are a failed query, never a zero.
@@ -186663,8 +187714,14 @@ method(_void(), PlatformCapabilitiesSchema), method(_void(), HardwareInfoSchema)
186663
187714
  * in real-world devices.
186664
187715
  */
186665
187716
  var PowerMeterStatusSchema = object({
186666
- /** Instantaneous power draw (watts). */
187717
+ /** Instantaneous TOTAL power draw of the device (watts), when known. */
186667
187718
  power: number$1().optional().meta(readingMeta("power", { label: "Power" })),
187719
+ /**
187720
+ * Power the device passes on to downstream loads (watts), e.g. the PoE a switch delivers to
187721
+ * its ports. When `power` is known it already includes this (the own draw is `netPowerOf`);
187722
+ * a device that reports no total (a UniFi switch) carries this field alone.
187723
+ */
187724
+ deliveredPower: number$1().optional().meta(readingMeta("power", { label: "Delivered" })),
186668
187725
  /** Cumulative energy in kilowatt-hours since the meter was reset. */
186669
187726
  energy: number$1().optional().meta(readingMeta("energy", { label: "Energy" })),
186670
187727
  /** Voltage (volts). */
@@ -186699,7 +187756,8 @@ var POWER_METER_DEVICE_TYPES = [
186699
187756
  DeviceType.Dishwasher,
186700
187757
  DeviceType.Vacuum,
186701
187758
  DeviceType.LawnMower,
186702
- DeviceType.PetFeeder
187759
+ DeviceType.PetFeeder,
187760
+ DeviceType.Workload
186703
187761
  ];
186704
187762
  /** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
186705
187763
  var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
@@ -187870,12 +188928,20 @@ var pumpCycleCapability = {
187870
188928
  auth: "protected",
187871
188929
  actions: [{
187872
188930
  id: "pumpCycle.on",
188931
+ effect: {
188932
+ field: "enabled",
188933
+ value: true
188934
+ },
187873
188935
  label: t("Pump cycle on", "Ciclo pompa attivo"),
187874
188936
  phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
187875
188937
  icon: "timer",
187876
188938
  args: { on: true }
187877
188939
  }, {
187878
188940
  id: "pumpCycle.off",
188941
+ effect: {
188942
+ field: "enabled",
188943
+ value: false
188944
+ },
187879
188945
  label: t("Pump cycle off", "Ciclo pompa spento"),
187880
188946
  phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
187881
188947
  icon: "timer-off",
@@ -187894,6 +188960,11 @@ var pumpCycleCapability = {
187894
188960
  label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
187895
188961
  phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
187896
188962
  icon: "timer",
188963
+ effect: {
188964
+ field: "onTime",
188965
+ fromArg: "minutes",
188966
+ scale: 60
188967
+ },
187897
188968
  openArgs: [{
187898
188969
  key: "minutes",
187899
188970
  label: t("Minutes", "Minuti"),
@@ -187918,6 +188989,11 @@ var pumpCycleCapability = {
187918
188989
  label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
187919
188990
  phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
187920
188991
  icon: "timer-off",
188992
+ effect: {
188993
+ field: "offTime",
188994
+ fromArg: "minutes",
188995
+ scale: 60
188996
+ },
187921
188997
  openArgs: [{
187922
188998
  key: "minutes",
187923
188999
  label: t("Minutes", "Minuti"),
@@ -191186,6 +192262,27 @@ var RemoteLayoutComponentSchema = object({
191186
192262
  });
191187
192263
  });
191188
192264
  method(object({}), array(RemoteLayoutComponentSchema), { auth: "protected" });
192265
+ /**
192266
+ * resync — a device whose derived spec can be re-aligned on demand with its
192267
+ * upstream source (#459, Q6). Registered by the containers an integration
192268
+ * adopted; `DeviceFeature.Resyncable` (the generic Re-sync button) is derived
192269
+ * from it being bound with `resync` implemented.
192270
+ *
192271
+ * The work itself stays where it is: the owning addon's `device-adoption`
192272
+ * provider, reached through `deviceManager.adoptionResync` (which also owns
192273
+ * the "resync from zero" child purge). A provider answers this method by
192274
+ * asking for exactly that — see `resyncThroughAdoption`.
192275
+ */
192276
+ var ResyncDeviceInputSchema = object({
192277
+ deviceId: number$1().int().nonnegative(),
192278
+ /** "Resync from zero": purge the accessory children before re-deriving. */
192279
+ resetToSource: boolean().optional()
192280
+ });
192281
+ DeviceType.Container, DeviceType.Workload, DeviceType.WeatherStation, method(ResyncDeviceInputSchema, ResyncResultSchema, {
192282
+ kind: "mutation",
192283
+ auth: "admin",
192284
+ notOperatorFacing: "device adoption — re-aligning a device with its source is an onboarding step, not an automation action"
192285
+ });
191189
192286
  var RUNNING_POWER_START_DELAY_MS = 3e4;
191190
192287
  var RUNNING_POWER_STOP_DELAY_MS = 18e4;
191191
192288
  /**
@@ -191867,7 +192964,14 @@ var scriptRunnerCapability = {
191867
192964
  id: "script.run",
191868
192965
  label: t("Run script", "Esegui lo script"),
191869
192966
  phrase: t("Run {device}", "Esegui {device}"),
191870
- icon: "scroll-text"
192967
+ icon: "scroll-text",
192968
+ hold: {
192969
+ effects: [{
192970
+ field: "isRunning",
192971
+ value: true
192972
+ }],
192973
+ holdMs: ONE_SHOT_HOLD_MS
192974
+ }
191871
192975
  }]
191872
192976
  }),
191873
192977
  /** Cancel a running script. Provider rejects when the script
@@ -191877,6 +192981,10 @@ var scriptRunnerCapability = {
191877
192981
  auth: "admin",
191878
192982
  actions: [{
191879
192983
  id: "script.stop",
192984
+ effect: {
192985
+ field: "isRunning",
192986
+ value: false
192987
+ },
191880
192988
  label: t("Stop script", "Ferma lo script"),
191881
192989
  phrase: t("Stop {device}", "Ferma {device}"),
191882
192990
  icon: "square"
@@ -193843,6 +194951,10 @@ var switchCapability = {
193843
194951
  auth: "protected",
193844
194952
  actions: [{
193845
194953
  id: "switch.toggle",
194954
+ sideEffects: [{
194955
+ field: "on",
194956
+ negate: true
194957
+ }],
193846
194958
  label: t("Toggle", "Commuta"),
193847
194959
  phrase: t("Toggle {device}", "Commuta {device}"),
193848
194960
  icon: "toggle-right",
@@ -200197,6 +201309,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
200197
201309
  irTransmitter: irTransmitterCapability,
200198
201310
  lawnMowerControl: lawnMowerControlCapability,
200199
201311
  lockControl: lockControlCapability,
201312
+ lowPowerSleep: lowPowerSleepCapability,
200200
201313
  mediaPlayer: mediaPlayerCapability,
200201
201314
  meter: meterCapability,
200202
201315
  motion: motionCapability,
@@ -200632,6 +201745,20 @@ var BaseDevice = class {
200632
201745
  }, raw, options);
200633
201746
  }
200634
201747
  /**
201748
+ * Declare the identity of the device at the FAR END of this device's physical
201749
+ * link (D1063): a PoE port's wired client. Same normalisation, `unread`
201750
+ * rule and owner check as {@link declareIdentifiers}, written through
201751
+ * `device-manager.setAttachedIdentifiers`. It never makes the two devices the
201752
+ * same device. Best-effort: never throws.
201753
+ */
201754
+ async declareAttachedIdentifiers(raw, options) {
201755
+ return declareDeviceIdentifiers({
201756
+ deviceId: this.id,
201757
+ logger: this.ctx.logger,
201758
+ writer: this.ctx.api.deviceManager?.setAttachedIdentifiers
201759
+ }, raw, options);
201760
+ }
201761
+ /**
200635
201762
  * Re-publish the device's current `features` array to the persisted
200636
201763
  * meta blob. Drivers call this after a probe finishes when the live
200637
201764
  * `features` getter has gained new flags (e.g. `hasIntercom` flips
@@ -201676,6 +202803,19 @@ var BaseDeviceProvider = class extends BaseAddon {
201676
202803
  return toDeviceSummary(device, this.addonId);
201677
202804
  }
201678
202805
  };
202806
+ /**
202807
+ * The `low-power-sleep` slice a provider projects from the `battery` slice it
202808
+ * already keeps: the sleep inputs, nothing else. One fact, one writer — the
202809
+ * provider's battery bookkeeping stays the source until the sleep state gets
202810
+ * its own writer.
202811
+ */
202812
+ function sleepSliceOfBattery(status) {
202813
+ return {
202814
+ sleeping: status.sleeping,
202815
+ ...status.lastContactAt !== void 0 ? { lastContactAt: status.lastContactAt } : {},
202816
+ lastUpdated: status.lastUpdated
202817
+ };
202818
+ }
201679
202819
  DeviceType.HeatPump;
201680
202820
  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;
201681
202821
  new Set(Object.values(DeviceType));
@@ -201886,8 +203026,8 @@ var ALARM_MODES = [
201886
203026
  "vacation",
201887
203027
  "custom_bypass"
201888
203028
  ];
201889
- function alarmControls(state, modes, requiresCode) {
201890
- if (requiresCode) return [];
203029
+ function alarmControls(state, modes, codeRequired) {
203030
+ if (codeRequired) return [];
201891
203031
  const disarm = asAction(action("alarm.disarm", t("Disarm", "Disinserisci"), "shield-off", "alarm-panel", "disarm", {}, "primary"));
201892
203032
  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")));
201893
203033
  switch (state) {
@@ -201907,7 +203047,7 @@ var ACCESS_FAMILY_CONTRIBUTIONS = {
201907
203047
  const modes = slice === void 0 ? ALARM_MODES : slice.availableModes;
201908
203048
  return {
201909
203049
  reading: reading("alarm-panel", words?.state ?? "unknown", false, words?.title),
201910
- 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))],
203050
+ 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))],
201911
203051
  ...since === null || words === null ? {} : { facts: [fact("since", "clock", since, state === "triggered" ? "danger" : "muted")] },
201912
203052
  ...words === null ? {} : { tiles: {
201913
203053
  left: [{
@@ -202347,23 +203487,56 @@ var fountainContribution = contribution("pet-fountain", PetFountainStatusSchema,
202347
203487
  };
202348
203488
  });
202349
203489
  var minutesOf = (seconds) => Math.max(0, Math.round(seconds / 60));
203490
+ var pumpCycleContribution = contribution("pump-cycle", PumpCycleStatusSchema, (slice) => {
203491
+ const enabled = slice?.enabled ?? null;
203492
+ const cycle = slice?.onTime != null && slice.offTime != null ? t(`${minutesOf(slice.onTime)} min on · ${minutesOf(slice.offTime)} min off`, `${minutesOf(slice.onTime)} min acceso · ${minutesOf(slice.offTime)} min spento`) : null;
203493
+ return { rows: [row$1("pump-cycle", "timer", enabled === null ? unknownText : enabled ? joinText([t("Cycling", "A cicli"), cycle]) : t("Runs continuously", "Sempre attiva"), [{
203494
+ kind: "toggle",
203495
+ id: "pump-cycle.enabled",
203496
+ label: t("Pump cycle", "Ciclo pompa"),
203497
+ on: enabled,
203498
+ turnOn: action("pump-cycle.on", t("Cycle the pump", "Attiva il ciclo"), "timer", "pump-cycle", "setEnabled", { on: true }),
203499
+ turnOff: action("pump-cycle.off", t("Run continuously", "Sempre attiva"), "timer-off", "pump-cycle", "setEnabled", { on: false })
203500
+ }])] };
203501
+ });
203502
+ var WORKLOAD_WORDS = {
203503
+ running: {
203504
+ state: "on",
203505
+ title: t("Running", "In esecuzione")
203506
+ },
203507
+ paused: {
203508
+ state: "standby",
203509
+ title: t("Paused", "In pausa")
203510
+ },
203511
+ stopped: {
203512
+ state: "off",
203513
+ title: t("Stopped", "Fermo")
203514
+ },
203515
+ starting: {
203516
+ state: "running",
203517
+ title: t("Starting", "In avvio")
203518
+ },
203519
+ stopping: {
203520
+ state: "running",
203521
+ title: t("Stopping", "In arresto")
203522
+ },
203523
+ crashed: {
203524
+ state: "alert",
203525
+ title: t("Crashed", "Andato in errore")
203526
+ }
203527
+ };
202350
203528
  var DEVICES_FAMILY_CONTRIBUTIONS = {
202351
203529
  "fan-control": fanContribution,
202352
203530
  "vacuum-control": vacuumContribution,
202353
203531
  "lawn-mower-control": mowerContribution,
202354
203532
  "pet-feeder": feederContribution,
202355
203533
  "pet-fountain": fountainContribution,
202356
- "pump-cycle": contribution("pump-cycle", PumpCycleStatusSchema, (slice) => {
202357
- const enabled = slice?.enabled ?? null;
202358
- const cycle = slice?.onTime != null && slice.offTime != null ? t(`${minutesOf(slice.onTime)} min on · ${minutesOf(slice.offTime)} min off`, `${minutesOf(slice.onTime)} min acceso · ${minutesOf(slice.offTime)} min spento`) : null;
202359
- return { rows: [row$1("pump-cycle", "timer", enabled === null ? unknownText : enabled ? joinText([t("Cycling", "A cicli"), cycle]) : t("Runs continuously", "Sempre attiva"), [{
202360
- kind: "toggle",
202361
- id: "pump-cycle.enabled",
202362
- label: t("Pump cycle", "Ciclo pompa"),
202363
- on: enabled,
202364
- turnOn: action("pump-cycle.on", t("Cycle the pump", "Attiva il ciclo"), "timer", "pump-cycle", "setEnabled", { on: true }),
202365
- turnOff: action("pump-cycle.off", t("Run continuously", "Sempre attiva"), "timer-off", "pump-cycle", "setEnabled", { on: false })
202366
- }])] };
203534
+ "pump-cycle": pumpCycleContribution,
203535
+ workload: contribution("workload", WorkloadStatusSchema, (slice) => {
203536
+ const state = slice?.state ?? null;
203537
+ if (state === null) return { reading: reading("workload", "unknown") };
203538
+ const words = WORKLOAD_WORDS[state];
203539
+ return { reading: reading("workload", words.state, false, words.title) };
202367
203540
  })
202368
203541
  };
202369
203542
  /**
@@ -204378,7 +205551,7 @@ lookOf({
204378
205551
  });
204379
205552
  DeviceType.Climate;
204380
205553
  DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Fan, 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;
204381
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
205554
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host, DeviceRole.Ups;
204382
205555
  Object.freeze({
204383
205556
  "accessories.getStatus": {
204384
205557
  capName: "accessories",
@@ -205290,13 +206463,6 @@ Object.freeze({
205290
206463
  access: "view",
205291
206464
  role: "viewer"
205292
206465
  },
205293
- "battery.wakeForStream": {
205294
- capName: "battery",
205295
- capScope: "device",
205296
- addonId: null,
205297
- access: "create",
205298
- role: "viewer"
205299
- },
205300
206466
  "binary.getStatus": {
205301
206467
  capName: "binary",
205302
206468
  capScope: "device",
@@ -206585,6 +207751,13 @@ Object.freeze({
206585
207751
  access: "create",
206586
207752
  role: "admin"
206587
207753
  },
207754
+ "deviceManager.confirmIdentityLink": {
207755
+ capName: "device-manager",
207756
+ capScope: "system",
207757
+ addonId: null,
207758
+ access: "create",
207759
+ role: "admin"
207760
+ },
206588
207761
  "deviceManager.createDevice": {
206589
207762
  capName: "device-manager",
206590
207763
  capScope: "system",
@@ -206634,6 +207807,13 @@ Object.freeze({
206634
207807
  access: "create",
206635
207808
  role: "admin"
206636
207809
  },
207810
+ "deviceManager.dismissIdentityLink": {
207811
+ capName: "device-manager",
207812
+ capScope: "system",
207813
+ addonId: null,
207814
+ access: "create",
207815
+ role: "admin"
207816
+ },
206637
207817
  "deviceManager.enable": {
206638
207818
  capName: "device-manager",
206639
207819
  capScope: "system",
@@ -206823,6 +208003,20 @@ Object.freeze({
206823
208003
  access: "view",
206824
208004
  role: "admin"
206825
208005
  },
208006
+ "deviceManager.listIdentityCandidates": {
208007
+ capName: "device-manager",
208008
+ capScope: "system",
208009
+ addonId: null,
208010
+ access: "view",
208011
+ role: "admin"
208012
+ },
208013
+ "deviceManager.listIdentityLinks": {
208014
+ capName: "device-manager",
208015
+ capScope: "system",
208016
+ addonId: null,
208017
+ access: "view",
208018
+ role: "admin"
208019
+ },
206826
208020
  "deviceManager.listLocationDescriptions": {
206827
208021
  capName: "device-manager",
206828
208022
  capScope: "system",
@@ -207019,6 +208213,13 @@ Object.freeze({
207019
208213
  access: "create",
207020
208214
  role: "admin"
207021
208215
  },
208216
+ "deviceManager.setAttachedIdentifiers": {
208217
+ capName: "device-manager",
208218
+ capScope: "system",
208219
+ addonId: null,
208220
+ access: "create",
208221
+ role: "admin"
208222
+ },
207022
208223
  "deviceManager.setChildLayout": {
207023
208224
  capName: "device-manager",
207024
208225
  capScope: "system",
@@ -207180,6 +208381,13 @@ Object.freeze({
207180
208381
  access: "create",
207181
208382
  role: "admin"
207182
208383
  },
208384
+ "deviceManager.unlinkIdentity": {
208385
+ capName: "device-manager",
208386
+ capScope: "system",
208387
+ addonId: null,
208388
+ access: "delete",
208389
+ role: "admin"
208390
+ },
207183
208391
  "deviceManager.updateConfig": {
207184
208392
  capName: "device-manager",
207185
208393
  capScope: "system",
@@ -207460,6 +208668,20 @@ Object.freeze({
207460
208668
  access: "create",
207461
208669
  role: "admin"
207462
208670
  },
208671
+ "deviceStateRefresh.refresh": {
208672
+ capName: "device-state-refresh",
208673
+ capScope: "device",
208674
+ addonId: null,
208675
+ access: "create",
208676
+ role: "admin"
208677
+ },
208678
+ "deviceStateRefresh.resubscribe": {
208679
+ capName: "device-state-refresh",
208680
+ capScope: "device",
208681
+ addonId: null,
208682
+ access: "create",
208683
+ role: "admin"
208684
+ },
207463
208685
  "deviceStatus.getStatus": {
207464
208686
  capName: "device-status",
207465
208687
  capScope: "device",
@@ -208944,6 +210166,20 @@ Object.freeze({
208944
210166
  access: "view",
208945
210167
  role: "admin"
208946
210168
  },
210169
+ "lowPowerSleep.getStatus": {
210170
+ capName: "low-power-sleep",
210171
+ capScope: "device",
210172
+ addonId: null,
210173
+ access: "view",
210174
+ role: "viewer"
210175
+ },
210176
+ "lowPowerSleep.wakeUp": {
210177
+ capName: "low-power-sleep",
210178
+ capScope: "device",
210179
+ addonId: null,
210180
+ access: "create",
210181
+ role: "viewer"
210182
+ },
208947
210183
  "mediaPlayer.channelDown": {
208948
210184
  capName: "media-player",
208949
210185
  capScope: "device",
@@ -211317,6 +212553,13 @@ Object.freeze({
211317
212553
  access: "view",
211318
212554
  role: "admin"
211319
212555
  },
212556
+ "pipelineOrchestrator.getStepSwitches": {
212557
+ capName: "pipeline-orchestrator",
212558
+ capScope: "system",
212559
+ addonId: null,
212560
+ access: "view",
212561
+ role: "admin"
212562
+ },
211320
212563
  "pipelineOrchestrator.listAgentSettings": {
211321
212564
  capName: "pipeline-orchestrator",
211322
212565
  capScope: "system",
@@ -211471,6 +212714,20 @@ Object.freeze({
211471
212714
  access: "create",
211472
212715
  role: "admin"
211473
212716
  },
212717
+ "pipelineOrchestrator.setClusterStepMode": {
212718
+ capName: "pipeline-orchestrator",
212719
+ capScope: "system",
212720
+ addonId: null,
212721
+ access: "create",
212722
+ role: "admin"
212723
+ },
212724
+ "pipelineOrchestrator.setDeviceStepEnabled": {
212725
+ capName: "pipeline-orchestrator",
212726
+ capScope: "system",
212727
+ addonId: null,
212728
+ access: "create",
212729
+ role: "admin"
212730
+ },
211474
212731
  "pipelineOrchestrator.setLoadBalancingShares": {
211475
212732
  capName: "pipeline-orchestrator",
211476
212733
  capScope: "system",
@@ -211478,6 +212735,13 @@ Object.freeze({
211478
212735
  access: "create",
211479
212736
  role: "admin"
211480
212737
  },
212738
+ "pipelineOrchestrator.setNodeStepEnabled": {
212739
+ capName: "pipeline-orchestrator",
212740
+ capScope: "system",
212741
+ addonId: null,
212742
+ access: "create",
212743
+ role: "admin"
212744
+ },
211481
212745
  "pipelineOrchestrator.setNodeStepSettings": {
211482
212746
  capName: "pipeline-orchestrator",
211483
212747
  capScope: "system",
@@ -212619,6 +213883,13 @@ Object.freeze({
212619
213883
  access: "view",
212620
213884
  role: "admin"
212621
213885
  },
213886
+ "resync.resync": {
213887
+ capName: "resync",
213888
+ capScope: "device",
213889
+ addonId: null,
213890
+ access: "create",
213891
+ role: "admin"
213892
+ },
212622
213893
  "runningState.getStatus": {
212623
213894
  capName: "running-state",
212624
213895
  capScope: "device",
@@ -215014,7 +216285,7 @@ Object.freeze({
215014
216285
  role: "admin"
215015
216286
  }
215016
216287
  });
215017
- DeviceFeature.BatteryOperated;
216288
+ DeviceFeature.Sleeps;
215018
216289
  function bound(cap, methods = [], authority = "reported") {
215019
216290
  return {
215020
216291
  kind: "cap",
@@ -215026,11 +216297,11 @@ function bound(cap, methods = [], authority = "reported") {
215026
216297
  function derived(cap, methods = []) {
215027
216298
  return bound(cap, methods, "derived");
215028
216299
  }
215029
- DeviceFeature.BatteryOperated, DeviceFeature.Rebootable, derived("reboot", ["reboot"]), DeviceFeature.Resyncable, DeviceFeature.NativeSnapshot, DeviceFeature.DoorbellButton, derived("doorbell"), DeviceFeature.TwoWayAudio, derived("intercom", [
216300
+ 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", [
215030
216301
  "startTalkSession",
215031
216302
  "pushTalkAudio",
215032
216303
  "endTalkSession"
215033
- ]), 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");
216304
+ ]), 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");
215034
216305
  var ALL_FEATURES = Object.values(DeviceFeature);
215035
216306
  new Set(ALL_FEATURES);
215036
216307
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
@@ -215073,7 +216344,7 @@ function offered(received) {
215073
216344
  }
215074
216345
  offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
215075
216346
  DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Workload, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, 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;
215076
- DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host;
216347
+ DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.PoePort, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter, DeviceRole.Vm, DeviceRole.AppContainer, DeviceRole.Lxc, DeviceRole.App, DeviceRole.Host, DeviceRole.Ups;
215077
216348
  new Set(Object.values(DeviceType));
215078
216349
  new Set(Object.values(DeviceRole));
215079
216350
  var LAST_FETCHED_FIELD = "lastFetchedAt";
@@ -215378,11 +216649,6 @@ Object.freeze({
215378
216649
  form: "single",
215379
216650
  optional: false
215380
216651
  }],
215381
- "battery.wakeForStream": [{
215382
- name: "deviceId",
215383
- form: "single",
215384
- optional: false
215385
- }],
215386
216652
  "binary.getStatus": [{
215387
216653
  name: "deviceId",
215388
216654
  form: "single",
@@ -215862,6 +217128,11 @@ Object.freeze({
215862
217128
  form: "array",
215863
217129
  optional: true
215864
217130
  }],
217131
+ "deviceManager.listIdentityLinks": [{
217132
+ name: "deviceId",
217133
+ form: "single",
217134
+ optional: true
217135
+ }],
215865
217136
  "deviceManager.loadConfig": [{
215866
217137
  name: "deviceId",
215867
217138
  form: "single",
@@ -215912,6 +217183,11 @@ Object.freeze({
215912
217183
  form: "single",
215913
217184
  optional: false
215914
217185
  }],
217186
+ "deviceManager.setAttachedIdentifiers": [{
217187
+ name: "deviceId",
217188
+ form: "single",
217189
+ optional: false
217190
+ }],
215915
217191
  "deviceManager.setChildLayout": [{
215916
217192
  name: "deviceId",
215917
217193
  form: "single",
@@ -216106,6 +217382,20 @@ Object.freeze({
216106
217382
  form: "single",
216107
217383
  optional: false
216108
217384
  }],
217385
+ "deviceStateRefresh.refresh": [{
217386
+ name: "deviceId",
217387
+ form: "single",
217388
+ optional: false
217389
+ }, {
217390
+ name: "deviceIds",
217391
+ form: "array",
217392
+ optional: false
217393
+ }],
217394
+ "deviceStateRefresh.resubscribe": [{
217395
+ name: "deviceId",
217396
+ form: "single",
217397
+ optional: false
217398
+ }],
216109
217399
  "deviceStatus.getStatus": [{
216110
217400
  name: "deviceId",
216111
217401
  form: "single",
@@ -216566,6 +217856,16 @@ Object.freeze({
216566
217856
  form: "single",
216567
217857
  optional: true
216568
217858
  }],
217859
+ "lowPowerSleep.getStatus": [{
217860
+ name: "deviceId",
217861
+ form: "single",
217862
+ optional: false
217863
+ }],
217864
+ "lowPowerSleep.wakeUp": [{
217865
+ name: "deviceId",
217866
+ form: "single",
217867
+ optional: false
217868
+ }],
216569
217869
  "mediaPlayer.channelDown": [{
216570
217870
  name: "deviceId",
216571
217871
  form: "single",
@@ -217851,6 +219151,11 @@ Object.freeze({
217851
219151
  form: "single",
217852
219152
  optional: false
217853
219153
  }],
219154
+ "resync.resync": [{
219155
+ name: "deviceId",
219156
+ form: "single",
219157
+ optional: false
219158
+ }],
217854
219159
  "runningState.getStatus": [{
217855
219160
  name: "deviceId",
217856
219161
  form: "single",
@@ -227010,7 +228315,8 @@ function capDayNightModeToReolink(mode) {
227010
228315
  * `features = ['native-snapshot','rebootable']` because the `feature-probe`
227011
228316
  * slice had never been written.
227012
228317
  *
227013
- * That miss is not cosmetic. `DeviceFeature.BatteryOperated` is the gate for:
228318
+ * That miss is not cosmetic. `DeviceFeature.BatteryOperated` (and, since #459,
228319
+ * `DeviceFeature.Sleeps` beside it) is the gate for:
227014
228320
  * - the viewer's battery badge + sleeping overlay (`use-cameras.ts` FEATURE
227015
228321
  * map) — without it the camera is drawn as an ordinary awake camera;
227016
228322
  * - the snapshot wrapper's sleep gate (`snapshot.addon.ts`
@@ -227024,10 +228330,19 @@ function capDayNightModeToReolink(mode) {
227024
228330
  * clears it). This makes the DERIVED answer sticky the same way, for the
227025
228331
  * window before any probe has ever succeeded.
227026
228332
  */
228333
+ /**
228334
+ * The ONE Reolink answer to "is this a battery camera that sleeps" (#459, Q2).
228335
+ * The published features (`BatteryOperated` + `Sleeps`) and the registration
228336
+ * of the `battery` and `low-power-sleep` caps both ask it, so a camera that
228337
+ * claims `Sleeps` in the stream catalog is also one the registry can wake.
228338
+ */
228339
+ function reolinkCameraSleeps(inputs) {
228340
+ return inputs.probe.hasBattery === true || inputs.isBattery;
228341
+ }
227027
228342
  function deriveReolinkCameraFeatures(inputs) {
227028
- const { probe, isBattery } = inputs;
228343
+ const { probe } = inputs;
227029
228344
  const out = [DeviceFeature.NativeSnapshot, DeviceFeature.Rebootable];
227030
- if (probe.hasBattery === true || isBattery) out.push(DeviceFeature.BatteryOperated);
228345
+ if (reolinkCameraSleeps(inputs)) out.push(DeviceFeature.BatteryOperated, DeviceFeature.Sleeps);
227031
228346
  if (probe.hasPtz === true) out.push(DeviceFeature.PanTiltZoom);
227032
228347
  if (probe.hasAutotrack === true) out.push(DeviceFeature.PtzAutotrack);
227033
228348
  if (probe.hasIntercom === true) out.push(DeviceFeature.TwoWayAudio);
@@ -228910,7 +230225,7 @@ function applyHubChildSections(sections, snapshot) {
228910
230225
  * costs when we get them wrong.
228911
230226
  *
228912
230227
  * `→ awake` (`WAKE_HYSTERESIS_MS`): expensive if wrong. Believing an asleep
228913
- * camera is awake un-gates every background probe and makes `wakeForStream`
230228
+ * camera is awake un-gates every background probe and makes `wakeUp`
228914
230229
  * early-out without actually waking. Keep the window >= the library's UDP
228915
230230
  * inference cycle (~12 s on battery cams with idle-disconnect) and >= its
228916
230231
  * `getIdleDisconnectTimeoutMs` (30 s default).
@@ -228947,7 +230262,7 @@ function isSummarySourced(source) {
228947
230262
  * the anti-flap window does not apply to it at all.
228948
230263
  * 3. A `confirmed-wake` in the `→ awake` direction is first-hand evidence
228949
230264
  * this process produced: gating it with the anti-flap window is what
228950
- * stranded 3825's mirror on "asleep" while `wakeForStream` answered
230265
+ * stranded 3825's mirror on "asleep" while `wakeUp` answered
228951
230266
  * `awoke: true`.
228952
230267
  * 4. Everything else is subject to the asymmetric hysteresis.
228953
230268
  * 5. A summary flip toward `sleeping` is refused while a first-hand
@@ -232553,10 +233868,14 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
232553
233868
  return effectiveProbeFlags(this.hasProbed(), super.getProbeFlags(), this.config?.get("deviceCache"));
232554
233869
  }
232555
233870
  get features() {
232556
- return deriveReolinkCameraFeatures({
233871
+ return deriveReolinkCameraFeatures(this.featureInputs());
233872
+ }
233873
+ /** What the features and the battery / sleep registration both read. */
233874
+ featureInputs() {
233875
+ return {
232557
233876
  probe: this.getProbeFlags(),
232558
233877
  isBattery: this.isBattery
232559
- });
233878
+ };
232560
233879
  }
232561
233880
  /** Lazy-connected Baichuan API. Spans the lifetime of every active stream. */
232562
233881
  api = null;
@@ -232694,7 +234013,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
232694
234013
  lastProactiveWakeAt = 0;
232695
234014
  /**
232696
234015
  * Minimum gap between two proactive wakes. Demand-driven wakes
232697
- * (`wakeForStream` from the broker, `wakeIfSleeping` behind an
234016
+ * (`wakeUp` from the broker, `wakeIfSleeping` behind an
232698
234017
  * operator action, the intercom pre-wake) bypass this entirely —
232699
234018
  * the operator asked, the operator gets the camera. Only
232700
234019
  * self-initiated wakes are rate-limited, so a thumbnail cache miss
@@ -233561,7 +234880,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
233561
234880
  * (proactive config buttons such as Auto-configure email push). A
233562
234881
  * sleeping battery cam ignores Baichuan config round-trips, so clicking
233563
234882
  * "configure" would otherwise silently fail; this drives the same forced
233564
- * wake `wakeForStream` uses, then lets the caller proceed against a live
234883
+ * wake `wakeUp` uses, then lets the caller proceed against a live
233565
234884
  * camera. No-op for non-battery or already-awake cams. Best-effort:
233566
234885
  * returns whether the camera is (now) reachable/awake.
233567
234886
  */
@@ -233983,14 +235302,18 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
233983
235302
  */
233984
235303
  registerBatteryIfSupported() {
233985
235304
  if (this.batteryRegistered) return;
233986
- if (!this.isBattery) return;
235305
+ if (!reolinkCameraSleeps(this.featureInputs())) return;
233987
235306
  this.batteryRegistered = true;
233988
- this.ctx.registerNativeCap(batteryCapability, {
235307
+ this.ctx.registerNativeCap(batteryCapability, { getStatus: async ({ deviceId }) => {
235308
+ if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
235309
+ return this.state.battery;
235310
+ } });
235311
+ this.ctx.registerNativeCap(lowPowerSleepCapability, {
233989
235312
  getStatus: async ({ deviceId }) => {
233990
235313
  if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
233991
- return this.state.battery;
235314
+ return sleepSliceOfBattery(this.state.battery);
233992
235315
  },
233993
- wakeForStream: async ({ deviceId, timeoutMs }) => {
235316
+ wakeUp: async ({ deviceId, timeoutMs }) => {
233994
235317
  if (deviceId !== this.id) throw new Error(`ReolinkCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
233995
235318
  const startedAt = Date.now();
233996
235319
  if (!this.sleeping) return {
@@ -234007,7 +235330,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234007
235330
  };
234008
235331
  }
234009
235332
  this.markWakeIssued();
234010
- this.ctx.logger.info("battery wakeForStream: cam sleeping — issuing wake", {
235333
+ this.ctx.logger.info("battery wakeUp: cam sleeping — issuing wake", {
234011
235334
  tags: { deviceId: this.id },
234012
235335
  meta: { timeoutMs }
234013
235336
  });
@@ -234020,7 +235343,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234020
235343
  attempts: 2
234021
235344
  });
234022
235345
  await sleep(1500);
234023
- })(), new Promise((_, rej) => setTimeout(() => rej(/* @__PURE__ */ new Error("wakeForStream timeout")), timeoutMs))]);
235346
+ })(), new Promise((_, rej) => setTimeout(() => rej(/* @__PURE__ */ new Error("wakeUp timeout")), timeoutMs))]);
234024
235347
  const CONFIRM_TIMEOUT_MS = 1e4;
234025
235348
  const CONFIRM_POLL_MS = 1e3;
234026
235349
  const confirmDeadline = Date.now() + CONFIRM_TIMEOUT_MS;
@@ -234053,7 +235376,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234053
235376
  }
234054
235377
  const confirmSource = parent !== null ? "hub-summary" : "sleep-poll";
234055
235378
  if (observedAwake && this.commitSleepState(false, confirmSource)) {
234056
- this.ctx.logger.info("battery wakeForStream: wake confirmed — driving wake transition", {
235379
+ this.ctx.logger.info("battery wakeUp: wake confirmed — driving wake transition", {
234057
235380
  tags: { deviceId: this.id },
234058
235381
  meta: {
234059
235382
  confirmMs: Date.now() - startedAt,
@@ -234062,7 +235385,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234062
235385
  });
234063
235386
  this.onWakeTransition(confirmSource).catch(() => {});
234064
235387
  } else if (!confirmed) {
234065
- this.ctx.logger.warn("battery wakeForStream: ACK received but no awake evidence inside the confirm window", {
235388
+ this.ctx.logger.warn("battery wakeUp: ACK received but no awake evidence inside the confirm window", {
234066
235389
  tags: { deviceId: this.id },
234067
235390
  meta: { confirmTimeoutMs: CONFIRM_TIMEOUT_MS }
234068
235391
  });
@@ -234074,7 +235397,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234074
235397
  }
234075
235398
  if (confirmed && !observedAwake && parent !== null) this.watchHubChildAwake(parent).catch(() => {});
234076
235399
  if (this.commitSleepState(false, "confirmed-wake")) {
234077
- this.ctx.logger.info("battery wakeForStream: answering awake — committing the mirror", {
235400
+ this.ctx.logger.info("battery wakeUp: answering awake — committing the mirror", {
234078
235401
  tags: { deviceId: this.id },
234079
235402
  meta: {
234080
235403
  confirmedMs: Date.now() - startedAt,
@@ -234088,7 +235411,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234088
235411
  durationMs: Date.now() - startedAt
234089
235412
  };
234090
235413
  } catch (err) {
234091
- this.ctx.logger.warn("battery wakeForStream: wake did not complete in time", {
235414
+ this.ctx.logger.warn("battery wakeUp: wake did not complete in time", {
234092
235415
  tags: { deviceId: this.id },
234093
235416
  meta: {
234094
235417
  timeoutMs,
@@ -234111,11 +235434,13 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234111
235434
  });
234112
235435
  this.runtimeState.subscribeCap("battery", (slice) => {
234113
235436
  if (!slice) return;
235437
+ this.setCapSlice(lowPowerSleepCapability, sleepSliceOfBattery(slice));
234114
235438
  this.ctx.eventBus.emit(createEvent(EventCategory.BatteryOnStatusChanged, this.eventSource(), {
234115
235439
  deviceId: this.id,
234116
235440
  status: slice
234117
235441
  }));
234118
235442
  });
235443
+ this.setCapSlice(lowPowerSleepCapability, sleepSliceOfBattery(this.state.battery));
234119
235444
  this.refreshBatteryFromApi("register");
234120
235445
  }
234121
235446
  /**
@@ -234231,7 +235556,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234231
235556
  * `PROACTIVE_WAKE_COOLDOWN_MS` ago — the caller must then serve
234232
235557
  * whatever it has cached instead of reaching for the radio.
234233
235558
  *
234234
- * Demand-driven paths never call this: `wakeForStream` (a consumer
235559
+ * Demand-driven paths never call this: `wakeUp` (a consumer
234235
235560
  * wants live video), `wakeIfSleeping` (an operator clicked
234236
235561
  * something) and the intercom pre-wake all wake unconditionally.
234237
235562
  */
@@ -234270,7 +235595,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
234270
235595
  try {
234271
235596
  if ((await (await parent.getApi()).getNvrChannelsSummary({ channels: [this.getChannel()] })).devices.find((d) => d.channel === this.getChannel())?.sleeping === false) {
234272
235597
  if (this.commitSleepState(false, "hub-summary")) {
234273
- this.ctx.logger.info("battery wakeForStream: hub child observed awake after the dial", { tags: { deviceId: this.id } });
235598
+ this.ctx.logger.info("battery wakeUp: hub child observed awake after the dial", { tags: { deviceId: this.id } });
234274
235599
  this.onWakeTransition("hub-summary").catch(() => {});
234275
235600
  }
234276
235601
  return;
@@ -240304,6 +241629,7 @@ var ReolinkCamera = class ReolinkCamera extends BaseDevice {
240304
241629
  this.registerPtzAutotrackIfSupported();
240305
241630
  this.registerDoorbellIfSupported();
240306
241631
  this.registerIntercomIfSupported();
241632
+ this.registerBatteryIfSupported();
240307
241633
  this.ctx.logger.info("Reolink features probed + persisted", {
240308
241634
  tags: { deviceId: this.id },
240309
241635
  meta: {
@@ -241420,8 +242746,18 @@ function buildReolinkInstances(records, deps) {
241420
242746
  * NVR / Home Hub one does, and a create wizard (no id yet) sets up a hub.
241421
242747
  */
241422
242748
  function reolinkInstancesProvider(instances, deps) {
242749
+ const base = instances.toProvider();
242750
+ const withAddDevice = async (instance) => ({
242751
+ ...instance,
242752
+ addDevice: await integrationIsHub(instances, deps, instance.id) ? "children" : "scan"
242753
+ });
241423
242754
  return {
241424
- ...instances.toProvider(),
242755
+ ...base,
242756
+ listInstances: async (input) => Promise.all((await base.listInstances(input)).map(withAddDevice)),
242757
+ getInstance: async (input) => {
242758
+ const found = await base.getInstance(input);
242759
+ return found === null ? null : withAddDevice(found);
242760
+ },
241425
242761
  instanceFormSchema: async ({ id }) => {
241426
242762
  if (id === null) return buildHubInstanceSchema();
241427
242763
  const [evidence, body] = await Promise.all([deps.registryEvidenceOf(id), instances.getResolved(id)]);