@camstack/types 1.2.547 → 1.2.549

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 (84) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/addon.js +5 -5
  3. package/dist/addon.mjs +5 -5
  4. package/dist/automation/condition-eval.d.ts +24 -0
  5. package/dist/automation/hold.d.ts +11 -0
  6. package/dist/automation/index.d.ts +6 -4
  7. package/dist/automation/recipe.d.ts +5 -0
  8. package/dist/automation/step-condition.d.ts +7 -2
  9. package/dist/automation/trace.d.ts +6 -0
  10. package/dist/automation/trigger-variables.d.ts +3 -1
  11. package/dist/automation/when-site.d.ts +27 -0
  12. package/dist/automation/when.d.ts +107 -1
  13. package/dist/capabilities/accessories.cap.d.ts +1 -1
  14. package/dist/capabilities/actions.cap.d.ts +2 -0
  15. package/dist/capabilities/battery.cap.d.ts +2 -2
  16. package/dist/capabilities/capability-definition.d.ts +47 -1
  17. package/dist/capabilities/climate-control.cap.d.ts +8 -1
  18. package/dist/capabilities/core-blocks.cap.d.ts +8 -0
  19. package/dist/capabilities/customize-catalog.d.ts +3 -1
  20. package/dist/capabilities/customize-spec.d.ts +26 -2
  21. package/dist/capabilities/device-manager.cap.d.ts +6 -0
  22. package/dist/capabilities/fan-control.cap.d.ts +248 -0
  23. package/dist/capabilities/fan-presets.cap.d.ts +172 -536
  24. package/dist/capabilities/group-active.cap.d.ts +1 -1
  25. package/dist/capabilities/group-commands.cap.d.ts +1 -1
  26. package/dist/capabilities/group-status.cap.d.ts +1 -1
  27. package/dist/capabilities/heating-valve.cap.d.ts +1 -1
  28. package/dist/capabilities/hero-layout.cap.d.ts +2 -0
  29. package/dist/capabilities/humidifier.cap.d.ts +5 -0
  30. package/dist/capabilities/humidity-sensor.cap.d.ts +1 -1
  31. package/dist/capabilities/index.d.ts +4 -4
  32. package/dist/capabilities/media-player.cap.d.ts +7 -0
  33. package/dist/capabilities/pet-fountain.cap.d.ts +5 -0
  34. package/dist/capabilities/power-meter.cap.d.ts +5 -5
  35. package/dist/capabilities/power-source.cap.d.ts +5 -0
  36. package/dist/capabilities/running-state.cap.d.ts +2 -2
  37. package/dist/capabilities/schedulers.cap.d.ts +2 -0
  38. package/dist/capabilities/switch.cap.d.ts +1 -1
  39. package/dist/capabilities/temperature-sensor.cap.d.ts +1 -1
  40. package/dist/capabilities/timed-run.cap.d.ts +19 -5
  41. package/dist/capabilities/water-heater.cap.d.ts +7 -0
  42. package/dist/client.js +7 -11
  43. package/dist/client.mjs +7 -11
  44. package/dist/{composed-stable-id-DrGLxjVF.js → composed-stable-id-CDNLq7Y8.js} +27 -10
  45. package/dist/{composed-stable-id-DFNyOFzz.mjs → composed-stable-id-CPp3votu.mjs} +27 -10
  46. package/dist/composition/composition-report.d.ts +6 -0
  47. package/dist/composition/evaluate-field.d.ts +7 -0
  48. package/dist/composition/field-kinds.d.ts +12 -1
  49. package/dist/composition/helpers/index.d.ts +1 -1
  50. package/dist/composition/helpers/source-pick.d.ts +0 -5
  51. package/dist/composition/power-source-link.d.ts +15 -0
  52. package/dist/composition/state-fields.d.ts +2 -0
  53. package/dist/composition/validate-composition.d.ts +15 -1
  54. package/dist/device/base-device-provider.d.ts +13 -0
  55. package/dist/device/device-control-resolution.d.ts +1 -33
  56. package/dist/device/device-kind.d.ts +36 -0
  57. package/dist/device/device-management.d.ts +3 -0
  58. package/dist/device/device-type.d.ts +27 -10
  59. package/dist/device/hero/hero-fragment.d.ts +2 -0
  60. package/dist/device/hero/hero-layout.d.ts +1 -3
  61. package/dist/device/hero/hero-look.d.ts +18 -12
  62. package/dist/device/hero/hero-scene.d.ts +9 -3
  63. package/dist/device/index.d.ts +2 -1
  64. package/dist/device/power-switch.d.ts +82 -0
  65. package/dist/device/schema-fields.d.ts +10 -1
  66. package/dist/generated/addon-api.d.ts +27 -0
  67. package/dist/generated/cap-input-defaults.d.ts +1 -1
  68. package/dist/generated/collection-array-methods.d.ts +1 -1
  69. package/dist/generated/customize-catalog.d.ts +257 -8
  70. package/dist/generated/method-access-map.d.ts +1 -1
  71. package/dist/generated/method-device-selectors.d.ts +1 -1
  72. package/dist/{implemented-methods-M5aguGon.mjs → implemented-methods-5YMDeE3f.mjs} +1 -1
  73. package/dist/{implemented-methods-8AU92riC.js → implemented-methods-Cj65uy2F.js} +1 -1
  74. package/dist/index.d.ts +9 -6
  75. package/dist/index.js +1783 -451
  76. package/dist/index.mjs +1740 -445
  77. package/dist/node.js +2 -2
  78. package/dist/node.mjs +2 -2
  79. package/dist/{sleep-D_NpiLFP.mjs → sleep-Bn346wCJ.mjs} +46 -1
  80. package/dist/{sleep-vzHEmsrO.js → sleep-LFKpQ2_f.js} +46 -1
  81. package/dist/time/index.d.ts +1 -0
  82. package/dist/time/time-spec.d.ts +5 -0
  83. package/dist/time/time-window.d.ts +33 -0
  84. package/package.json +1 -1
