@camstack/types 1.2.609 → 1.2.610

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/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.2.610] - 2026-11-20
11
+
12
+ ### Added
13
+
14
+ - A heat pump's electrical power and energy can be read from a device you pick in Customize
15
+
10
16
  ## [1.2.609] - 2026-11-20
11
17
 
12
18
  ### Added
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { type InferProvider } from './capability-definition.js';
3
+ import type { ScalarCustomizeTarget } from './customize-spec.js';
3
4
  import { DeviceType } from '../device/device-type.js';
4
5
  /**
5
6
  * Heat pump status (D1026): the one main, READ-ONLY cap of a heat pump. Every
@@ -433,6 +434,14 @@ export declare const heatPumpStatusCapability: {
433
434
  * (the series are recorded). See `RuntimeStateDurability`.
434
435
  */
435
436
  readonly durability: 'session';
437
+ readonly customize: {
438
+ readonly version: 1;
439
+ readonly overridable: {
440
+ path: string;
441
+ by: string;
442
+ }[];
443
+ readonly targets: readonly ScalarCustomizeTarget[];
444
+ };
436
445
  /**
437
446
  * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
438
447
  * field, named by the circuit's label. The mode is a state (D896); the energy
@@ -1,7 +1,7 @@
1
1
  import { DeviceType } from '../device/device-type.js';
2
2
  /**
3
3
  * Customize catalog, projected from every `*.cap.ts` `customize` block.
4
- * 13 caps. Field keys are `runtimeState` paths. No Zod.
4
+ * 14 caps. Field keys are `runtimeState` paths. No Zod.
5
5
  */
6
6
  export declare const CAP_CUSTOMIZE_CATALOG: {
7
7
  readonly battery: {
@@ -490,6 +490,59 @@ export declare const CAP_CUSTOMIZE_CATALOG: {
490
490
  readonly advancedExpression: false;
491
491
  }];
492
492
  };
