@camstack/addon-provider-homematic 1.2.207 → 1.2.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (15) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/_stub.js +2 -2
  3. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-6DzqqZ3i.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-CWWYk9PV.mjs} +4 -4
  4. package/dist/{_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DR952fPS.mjs → _virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-O65jH-mE.mjs} +1 -1
  5. package/dist/addon.js +215 -21
  6. package/dist/addon.mjs +215 -21
  7. package/dist/{hostInit-CZgDBnHg.mjs → hostInit-D_zf6ohM.mjs} +3 -3
  8. package/dist/remoteEntry.js +1 -1
  9. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-ZgMsVU2w.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-Bgts9bVd.mjs} +1 -1
  10. package/dist/widgets/_stub.js +1 -1
  11. package/dist/widgets/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-CtPGHIKn.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_widgets-Dlfyrtfr.mjs} +2 -2
  12. package/dist/widgets/{_virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-7hqlX2gW.mjs → _virtual_mf___mfe_internal__addon_provider_homematic_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DPAzT3m6.mjs} +1 -1
  13. package/dist/widgets/{hostInit-Cy3RS8VW.mjs → hostInit-Yhkl--bk.mjs} +2 -2
  14. package/dist/widgets/remoteEntry.js +1 -1
  15. package/package.json +4 -4
package/dist/addon.js CHANGED
@@ -6131,7 +6131,7 @@ var ZodIssueCode = {
6131
6131
  var ZodFirstPartyTypeKind;
6132
6132
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6133
6133
  //#endregion
6134
- //#region ../types/dist/runtime-capabilities-qX7BpOYT.mjs
6134
+ //#region ../types/dist/runtime-capabilities-B36VcCR6.mjs
6135
6135
  /**
6136
6136
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6137
6137
  * window to float samples (D455).
@@ -10724,14 +10724,104 @@ var SubscribeAudioChunksInputSchema = object({
10724
10724
  var SubscribeAudioChunksResultSchema = object({
10725
10725
  /** Opaque id passed to `pullAudioChunks` / `unsubscribeAudioChunks`. */
10726
10726
  subscriptionId: string() });