package/dist/node.js CHANGED
@@ -21,8 +21,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_composed_stable_id = require("./composed-stable-id-DrGLxjVF.js");
25
- const require_implemented_methods = require("./implemented-methods-8AU92riC.js");
24
+ const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
25
+ const require_implemented_methods = require("./implemented-methods-Cj65uy2F.js");
26
26
  let node_crypto = require("node:crypto");
27
27
  let node_fs = require("node:fs");
28
28
  node_fs = __toESM(node_fs);
package/dist/node.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { s as errMsg } from "./composed-stable-id-DFNyOFzz.mjs";
2
- import { Fn as getFfmpegArtifact, In as getFfmpegDownloadUrl, Ln as canonicalHash, Mn as chooseFfmpegBinary, Nn as ffmpegBinaryName, Pn as FFMPEG_RELEASE, R as compositionSourceKey, Rn as Fmp4BoxSplitter, Un as buildFfmpegArgs, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, jn as FFMPEG_PATH_ENV, qn as isSoftwareDecode, t as implementedMethodsOf } from "./implemented-methods-M5aguGon.mjs";
1
+ import { s as errMsg } from "./composed-stable-id-CPp3votu.mjs";
2
+ import { Fn as getFfmpegArtifact, In as getFfmpegDownloadUrl, Ln as canonicalHash, Mn as chooseFfmpegBinary, Nn as ffmpegBinaryName, Pn as FFMPEG_RELEASE, R as compositionSourceKey, Rn as Fmp4BoxSplitter, Un as buildFfmpegArgs, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, jn as FFMPEG_PATH_ENV, qn as isSoftwareDecode, t as implementedMethodsOf } from "./implemented-methods-5YMDeE3f.mjs";
3
3
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
4
4
  import * as fs from "node:fs";