493
+ readonly 'heat-pump-status': {
494
+ readonly version: 1;
495
+ readonly targets: readonly [{
496
+ readonly id: 'electrical-power';
497
+ readonly cardinality: 'scalar';
498
+ readonly deviceTypes: readonly [DeviceType.HeatPump];
499
+ readonly apply: 'replace';
500
+ readonly vocabularyCap: 'heat-pump-status';
501
+ readonly sources: readonly [{
502
+ readonly kind: 'numeric';
503
+ readonly requiredUnit: 'W';
504
+ readonly transformKinds: readonly ["identity"];
505
+ readonly transforms: readonly [{
506
+ readonly kind: 'identity';
507
+ }];
508
+ }];
509
+ readonly sourceReport: {
510
+ readonly status: 'assignment-status';
511
+ };
512
+ readonly advancedExpression: false;
513
+ readonly path: 'power.electricalW';
514
+ readonly valueKind: 'number';
515
+ readonly nullable: true;
516
+ }, {
517
+ readonly id: 'electrical-energy';
518
+ readonly cardinality: 'scalar';
519
+ readonly deviceTypes: readonly [DeviceType.HeatPump];
520
+ readonly apply: 'replace';
521
+ readonly vocabularyCap: 'heat-pump-status';
522
+ readonly sources: readonly [{
523
+ readonly kind: 'numeric';
524
+ readonly requiredUnit: 'kWh';
525
+ readonly transformKinds: readonly ["identity"];
526
+ readonly transforms: readonly [{
527
+ readonly kind: 'identity';
528
+ }];
529
+ }];
530
+ readonly sourceReport: {
531
+ readonly status: 'assignment-status';
532
+ };
533
+ readonly advancedExpression: false;
534
+ readonly path: 'energy.electricalKwh';
535
+ readonly valueKind: 'number';
536
+ readonly nullable: true;
537
+ }];
538
+ readonly overridable: readonly [{
539
+ readonly path: 'power.electricalW';
540
+ readonly by: 'electrical-power';
541
+ }, {
542
+ readonly path: 'energy.electricalKwh';
543
+ readonly by: 'electrical-energy';
544
+ }];
545
+ };
493
546
  readonly 'lock-control': {
494
547
  readonly version: 1;
495
548
  readonly targets: readonly [{
package/dist/index.js CHANGED
@@ -49249,7 +49249,7 @@ var mediaPlayerCapability = {
49249
49249
  //#region src/generated/customize-catalog.ts
49250
49250
  /**
49251
49251
  * Customize catalog, projected from every `*.cap.ts` `customize` block.
49252
- * 13 caps. Field keys are `runtimeState` paths. No Zod.
49252
+ * 14 caps. Field keys are `runtimeState` paths. No Zod.
49253
49253
  */
49254
49254
  var CAP_CUSTOMIZE_CATALOG = {
49255
49255
  "battery": {
@@ -49783,6 +49783,51 @@ var CAP_CUSTOMIZE_CATALOG = {
49783
49783
  advancedExpression: false
49784
49784
  }]
49785
49785
  },
49786
+ "heat-pump-status": {
49787
+ version: 1,
49788
+ targets: [{
49789
+ id: "electrical-power",
49790
+ cardinality: "scalar",
49791
+ deviceTypes: [require_composed_stable_id.DeviceType.HeatPump],
49792
+ apply: "replace",
49793
+ vocabularyCap: "heat-pump-status",
49794
+ sources: [{
49795
+ kind: "numeric",
49796
+ requiredUnit: "W",
49797
+ transformKinds: ["identity"],
49798
+ transforms: [{ kind: "identity" }]
49799
+ }],
49800
+ sourceReport: { status: "assignment-status" },
49801
+ advancedExpression: false,
49802
+ path: "power.electricalW",
49803
+ valueKind: "number",
49804
+ nullable: true
49805
+ }, {
49806
+ id: "electrical-energy",
49807
+ cardinality: "scalar",
49808
+ deviceTypes: [require_composed_stable_id.DeviceType.HeatPump],
49809
+ apply: "replace",
49810
+ vocabularyCap: "heat-pump-status",
49811
+ sources: [{
49812
+ kind: "numeric",
49813
+ requiredUnit: "kWh",
49814
+ transformKinds: ["identity"],
49815
+ transforms: [{ kind: "identity" }]
49816
+ }],
49817
+ sourceReport: { status: "assignment-status" },
49818
+ advancedExpression: false,
49819
+ path: "energy.electricalKwh",
49820
+ valueKind: "number",
49821
+ nullable: true
49822
+ }],
49823
+ overridable: [{
49824
+ path: "power.electricalW",
49825
+ by: "electrical-power"
49826
+ }, {
49827
+ path: "energy.electricalKwh",
49828
+ by: "electrical-energy"
49829
+ }]
49830
+ },
49786
49831
  "lock-control": {
49787
49832
  version: 1,
49788
49833
  targets: [{
@@ -64979,6 +65024,43 @@ function heatPumpInstantCop(power) {
64979
65024
  if (thermalW === null || electricalW === null || electricalW <= 0) return null;
64980
65025
  return thermalW / electricalW;
64981
65026
  }
65027
+ var HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES = [require_composed_stable_id.DeviceType.HeatPump];
65028
+ /** One electrical reading the operator may take from a device they pick, unit checked. */
65029
+ function electricalTarget(id, path, unit) {
65030
+ return {
65031
+ id,
65032
+ cardinality: "scalar",
65033
+ vocabulary: { cap: "heat-pump-status" },
65034
+ deviceTypes: HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES,
65035
+ apply: "replace",
65036
+ path,
65037
+ sources: [{
65038
+ kind: "numeric",
65039
+ requiredUnit: unit,
65040
+ transforms: [{ kind: "identity" }]
65041
+ }],
65042
+ sourceReport: { status: "assignment-status" }
65043
+ };
65044
+ }
65045
+ var HEAT_PUMP_TARGETS = [electricalTarget("electrical-power", "power.electricalW", "W"), electricalTarget("electrical-energy", "energy.electricalKwh", "kWh")];
65046
+ /**
65047
+ * Customize (D984, #476): a gateway that reports no instantaneous electrical
65048
+ * power (the cloud ones) or whose energy meter the operator trusts less than a
65049
+ * dedicated one lets the OPERATOR pick a device for `power.electricalW` and
65050
+ * `energy.electricalKwh` — a `replace` over a field listed in `overridable`,
65051
+ * nothing else. The replaced value IS the cap field, so the instant COP, the
65052
+ * hero pills and the history use it; nothing is linked by itself (D356), the
65053
+ * unit is checked, and a source that does not answer releases the field back to
65054
+ * the native reading (never a 0, D393).
65055
+ */
65056
+ var heatPumpStatusCustomize = {
65057
+ version: 1,
65058
+ overridable: HEAT_PUMP_TARGETS.map((target) => ({
65059
+ path: target.path,
65060
+ by: target.id
65061
+ })),
65062
+ targets: HEAT_PUMP_TARGETS
65063
+ };
64982
65064
  var heatPumpStatusCapability = {
64983
65065
  name: "heat-pump-status",
64984
65066
  scope: "device",
@@ -64997,6 +65079,7 @@ var heatPumpStatusCapability = {
64997
65079
  * (the series are recorded). See `RuntimeStateDurability`.
64998
65080
  */
64999
65081
  durability: "session",
65082
+ customize: heatPumpStatusCustomize,
65000
65083
  /**
65001
65084
  * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
65002
65085
  * field, named by the circuit's label. The mode is a state (D896); the energy
package/dist/index.mjs CHANGED
@@ -49248,7 +49248,7 @@ var mediaPlayerCapability = {
49248
49248
  //#region src/generated/customize-catalog.ts
49249
49249
  /**
49250
49250
  * Customize catalog, projected from every `*.cap.ts` `customize` block.
49251
- * 13 caps. Field keys are `runtimeState` paths. No Zod.
49251
+ * 14 caps. Field keys are `runtimeState` paths. No Zod.
49252
49252
  */
49253
49253
  var CAP_CUSTOMIZE_CATALOG = {
49254
49254
  "battery": {
@@ -49782,6 +49782,51 @@ var CAP_CUSTOMIZE_CATALOG = {
49782
49782
  advancedExpression: false
49783
49783
  }]
49784
49784
  },
49785
+ "heat-pump-status": {
49786
+ version: 1,
49787
+ targets: [{
49788
+ id: "electrical-power",
49789
+ cardinality: "scalar",
49790
+ deviceTypes: [DeviceType.HeatPump],
49791
+ apply: "replace",
49792
+ vocabularyCap: "heat-pump-status",
49793
+ sources: [{
49794
+ kind: "numeric",
49795
+ requiredUnit: "W",
49796
+ transformKinds: ["identity"],
49797
+ transforms: [{ kind: "identity" }]
49798
+ }],
49799
+ sourceReport: { status: "assignment-status" },
49800
+ advancedExpression: false,
49801
+ path: "power.electricalW",
49802
+ valueKind: "number",
49803
+ nullable: true
49804
+ }, {
49805
+ id: "electrical-energy",
49806
+ cardinality: "scalar",
49807
+ deviceTypes: [DeviceType.HeatPump],
49808
+ apply: "replace",
49809
+ vocabularyCap: "heat-pump-status",
49810
+ sources: [{
49811
+ kind: "numeric",
49812
+ requiredUnit: "kWh",
49813
+ transformKinds: ["identity"],
49814
+ transforms: [{ kind: "identity" }]
49815
+ }],
49816
+ sourceReport: { status: "assignment-status" },
49817
+ advancedExpression: false,
49818
+ path: "energy.electricalKwh",
49819
+ valueKind: "number",
49820
+ nullable: true
49821
+ }],
49822
+ overridable: [{
49823
+ path: "power.electricalW",
49824
+ by: "electrical-power"
49825
+ }, {
49826
+ path: "energy.electricalKwh",
49827
+ by: "electrical-energy"
49828
+ }]
49829
+ },
49785
49830
  "lock-control": {
49786
49831
  version: 1,
49787
49832
  targets: [{
@@ -64978,6 +65023,43 @@ function heatPumpInstantCop(power) {
64978
65023
  if (thermalW === null || electricalW === null || electricalW <= 0) return null;
64979
65024
  return thermalW / electricalW;
64980
65025
  }
65026
+ var HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES = [DeviceType.HeatPump];
65027
+ /** One electrical reading the operator may take from a device they pick, unit checked. */
65028
+ function electricalTarget(id, path, unit) {
65029
+ return {
65030
+ id,
65031
+ cardinality: "scalar",
65032
+ vocabulary: { cap: "heat-pump-status" },
65033
+ deviceTypes: HEAT_PUMP_CUSTOMIZE_DEVICE_TYPES,
65034
+ apply: "replace",
65035
+ path,
65036
+ sources: [{
65037
+ kind: "numeric",
65038
+ requiredUnit: unit,
65039
+ transforms: [{ kind: "identity" }]
65040
+ }],
65041
+ sourceReport: { status: "assignment-status" }
65042
+ };
65043
+ }
65044
+ var HEAT_PUMP_TARGETS = [electricalTarget("electrical-power", "power.electricalW", "W"), electricalTarget("electrical-energy", "energy.electricalKwh", "kWh")];
65045
+ /**
65046
+ * Customize (D984, #476): a gateway that reports no instantaneous electrical
65047
+ * power (the cloud ones) or whose energy meter the operator trusts less than a
65048
+ * dedicated one lets the OPERATOR pick a device for `power.electricalW` and
65049
+ * `energy.electricalKwh` — a `replace` over a field listed in `overridable`,
65050
+ * nothing else. The replaced value IS the cap field, so the instant COP, the
65051
+ * hero pills and the history use it; nothing is linked by itself (D356), the
65052
+ * unit is checked, and a source that does not answer releases the field back to
65053
+ * the native reading (never a 0, D393).
65054
+ */
65055
+ var heatPumpStatusCustomize = {
65056
+ version: 1,
65057
+ overridable: HEAT_PUMP_TARGETS.map((target) => ({
65058
+ path: target.path,
65059
+ by: target.id
65060
+ })),
65061
+ targets: HEAT_PUMP_TARGETS
65062
+ };
64981
65063
  var heatPumpStatusCapability = {
64982
65064
  name: "heat-pump-status",
64983
65065
  scope: "device",
@@ -64996,6 +65078,7 @@ var heatPumpStatusCapability = {
64996
65078
  * (the series are recorded). See `RuntimeStateDurability`.
64997
65079
  */
64998
65080
  durability: "session",
65081
+ customize: heatPumpStatusCustomize,
64999
65082
  /**
65000
65083
  * History (D850, D917): `circuits[]` is a keyed array — one series per circuit and
65001
65084
  * field, named by the circuit's label. The mode is a state (D896); the energy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.609",
3
+ "version": "1.2.610",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",