10727
- var BrokerStatsSchema = object({
10728
- status: _enum([
10729
- "idle",
10730
- "connecting",
10731
- "streaming",
10732
- "error",
10733
- "stopped"
10727
+ var BrokerStatusSchema = _enum([
10728
+ "idle",
10729
+ "connecting",
10730
+ "streaming",
10731
+ "error",
10732
+ "stopped"
10733
+ ]);
10734
+ /**
10735
+ * The encode a derived stream's feeder was last spawned with — the read-only
10736
+ * "effective encode". Read off the ffmpeg argv that runs, so it cannot drift
10737
+ * from what the operator's profile and the carrier's rules resolved to.
10738
+ */
10739
+ var DerivedEffectiveEncodeSchema = object({
10740
+ /** `-c:v` of the argv (`libx264`, a hardware encoder, `copy`); null when absent. */
10741
+ encoder: string().nullable(),
10742
+ /** Output frame rate; null when the source cadence passes through unmeasured. */
10743
+ fps: number$1().nullable(),
10744
+ gopFrames: number$1(),
10745
+ /** ABR target (`-b:v`), kbps. */
10746
+ targetKbps: number$1().nullable(),
10747
+ /** Ceiling (`-maxrate`), kbps. */
10748
+ capKbps: number$1().nullable(),
10749
+ bufsizeKbps: number$1().nullable(),
10750
+ /**
10751
+ * `copy` = source audio untouched, `aac` = re-encoded, `profile` = operator's
10752
+ * encode, `none` = the operator dropped the track.
10753
+ */
10754
+ audio: _enum([
10755
+ "copy",
10756
+ "aac",
10757
+ "profile",
10758
+ "none"
10759
+ ])
10760
+ });
10761
+ /**
10762
+ * A derived stream's source: a **profile** slot (follows whatever physical
10763
+ * stream that profile is assigned to) or a **camStream** (pinned to one
10764
+ * physical stream regardless of assignment).
10765
+ */
10766
+ var DerivedSourceRefSchema = union([object({
10767
+ kind: literal("profile"),
10768
+ profile: _enum([
10769
+ "high",
10770
+ "mid",
10771
+ "low"
10772
+ ])
10773
+ }), object({
10774
+ kind: literal("camStream"),
10775
+ camStreamId: string()
10776
+ })]);
10777
+ object({
10778
+ width: number$1().nullable(),
10779
+ height: number$1().nullable(),
10780
+ fps: number$1().nullable(),
10781
+ idrIntervalMs: number$1().nullable(),
10782
+ /** `h264` / `h265` when observed. */
10783
+ videoCodec: _enum(["h264", "h265"]).nullable(),
10784
+ /** Upper-cased SDP name (`AAC`, `PCMU`) when the source has an audio track. */
10785
+ audioCodec: string().nullable()
10786
+ });
10787
+ /**
10788
+ * The full effective encode of a derived-stream profile: the stats the broker
10789
+ * publishes in `getBrokerStats.derivedEncode` plus the resolved geometry, the
10790
+ * flags that say WHY a number differs from the request, and the ffmpeg output
10791
+ * argv. One function (`computeDerivedEncode`) produces it for both the
10792
+ * broker's start path and `previewDerivedEncode`.
10793
+ */
10794
+ var DerivedEncodePreviewSchema = DerivedEffectiveEncodeSchema.extend({
10795
+ /** Final picture size; `null` when neither the profile nor the source names it. */
10796
+ width: number$1().nullable(),
10797
+ height: number$1().nullable(),
10798
+ /** `h264` / `h265` re-encode, `copy` remux; `null` is never returned (the encoder always resolves). */
10799
+ videoCodec: _enum([
10800
+ "h264",
10801
+ "h265",
10802
+ "copy"
10734
10803
  ]),
10804
+ requestedFps: number$1().nullable(),
10805
+ /** The requested fps exceeded the source and the source cadence won. */
10806
+ fpsClampedToSource: boolean(),
10807
+ /** Lowest bitrate accepted for this geometry x fps; `null` when unknown. */
10808
+ floorKbps: number$1().nullable(),
10809
+ /** The explicit bitrate was below the floor and was raised to it. */
10810
+ raisedToFloor: boolean(),
10811
+ /** What the profile asked for when it was raised; `null` otherwise. */
10812
+ requestedKbps: number$1().nullable(),
10813
+ /** Seconds between keyframes; `null` when the output cadence is unknown. */
10814
+ keyframeIntervalSec: number$1().nullable(),
10815
+ /** The ffmpeg argv, with the source loopback URL in `-i`. */
10816
+ args: array(string())
10817
+ });
10818
+ /** Result of `previewDerivedEncode`: a plan, or the reason there is none. */
10819
+ var PreviewDerivedEncodeResultSchema = discriminatedUnion("kind", [object({
10820
+ kind: literal("preview"),
10821
+ preview: DerivedEncodePreviewSchema
10822
+ }), object({ kind: literal("no-source") })]);
10823
+ var BrokerStatsSchema = object({
10824
+ status: BrokerStatusSchema,
10735
10825
  inputFps: number$1(),
10736
10826
  encodedSubscribers: number$1(),
10737
10827
  uptimeMs: number$1(),
@@ -10771,7 +10861,9 @@ var BrokerStatsSchema = object({
10771
10861
  * alone that the mute is on the packet path and not merely persisted.
10772
10862
  */
10773
10863
  audioMuted: boolean().optional(),
10774
- audioMutedDropped: number$1().optional()
10864
+ audioMutedDropped: number$1().optional(),
10865
+ /** Present for a derived broker once its feeder has spawned at least once. */
10866
+ derivedEncode: DerivedEffectiveEncodeSchema.optional()
10775
10867
  });
10776
10868
  /**
10777
10869
  * Exporter-facing "profile restream" entry. Returned by
@@ -23206,7 +23298,7 @@ Object.freeze({
23206
23298
  }
23207
23299
  });
23208
23300
  //#endregion
23209
- //#region ../types/dist/implemented-methods-wFScvZ40.mjs
23301
+ //#region ../types/dist/implemented-methods-BUBqZ2a0.mjs
23210
23302
  /**
23211
23303
  * The ffmpeg build every CamStack node downloads, per platform and arch.
23212
23304
  *
@@ -25814,10 +25906,16 @@ looseObject({
25814
25906
  TargetSchema.omit({ id: true });
25815
25907
  var EncodeProfileSchema = object({
25816
25908
  video: object({
25909
+ /**
25910
+ * `h264` / `h265` re-encode into that codec; `source` re-encodes in whatever
25911
+ * codec the source speaks (a resize that keeps the codec); `copy` remuxes
25912
+ * with no encode at all (so no resize either).
25913
+ */
25817
25914
  codec: _enum([
25818
25915
  "h264",
25819
25916
  "h265",
25820
- "copy"
25917
+ "copy",
25918
+ "source"
25821
25919
  ]),
25822
25920
  profile: _enum([
25823
25921
  "baseline",
@@ -25869,12 +25967,14 @@ var EncodeProfileSchema = object({
25869
25967
  singleSlicePerFrame: boolean().optional()
25870
25968
  }),
25871
25969
  audio: union([literal("passthrough"), object({
25970
+ /** `none` drops the audio track (`-an`); `copy` carries the source's. */
25872
25971
  codec: _enum([
25873
25972
  "opus",
25874
25973
  "aac",
25875
25974
  "pcmu",
25876
25975
  "pcma",
25877
- "copy"
25976
+ "copy",
25977
+ "none"
25878
25978
  ]),
25879
25979
  bitrateKbps: number$1().int().positive().optional(),
25880
25980
  sampleRateHz: number$1().int().positive().optional(),
@@ -56596,7 +56696,11 @@ method(object({
56596
56696
  }).nullable(), {
56597
56697
  kind: "mutation",
56598
56698
  auth: "admin"
56599
- }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({ brokerId: string() }), object({
56699
+ }), method(_void(), array(CameraStreamSchema).readonly()), method(_void(), array(ProfileSlotSchema).readonly()), method(object({ brokerId: string() }), BrokerStatsSchema), method(object({
56700
+ deviceId: number$1().int().nonnegative(),
56701
+ profile: EncodeProfileSchema,
56702
+ source: DerivedSourceRefSchema.optional()
56703
+ }), PreviewDerivedEncodeResultSchema), method(object({ brokerId: string() }), object({
56600
56704
  probed: boolean(),
56601
56705
  summary: string()
56602
56706
  }), {
@@ -76988,7 +77092,13 @@ method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngi
76988
77092
  /** Pool deaths inside the current window. */
76989
77093
  deaths: number$1(),
76990
77094
  /** The last death's message. */
76991
- lastError: string()
77095
+ lastError: string(),
77096
+ /**
77097
+ * Present when the device is ABSENT rather than dead: the runtime
77098
+ * itself enumerates no such device (`no-gpu-device` — OpenVINO sees
77099
+ * no supported GPU; driver/runtime does not support this iGPU).
77100
+ */
77101
+ absentReason: _enum(["no-gpu-device"]).optional()
76992
77102
  })).readonly() })), method(object({
76993
77103
  nodeId: string(),
76994
77104
  deviceKey: string()
@@ -77882,7 +77992,8 @@ var StatelessStepRefusalSchema = _enum([
77882
77992
  "unknown-step",
77883
77993
  "model-not-servable",
77884
77994
  "unreadable-frame",
77885
- "execution-failed"
77995
+ "execution-failed",
77996
+ "no-eligible-device"
77886
77997
  ]);
77887
77998
  /**
77888
77999
  * Answer to `runStatelessStep` — a discriminated union rather than a nullable
@@ -85271,7 +85382,8 @@ var InferenceDeviceExclusionReasonSchema = _enum([
85271
85382
  "unavailable",
85272
85383
  "cannot-host-camera-root",
85273
85384
  "accelerator-preferred",
85274
- "root-switched-off"
85385
+ "root-switched-off",
85386
+ "no-gpu-device"
85275
85387
  ]);
85276
85388
  var NodeInferenceDeviceSchema = object({
85277
85389
  /** Stable per-node device key, e.g. `openvino:npu`, `edgetpu:usb`, `cpu`. */
@@ -85304,7 +85416,13 @@ var NodeInferenceDeviceSchema = object({
85304
85416
  enabled: boolean(),
85305
85417
  /** Relative balancer weight for the enabled device (default 1). */
85306
85418
  weight: number$1(),
85307
- /** Per-device concurrent-session cap; null = unlimited (multi-device C4). */
85419
+ /**
85420
+ * Per-device concurrent-session cap; null = unlimited (multi-device C4). A
85421
+ * limit: a camera no device can take within its cap stays on the node's
85422
+ * default pool — EXCEPT when that default pool is an excluded device
85423
+ * (`defaultPoolExcluded`), where it goes over the cap on the least-loaded
85424
+ * eligible device instead (#610).
85425
+ */
85308
85426
  maxSessions: number$1().nullable(),
85309
85427
  /** Object-detection model the executor defaults to for this deviceKey. */
85310
85428
  defaultModelId: string(),
@@ -85354,7 +85472,15 @@ var NodeInferenceDevicesSchema = object({
85354
85472
  nodeId: string(),
85355
85473
  /** False when the node's platform-probe was unreachable (no live device set). */
85356
85474
  reachable: boolean(),
85357
- devices: array(NodeInferenceDeviceSchema).readonly()
85475
+ devices: array(NodeInferenceDeviceSchema).readonly(),
85476
+ /**
85477
+ * The election left NO device and one was excluded because the operator
85478
+ * turned it off or it is not functional (#610): the runner's default pool is
85479
+ * that device, so work with no explicit device (a stateless step, a bench with
85480
+ * no `deviceKey`) is refused rather than run there. Absent = an orchestrator
85481
+ * older than the field, or an unreachable node: nothing is claimed (D315).
85482
+ */
85483
+ defaultPoolExcluded: boolean().optional()
85358
85484
  });
85359
85485
  /**
85360
85486
  * The CLUSTER switch of one pipeline step (D1065):
@@ -112055,6 +112181,13 @@ Object.freeze({
112055
112181
  access: "view",
112056
112182
  role: "admin"
112057
112183
  },
112184
+ "streamBroker.previewDerivedEncode": {
112185
+ capName: "stream-broker",
112186
+ capScope: "system",
112187
+ addonId: null,
112188
+ access: "view",
112189
+ role: "admin"
112190
+ },
112058
112191
  "streamBroker.probeStream": {
112059
112192
  capName: "stream-broker",
112060
112193
  capScope: "system",
@@ -116501,6 +116634,11 @@ Object.freeze({
116501
116634
  form: "single",
116502
116635
  optional: false
116503
116636
  }],
116637
+ "streamBroker.previewDerivedEncode": [{
116638
+ name: "deviceId",
116639
+ form: "single",
116640
+ optional: false
116641
+ }],
116504
116642
  "streamBroker.produceEventMedia": [{
116505
116643
  name: "deviceId",
116506
116644
  form: "single",
@@ -119476,12 +119614,38 @@ function toCcuDeviceRow(device) {
119476
119614
  }))
119477
119615
  };
119478
119616
  }
119617
+ /** Per live facade: a reconnect builds a new facade, whose names were just read. */
119618
+ var states = /* @__PURE__ */ new WeakMap();
119619
+ /**
119620
+ * Serve-and-revalidate for the CCU names a page shows: the caller answers from
119621
+ * the names the facade holds now, and when they are older than the window one
119622
+ * background re-read starts, so the next read shows the new names. No timer:
119623
+ * only a read starts it, and a read never waits for it.
119624
+ */
119625
+ function revalidateCcuNames(deps, integrationId, facade, now = Date.now()) {
119626
+ const state = states.get(facade);
119627
+ if (state !== void 0 && (state.inFlight || now - state.startedAt < 6e4)) return;
119628
+ const next = {
119629
+ startedAt: now,
119630
+ inFlight: true
119631
+ };
119632
+ states.set(facade, next);
119633
+ facade.refreshNames().catch((err) => {
119634
+ deps.logger.warn("Homematic: CCU names could not be re-read, keeping the ones shown", { meta: {
119635
+ integrationId,
119636
+ error: errorText(err)
119637
+ } });
119638
+ }).finally(() => {
119639
+ next.inFlight = false;
119640
+ });
119641
+ }
119479
119642
  //#endregion
119480
119643
  //#region src/ccu/ccu-devices-actions.ts
119481
119644
  /** The CCU device list: every device the CCU knows, with its radio and maintenance health. */
119482
119645
  function buildCcuDevicesHandlers(deps) {
119483
119646
  return { listCcuDevices: async (input) => {
119484
119647
  const facade = requireFacade(deps, input.integrationId);
119648
+ revalidateCcuNames(deps, input.integrationId, facade);
119485
119649
  const adopted = await deps.adoptedAddresses(input.integrationId);
119486
119650
  return { devices: await Promise.all(facade.devices().map(async (device) => {
119487
119651
  const links = await keyChannelsForDevice(deps, input.integrationId, device, adopted);
@@ -119961,8 +120125,15 @@ var SetValueInputSchema = IntegrationRefSchema.extend({
119961
120125
  });
119962
120126
  //#endregion
119963
120127
  //#region src/ccu/ccu-heating-actions.ts
119964
- /** Channel types that can sit in a heating group (HmIP and HomeMatic thermostats, wall thermostats, radiator valves). */
119965
- var HEATING_CHANNEL = /THERMOSTAT|CLIMATECONTROL|THERMALCONTROL/i;
120128
+ /**
120129
+ * Channel types the CCU accepts as heating-group members: the climate channel
120130
+ * that both reports and is commanded (`*_TRANSCEIVER`: HmIP thermostats and
120131
+ * radiator valves `:1`, floor-heating actuators, the HomeMatic RT thermostat),
120132
+ * and the classic wall thermostat's `THERMALCONTROL_TRANSMIT`. The device's other
120133
+ * climate channels (`*_RECEIVER`, `*_TRANSMITTER`: link endpoints for the
120134
+ * shutter contact, key, floor sensor, boiler demand) are not members.
120135
+ */
120136
+ var HEATING_GROUP_MEMBER = /^(?:HEATING_)?CLIMATECONTROL_(?:RT_|FLOOR_)?TRANSCEIVER$|^THERMALCONTROL_TRANSMIT$/;
119966
120137
  function deviceAddressOf$1(channelAddress) {
119967
120138
  const colon = channelAddress.indexOf(":");
119968
120139
  return colon === -1 ? channelAddress : channelAddress.slice(0, colon);
@@ -119984,7 +120155,7 @@ function toGroup$1(group, names) {
119984
120155
  }
119985
120156
  function candidatesOf(devices) {
119986
120157
  const out = [];
119987
- for (const device of devices) for (const channel of device.channels) if (channel.type !== void 0 && HEATING_CHANNEL.test(channel.type)) out.push({
120158
+ for (const device of devices) for (const channel of device.channels) if (channel.type !== void 0 && HEATING_GROUP_MEMBER.test(channel.type)) out.push({
119988
120159
  address: channel.address,
119989
120160
  type: channel.type,
119990
120161
  deviceName: device.name ?? null
@@ -120005,6 +120176,7 @@ function buildCcuHeatingHandlers(deps) {
120005
120176
  return {
120006
120177
  listHeatingGroups: async (input) => {
120007
120178
  const facade = requireFacade(deps, input.integrationId);
120179
+ revalidateCcuNames(deps, input.integrationId, facade);
120008
120180
  const devices = facade.devices();
120009
120181
  const names = new Map(devices.map((device) => [device.address, device.name ?? null]));
120010
120182
  let groups = [];
@@ -142440,6 +142612,16 @@ var CentralUnit = class {
142440
142612
  }
142441
142613
  }
142442
142614
  /**
142615
+ * Re-read the WebUI names, rooms and functions and keep them for later
142616
+ * discoveries. Resolves `undefined` (and keeps the previous snapshot) when
142617
+ * there is no WebUI login or the read failed.
142618
+ */
142619
+ async refreshDetails() {
142620
+ const fresh = await this.fetchDetails();
142621
+ if (fresh !== void 0) this.details = fresh;
142622
+ return fresh;
142623
+ }
142624
+ /**
142443
142625
  * Incrementally (re-)discover a set of device addresses on an interface. Used
142444
142626
  * by `newDevices` / `replaceDevice` / `readdedDevice`. Re-runs the full
142445
142627
  * interface discovery (idempotent: the caches dedup) and re-emits the touched
@@ -142448,6 +142630,7 @@ var CentralUnit = class {
142448
142630
  async discoverAddresses(interfaceId2, addresses, publish) {
142449
142631
  const runtime = this.runtimes.get(interfaceId2);
142450
142632
  if (runtime === void 0) return;
142633
+ if (publish) await this.refreshDetails();
142451
142634
  const nodes = await discoverInterface({
142452
142635
  source: runtime.client,
142453
142636
  deviceCache: this.deviceCache,
@@ -144197,6 +144380,17 @@ var Homematic = class {
144197
144380
  devices() {
144198
144381
  return [...this.#devicesByAddress.values()].map((device) => toHmDevice(device, this.#roomsByDevice.get(device.address), this.#functionsByDevice.get(device.address), this.#renamedNames));
144199
144382
  }
144383
+ /**
144384
+ * Re-read device and channel names from the CCU WebUI, so a rename made on
144385
+ * the CCU (or a name given after pairing) shows in `devices()`. Keeps the
144386
+ * names it has when there are no WebUI credentials or the read fails.
144387
+ */
144388
+ async refreshNames() {
144389
+ const details = await this.#central.refreshDetails();
144390
+ if (details === void 0) return;
144391
+ this.#renamedNames.clear();
144392
+ for (const [address, name2] of details.nameByAddress) this.#renamedNames.set(address, name2);
144393
+ }
144200
144394
  /** Current value of a data point (resolving the ref). */
144201
144395
  getValue(ref) {
144202
144396
  return this.#resolveDataPoint(ref).value;