5
5
  import { chmodSync, copyFileSync, createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
@@ -1,5 +1,5 @@
1
1
  import { t as EventCategory } from "./event-category-78tcBemo.mjs";
2
- import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-DFNyOFzz.mjs";
2
+ import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-CPp3votu.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -9020,6 +9020,50 @@ var ACTUATOR_CAP_VOCABULARY = {
9020
9020
  value: false
9021
9021
  },
9022
9022
  args: { oscillating: false }
9023
+ },
9024
+ {
9025
+ id: "fan.horizontalOscillateOn",
9026
+ method: "setOscillationAxis",
9027
+ label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
9028
+ phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
9029
+ icon: "move-horizontal",
9030
+ args: {
9031
+ axis: "horizontal",
9032
+ oscillating: true
9033
+ }
9034
+ },
9035
+ {
9036
+ id: "fan.horizontalOscillateOff",
9037
+ method: "setOscillationAxis",
9038
+ label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
9039
+ phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
9040
+ icon: "move-horizontal",
9041
+ args: {
9042
+ axis: "horizontal",
9043
+ oscillating: false
9044
+ }
9045
+ },
9046
+ {
9047
+ id: "fan.verticalOscillateOn",
9048
+ method: "setOscillationAxis",
9049
+ label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
9050
+ phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
9051
+ icon: "move-vertical",
9052
+ args: {
9053
+ axis: "vertical",
9054
+ oscillating: true
9055
+ }
9056
+ },
9057
+ {
9058
+ id: "fan.verticalOscillateOff",
9059
+ method: "setOscillationAxis",
9060
+ label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
9061
+ phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
9062
+ icon: "move-vertical",
9063
+ args: {
9064
+ axis: "vertical",
9065
+ oscillating: false
9066
+ }
9023
9067
  }
9024
9068
  ],
9025
9069
  state: [{
@@ -15707,6 +15751,7 @@ function createDeviceProxy(api, binding, opts) {
15707
15751
  setPreset: (input) => dispatch("fan-control", "fanControl", "setPreset", "mutation", input),
15708
15752
  setDirection: (input) => dispatch("fan-control", "fanControl", "setDirection", "mutation", input),
15709
15753
  setOscillating: (input) => dispatch("fan-control", "fanControl", "setOscillating", "mutation", input),
15754
+ setOscillationAxis: (input) => dispatch("fan-control", "fanControl", "setOscillationAxis", "mutation", input),
15710
15755
  getStatus: (input) => dispatch("fan-control", "fanControl", "getStatus", "query", input)
15711
15756
  };
15712
15757
  const featureProbeInterface = { getStatus: (input) => dispatch("feature-probe", "featureProbe", "getStatus", "query", input) };
@@ -1,5 +1,5 @@
1
1
  const require_event_category = require("./event-category-BC4RRerT.js");
2
- const require_composed_stable_id = require("./composed-stable-id-DrGLxjVF.js");
2
+ const require_composed_stable_id = require("./composed-stable-id-CDNLq7Y8.js");
3
3
  let zod = require("zod");
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -9020,6 +9020,50 @@ var ACTUATOR_CAP_VOCABULARY = {
9020
9020
  value: false
9021
9021
  },
9022
9022
  args: { oscillating: false }
9023
+ },
9024
+ {
9025
+ id: "fan.horizontalOscillateOn",
9026
+ method: "setOscillationAxis",
9027
+ label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
9028
+ phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
9029
+ icon: "move-horizontal",
9030
+ args: {
9031
+ axis: "horizontal",
9032
+ oscillating: true
9033
+ }
9034
+ },
9035
+ {
9036
+ id: "fan.horizontalOscillateOff",
9037
+ method: "setOscillationAxis",
9038
+ label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
9039
+ phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
9040
+ icon: "move-horizontal",
9041
+ args: {
9042
+ axis: "horizontal",
9043
+ oscillating: false
9044
+ }
9045
+ },
9046
+ {
9047
+ id: "fan.verticalOscillateOn",
9048
+ method: "setOscillationAxis",
9049
+ label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
9050
+ phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
9051
+ icon: "move-vertical",
9052
+ args: {
9053
+ axis: "vertical",
9054
+ oscillating: true
9055
+ }
9056
+ },
9057
+ {
9058
+ id: "fan.verticalOscillateOff",
9059
+ method: "setOscillationAxis",
9060
+ label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
9061
+ phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
9062
+ icon: "move-vertical",
9063
+ args: {
9064
+ axis: "vertical",
9065
+ oscillating: false
9066
+ }
9023
9067
  }
9024
9068
  ],
