@camstack/types 1.2.563 → 1.2.565

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 (45) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/addon/base-addon.d.ts +6 -0
  3. package/dist/addon.js +2 -2
  4. package/dist/addon.mjs +2 -2
  5. package/dist/capabilities/device-manager.cap.d.ts +16 -16
  6. package/dist/capabilities/device-provider.cap.d.ts +7 -7
  7. package/dist/capabilities/device-search.d.ts +4 -4
  8. package/dist/capabilities/energy-system.cap.d.ts +10 -0
  9. package/dist/capabilities/media-player.cap.d.ts +3 -0
  10. package/dist/capabilities/migrations.cap.d.ts +1 -0
  11. package/dist/capabilities/remote.cap.d.ts +1 -0
  12. package/dist/client.js +2 -3
  13. package/dist/client.mjs +2 -3
  14. package/dist/{composed-stable-id-Bp33yrYi.js → composed-stable-id-BzXh1Swk.js} +0 -2
  15. package/dist/{composed-stable-id-B3wcvtvW.mjs → composed-stable-id-COP6zOXx.mjs} +0 -2
  16. package/dist/{convert-BmtM6K-5.js → convert-BI8iTXn6.js} +15 -0
  17. package/dist/{convert-BAzH15HU.mjs → convert-BwMfbk5b.mjs} +15 -0
  18. package/dist/device/device-control-resolution.d.ts +1 -1
  19. package/dist/device/device-icon.d.ts +0 -1
  20. package/dist/device/device-type.d.ts +0 -2
  21. package/dist/device/hero/build-hero-model.d.ts +3 -0
  22. package/dist/device/hero/hero-fragment.d.ts +3 -0
  23. package/dist/device/hero/hero-layout.d.ts +0 -1
  24. package/dist/device/hero/hero-look.d.ts +0 -6
  25. package/dist/device/hero/hero-row.d.ts +1 -1
  26. package/dist/device/hero/hero-scene.d.ts +0 -1
  27. package/dist/device/hero/media-player-view.d.ts +2 -1
  28. package/dist/device/source-info.d.ts +1 -1
  29. package/dist/generated/addon-cap-facts.d.ts +1 -1
  30. package/dist/generated/customize-catalog.d.ts +1 -1
  31. package/dist/generated/history-catalog.d.ts +1 -1
  32. package/dist/{implemented-methods-CgUBu6uM.mjs → implemented-methods-0xxMOekw.mjs} +1 -1
  33. package/dist/{implemented-methods-CDYOCn9a.js → implemented-methods-D4F6RWkO.js} +1 -1
  34. package/dist/index.js +57 -26
  35. package/dist/index.mjs +57 -26
  36. package/dist/migrations/addon-migration.d.ts +5 -0
  37. package/dist/node.js +2 -2
  38. package/dist/node.mjs +2 -2
  39. package/dist/{sleep-BCWQQG52.mjs → sleep-B5XPl2YP.mjs} +28 -3
  40. package/dist/{sleep-RUgd-FgK.js → sleep-mEzgbYFJ.js} +28 -3
  41. package/dist/units/quantity.d.ts +1 -1
  42. package/dist/units/unit-table.d.ts +1 -1
  43. package/dist/units-lean.js +1 -1
  44. package/dist/units-lean.mjs +1 -1
  45. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-Dv-Gcv1f.mjs";