9025
9069
  state: [{
@@ -15707,6 +15751,7 @@ function createDeviceProxy(api, binding, opts) {
15707
15751
  setPreset: (input) => dispatch("fan-control", "fanControl", "setPreset", "mutation", input),
15708
15752
  setDirection: (input) => dispatch("fan-control", "fanControl", "setDirection", "mutation", input),
15709
15753
  setOscillating: (input) => dispatch("fan-control", "fanControl", "setOscillating", "mutation", input),
15754
+ setOscillationAxis: (input) => dispatch("fan-control", "fanControl", "setOscillationAxis", "mutation", input),
15710
15755
  getStatus: (input) => dispatch("fan-control", "fanControl", "getStatus", "query", input)
15711
15756
  };
15712
15757
  const featureProbeInterface = { getStatus: (input) => dispatch("feature-probe", "featureProbe", "getStatus", "query", input) };
@@ -1,2 +1,3 @@
1
1
  export * from './solar.js';
2
2
  export * from './time-spec.js';
3
+ export * from './time-window.js';
@@ -57,6 +57,11 @@ export interface TimeSite {
57
57
  readonly lat: number;
58
58
  readonly lon: number;
59
59
  readonly timeZone: string;
60
+ /**
61
+ * Set by {@link zoneOnlySite}: the coordinates are placeholders, so a sun
62
+ * event cannot be placed on this site and a caller must not read one.
63
+ */
64
+ readonly zoneOnly?: true;
60
65
  }
61
66
  /**
62
67
  * A moment as epoch ms, or `null` — "nothing happens". `null` means one of two
@@ -0,0 +1,33 @@
1
+ /**
2
+ * A daily window as a STATE: is this instant inside it, and when does that
3
+ * next change? Pure — the answer is built per local date from
4
+ * {@link occurrenceOn}, so a DST change needs no special case.
5
+ *
6
+ * Rules:
7
+ * - A window whose `to` is not after its `from` on the same local date WRAPS:
8
+ * it runs from `from` on day D to `to` on D+1.
9
+ * - `days` names the local day a window STARTS on. 22:00-06:00 on weekdays is
10
+ * inside at 01:00 Saturday (it started Friday). With `days` and no
11
+ * `between` the window is the whole local day.
12
+ * - A sun event that does not happen on a day (polar day or night) gives that
13
+ * day no window. A sun event on a site WITHOUT a location (or an unknown
14
+ * zone) cannot be judged at all: the result is `unknown`, never a guess.
15
+ */
16
+ import { type TimeSite, type TimeSpec, type WeekdayKey } from './time-spec.js';
17
+ export interface TimeWindow {
18
+ readonly between?: {
19
+ readonly from: TimeSpec;
20
+ readonly to: TimeSpec;
21
+ };
22
+ readonly days?: readonly WeekdayKey[];
23
+ }
24
+ export interface TimeWindowJudgement {
25
+ /** Is `nowMs` inside the window. Always false when `unknown`. */
26
+ readonly inside: boolean;
27
+ /** The window cannot be placed on this site; `inside` is false and means nothing. */
28
+ readonly unknown: boolean;
29
+ /** The soonest boundary strictly after `nowMs`, or null when none is within reach (or unknown). */
30
+ readonly nextChangeAtMs: number | null;
31
+ readonly why: string;
32
+ }
33
+ export declare function judgeTimeWindow(window: TimeWindow, nowMs: number, site: TimeSite): TimeWindowJudgement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.547",
3
+ "version": "1.2.549",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",