2
- import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-B3wcvtvW.mjs";
2
+ import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-COP6zOXx.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -916,7 +916,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
916
916
  try {
917
917
  declaration = await host.declareOwner({
918
918
  owner,
919
- metas: migrations.map((m) => m.meta)
919
+ metas: migrations.map((m) => m.meta),
920
+ ...options.retired === void 0 ? {} : { retired: [...options.retired] }
920
921
  });
921
922
  } catch (err) {
922
923
  log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
@@ -3218,6 +3219,14 @@ var BaseAddon = class {
3218
3219
  declareRegistrySwitch(spec) {
3219
3220
  this.registrySwitchSpec = spec;
3220
3221
  }
3222
+ /**
3223
+ * Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
3224
+ * every declaration so the engine does not read their applied rows as a newer database.
3225
+ */
3226
+ retiredMigrationIds = [];
3227
+ declareRetiredMigrations(ids) {
3228
+ this.retiredMigrationIds = ids;
3229
+ }
3221
3230
  registrySwitchSpec = null;
3222
3231
  registrySwitchBound() {
3223
3232
  const spec = this.registrySwitchSpec;
@@ -3241,10 +3250,14 @@ var BaseAddon = class {
3241
3250
  async runBound(declared, options) {
3242
3251
  const added = this.registrySwitchBound();
3243
3252
  const migrations = [...declared, ...added];
3244
- const phased = options?.only === void 0 || added.length === 0 ? options : {
3253
+ const widened = options?.only === void 0 || added.length === 0 ? options : {
3245
3254
  ...options,
3246
3255
  only: [...options.only, ...added.map((m) => m.meta.id)]
3247
3256
  };
3257
+ const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
3258
+ ...widened,
3259
+ retired: this.retiredMigrationIds
3260
+ };
3248
3261
  const api = this.ctx.api.migrations;
3249
3262
  const report = await runAddonMigrations({
3250
3263
  declareOwner: (input) => api.declareOwner.mutate(input),
@@ -6850,6 +6863,8 @@ var READING_QUANTITIES = [
6850
6863
  "information",
6851
6864
  "sound-level",
6852
6865
  "signal-level",
6866
+ "signal-ratio",
6867
+ "frequency",
6853
6868
  "colour-temperature",
6854
6869
  "angle",
6855
6870
  "bitrate",
@@ -6896,6 +6911,8 @@ var QUANTITY_BASE = {
6896
6911
  information: "B",
6897
6912
  "sound-level": "dBFS",
6898
6913
  "signal-level": "dBm",
6914
+ "signal-ratio": "dB",
6915
+ frequency: "Hz",
6899
6916
  "colour-temperature": "mired",
6900
6917
  angle: "°",
6901
6918
  bitrate: "kbps",
@@ -18002,6 +18019,10 @@ var CAP_STATE_LEAVES = Object.freeze({
18002
18019
  {
18003
18020
  "path": "storage.dischargedTodayKwh",
18004
18021
  "valueType": "number"
18022
+ },
18023
+ {
18024
+ "path": "storage.healthPct",
18025
+ "valueType": "number"
18005
18026
  }
18006
18027
  ],
18007
18028
  "enum-sensor": [{
@@ -18382,6 +18403,10 @@ var CAP_STATE_LEAVES = Object.freeze({
18382
18403
  "path": "isMuted",
18383
18404
  "valueType": "boolean"
18384
18405
  },
18406
+ {
18407
+ "path": "muteReadback",
18408
+ "valueType": "boolean"
18409
+ },
18385
18410
  {
18386
18411
  "path": "source",
18387
18412
  "valueType": "string"
@@ -1,5 +1,5 @@
1
1
  const require_event_category = require("./event-category-Ps2LC8dN.js");
2
- const require_composed_stable_id = require("./composed-stable-id-Bp33yrYi.js");
2
+ const require_composed_stable_id = require("./composed-stable-id-BzXh1Swk.js");
3
3
  let zod = require("zod");
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -916,7 +916,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
916
916
  try {
917
917
  declaration = await host.declareOwner({
918
918
  owner,
919
- metas: migrations.map((m) => m.meta)
919
+ metas: migrations.map((m) => m.meta),
920
+ ...options.retired === void 0 ? {} : { retired: [...options.retired] }
920
921
  });
921
922
  } catch (err) {
922
923
  log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: require_composed_stable_id.errMsg(err) } });
@@ -3218,6 +3219,14 @@ var BaseAddon = class {
3218
3219
  declareRegistrySwitch(spec) {
3219
3220
  this.registrySwitchSpec = spec;
3220
3221
  }
3222
+ /**
3223
+ * Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
3224
+ * every declaration so the engine does not read their applied rows as a newer database.
3225
+ */
3226
+ retiredMigrationIds = [];
3227
+ declareRetiredMigrations(ids) {
3228
+ this.retiredMigrationIds = ids;
3229
+ }
3221
3230
  registrySwitchSpec = null;
3222
3231
  registrySwitchBound() {
3223
3232
  const spec = this.registrySwitchSpec;
@@ -3241,10 +3250,14 @@ var BaseAddon = class {
3241
3250
  async runBound(declared, options) {
3242
3251
  const added = this.registrySwitchBound();
3243
3252
  const migrations = [...declared, ...added];
3244
- const phased = options?.only === void 0 || added.length === 0 ? options : {
3253
+ const widened = options?.only === void 0 || added.length === 0 ? options : {
3245
3254
  ...options,
3246
3255
  only: [...options.only, ...added.map((m) => m.meta.id)]
3247
3256
  };
3257
+ const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
3258
+ ...widened,
3259
+ retired: this.retiredMigrationIds
3260
+ };
3248
3261
  const api = this.ctx.api.migrations;
3249
3262
  const report = await runAddonMigrations({
3250
3263
  declareOwner: (input) => api.declareOwner.mutate(input),
@@ -6850,6 +6863,8 @@ var READING_QUANTITIES = [
6850
6863
  "information",
6851
6864
  "sound-level",
6852
6865
  "signal-level",
6866
+ "signal-ratio",
6867
+ "frequency",
6853
6868
  "colour-temperature",
6854
6869
  "angle",
6855
6870
  "bitrate",
@@ -6896,6 +6911,8 @@ var QUANTITY_BASE = {
6896
6911
  information: "B",
6897
6912
  "sound-level": "dBFS",
6898
6913
  "signal-level": "dBm",
6914
+ "signal-ratio": "dB",
6915
+ frequency: "Hz",
6899
6916
  "colour-temperature": "mired",
6900
6917
  angle: "°",
6901
6918
  bitrate: "kbps",
@@ -18002,6 +18019,10 @@ var CAP_STATE_LEAVES = Object.freeze({
18002
18019
  {
18003
18020
  "path": "storage.dischargedTodayKwh",
18004
18021
  "valueType": "number"
18022
+ },
18023
+ {
18024
+ "path": "storage.healthPct",
18025
+ "valueType": "number"
18005
18026
  }
18006
18027
  ],
18007
18028
  "enum-sensor": [{
@@ -18382,6 +18403,10 @@ var CAP_STATE_LEAVES = Object.freeze({
18382
18403
  "path": "isMuted",
18383
18404
  "valueType": "boolean"
18384
18405
  },
18406
+ {
18407
+ "path": "muteReadback",
18408
+ "valueType": "boolean"
18409
+ },
18385
18410
  {
18386
18411
  "path": "source",
18387
18412
  "valueType": "string"
@@ -9,7 +9,7 @@
9
9
  * numeric control): the quantity is chosen once, on the device, at adopt.
10
10
  */
11
11
  import { z } from 'zod';
12
- declare const READING_QUANTITY_VALUES: readonly ['temperature', 'pressure', 'speed', 'precipitation', 'precipitation-rate', 'length', 'area', 'illuminance', 'irradiance', 'power', 'energy', 'voltage', 'current', 'apparent-power', 'humidity', 'percentage', 'concentration-volume', 'concentration-mass', 'concentration-ppb', 'volume', 'duration', 'duration-ms', 'information', 'sound-level', 'signal-level', 'colour-temperature', 'angle', 'bitrate', 'rate', 'mass', 'index', 'ratio', 'count', 'none', 'device'];
12
+ declare const READING_QUANTITY_VALUES: readonly ['temperature', 'pressure', 'speed', 'precipitation', 'precipitation-rate', 'length', 'area', 'illuminance', 'irradiance', 'power', 'energy', 'voltage', 'current', 'apparent-power', 'humidity', 'percentage', 'concentration-volume', 'concentration-mass', 'concentration-ppb', 'volume', 'duration', 'duration-ms', 'information', 'sound-level', 'signal-level', 'signal-ratio', 'frequency', 'colour-temperature', 'angle', 'bitrate', 'rate', 'mass', 'index', 'ratio', 'count', 'none', 'device'];
13
13
  export declare const READING_QUANTITIES: typeof READING_QUANTITY_VALUES;
14
14
  export type ReadingQuantity = (typeof READING_QUANTITIES)[number];
15
15
  export declare const ReadingQuantitySchema: z.ZodType<ReadingQuantity>;
@@ -23,7 +23,7 @@
23
23
  * conversion stays refused.
24
24
  */
25
25
  /** The physical dimensions CamStack surfaces across HA + Ecowitt + vendors. */
26
- export type UnitDimension = 'temperature' | 'pressure' | 'speed' | 'precipitation-rate' | 'length' | 'area' | 'illuminance' | 'irradiance' | 'power' | 'apparent-power' | 'energy' | 'voltage' | 'current' | 'concentration-volume' | 'concentration-mass' | 'mass' | 'percentage' | 'volume' | 'duration' | 'information' | 'angle' | 'sound-level' | 'signal-level' | 'colour-temperature' | 'bitrate' | 'rate';
26
+ export type UnitDimension = 'temperature' | 'pressure' | 'speed' | 'precipitation-rate' | 'length' | 'area' | 'illuminance' | 'irradiance' | 'power' | 'apparent-power' | 'energy' | 'voltage' | 'current' | 'concentration-volume' | 'concentration-mass' | 'mass' | 'percentage' | 'volume' | 'duration' | 'information' | 'angle' | 'sound-level' | 'signal-level' | 'signal-ratio' | 'frequency' | 'colour-temperature' | 'bitrate' | 'rate';
27
27
  /**
28
28
  * Linear conversion spec: `canonical = value * factor + offset`. Temperature is
29
29
  * the ONLY family using a non-zero `offset`.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_convert = require("./convert-BmtM6K-5.js");
2
+ const require_convert = require("./convert-BI8iTXn6.js");
3
3
  exports.UNIT_TABLE = require_convert.UNIT_TABLE;
4
4
  exports.tryConvertUnit = require_convert.tryConvertUnit;
5
5
  exports.unitDimension = require_convert.unitDimension;
@@ -1,2 +1,2 @@
1
- import { a as tryConvertUnit, c as UNIT_TABLE, o as unitDimension } from "./convert-BAzH15HU.mjs";
1
+ import { a as tryConvertUnit, c as UNIT_TABLE, o as unitDimension } from "./convert-BwMfbk5b.mjs";
2
2
  export { UNIT_TABLE, tryConvertUnit, unitDimension };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.563",
3
+ "version": "1.2.565",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",