@camstack/types 1.2.561 → 1.2.563

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 (60) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/addon/instances-of-cap.d.ts +7 -2
  3. package/dist/addon.js +4 -3
  4. package/dist/addon.mjs +4 -3
  5. package/dist/automation/codegen.d.ts +6 -0
  6. package/dist/automation/recipe-literal.d.ts +35 -0
  7. package/dist/automation/recipe.d.ts +46 -0
  8. package/dist/automation/template-link.d.ts +206 -0
  9. package/dist/capabilities/cluster-update.cap.d.ts +16 -0
  10. package/dist/capabilities/device-manager.cap.d.ts +2 -1
  11. package/dist/capabilities/device-search.d.ts +4 -2
  12. package/dist/capabilities/energy-system.cap.d.ts +281 -0
  13. package/dist/capabilities/index.d.ts +4 -2
  14. package/dist/capabilities/integration-instances.cap.d.ts +9 -0
  15. package/dist/capabilities/notification-rules.cap.d.ts +4 -0
  16. package/dist/capabilities/smtp-provider.cap.d.ts +2 -0
  17. package/dist/capabilities/switch.cap.d.ts +5 -0
  18. package/dist/capabilities/template.cap.d.ts +39 -2
  19. package/dist/client.js +54 -1
  20. package/dist/client.mjs +54 -1
  21. package/dist/{composed-stable-id-iddnCQ51.mjs → composed-stable-id-B3wcvtvW.mjs} +4 -0
  22. package/dist/{composed-stable-id-BmJ_5GiE.js → composed-stable-id-Bp33yrYi.js} +4 -0
  23. package/dist/device/cap-vocabulary/index.d.ts +1 -1
  24. package/dist/device/cap-vocabulary/resolve.d.ts +6 -0
  25. package/dist/device/device-control-resolution.d.ts +1 -1
  26. package/dist/device/device-icon.d.ts +1 -0
  27. package/dist/device/device-type.d.ts +5 -1
  28. package/dist/device/hero/hero-layout.d.ts +1 -0
  29. package/dist/device/hero/hero-look.d.ts +6 -0
  30. package/dist/device/hero/hero-scene.d.ts +1 -0
  31. package/dist/generated/addon-api.d.ts +21 -0
  32. package/dist/generated/addon-cap-facts.d.ts +1 -1
  33. package/dist/generated/cap-status-types.d.ts +3 -1
  34. package/dist/generated/cap-vocabulary.d.ts +1 -1
  35. package/dist/generated/capability-router-map.d.ts +5 -2
  36. package/dist/generated/collection-array-methods.d.ts +1 -1
  37. package/dist/generated/customize-catalog.d.ts +1 -1
  38. package/dist/generated/device-local-state.d.ts +3 -0
  39. package/dist/generated/device-proxy.d.ts +3 -0
  40. package/dist/generated/device-scoped-caps.d.ts +1 -1
  41. package/dist/generated/history-catalog.d.ts +1 -1
  42. package/dist/generated/method-access-map.d.ts +1 -1
  43. package/dist/generated/method-device-selectors.d.ts +2 -2
  44. package/dist/generated/runtime-state-durability.d.ts +1 -1
  45. package/dist/{implemented-methods-CfaRR_ki.js → implemented-methods-CDYOCn9a.js} +1 -1
  46. package/dist/{implemented-methods-CSTk6zYK.mjs → implemented-methods-CgUBu6uM.mjs} +1 -1
  47. package/dist/index.d.ts +7 -1
  48. package/dist/index.js +1889 -209
  49. package/dist/index.mjs +1834 -210
  50. package/dist/node.js +2 -2
  51. package/dist/node.mjs +2 -2
  52. package/dist/notification/degrade-engine.d.ts +5 -0
  53. package/dist/notification/email-image-bytes.d.ts +26 -0
  54. package/dist/notification/email-mime.d.ts +52 -0
  55. package/dist/{sleep-C9PbO6Nb.mjs → sleep-BCWQQG52.mjs} +154 -35
  56. package/dist/{sleep-CcUFeK6k.js → sleep-RUgd-FgK.js} +154 -35
  57. package/dist/template/automation-template.d.ts +782 -0
  58. package/dist/template/builtin-automation-templates.d.ts +17 -0
  59. package/dist/template/template-kinds.d.ts +4 -3
  60. 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-BmJ_5GiE.js");
25
- const require_implemented_methods = require("./implemented-methods-CfaRR_ki.js");
24
+ const require_composed_stable_id = require("./composed-stable-id-Bp33yrYi.js");
25
+ const require_implemented_methods = require("./implemented-methods-CDYOCn9a.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-iddnCQ51.mjs";
2
- import { Gn as FFMPEG_RELEASE, Hn as FFMPEG_PATH_ENV, Jn as canonicalHash, Kn as getFfmpegArtifact, Un as chooseFfmpegBinary, Wn as ffmpegBinaryName, Yn as Fmp4BoxSplitter, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, er as buildFfmpegArgs, ir as isSoftwareDecode, qn as getFfmpegDownloadUrl, t as implementedMethodsOf, z as compositionSourceKey } from "./implemented-methods-CSTk6zYK.mjs";
1
+ import { s as errMsg } from "./composed-stable-id-B3wcvtvW.mjs";
2
+ import { Gn as FFMPEG_RELEASE, Hn as FFMPEG_PATH_ENV, Jn as canonicalHash, Kn as getFfmpegArtifact, Un as chooseFfmpegBinary, Wn as ffmpegBinaryName, Yn as Fmp4BoxSplitter, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, er as buildFfmpegArgs, ir as isSoftwareDecode, qn as getFfmpegDownloadUrl, t as implementedMethodsOf, z as compositionSourceKey } from "./implemented-methods-CgUBu6uM.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";
@@ -48,6 +48,11 @@ export interface PreparedNotification {
48
48
  readonly sound: string | null;
49
49
  readonly ttl: number | null;
50
50
  readonly tag: string | null;
51
+ /**
52
+ * The camera this notification is about, when it names one. Copied through so
53
+ * a sender that drops an image can tag the log with it.
54
+ */
55
+ readonly deviceId?: number;
51
56
  /**
52
57
  * The notifier-declared delivery parameters the rule set for this target
53
58
  * (D938), already validated by the dispatcher. An adapter reads the keys it
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Read email images off `peerBytes` tickets and hand the bytes to {@link buildRawMime}.
3
+ *
4
+ * One body, one take (D613). A ticket that cannot be read is reported and left
5
+ * out — the mail still goes, without that image.
6
+ */
7
+ import type { PeerBytesOpenResult, PeerBytesTicket } from '../interfaces/addon-peer-bytes.js';
8
+ import { type EmailImagePart, type EmailMimeImage } from './email-mime.js';
9
+ export type OpenEmailImage = (ticket: PeerBytesTicket) => Promise<PeerBytesOpenResult>;
10
+ export type EmailImageDropped = (reason: string, deviceId: number | undefined) => void;
11
+ /** What a sender knows before the tickets are opened. */
12
+ export interface OutboundEmail {
13
+ readonly from: string;
14
+ readonly to: string | readonly string[];
15
+ readonly cc?: readonly string[];
16
+ readonly bcc?: readonly string[];
17
+ readonly replyTo?: string;
18
+ readonly subject: string;
19
+ readonly text: string;
20
+ readonly html?: string;
21
+ readonly images?: readonly EmailImagePart[];
22
+ }
23
+ /** The images that fit. Each failure is handed to `onDropped` and skipped. */
24
+ export declare function materializeEmailImages(images: readonly EmailImagePart[] | undefined, open: OpenEmailImage, onDropped: EmailImageDropped): Promise<readonly EmailMimeImage[]>;
25
+ /** Tickets in, one MIME body out. The same call for Gmail and SMTP. */
26
+ export declare function assembleEmailMime(input: OutboundEmail, open: OpenEmailImage, onDropped: EmailImageDropped): Promise<string>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * One RFC 5322 body for every mail sender.
3
+ *
4
+ * Gmail and the SMTP relay both call this. An HTML message with an inline image is
5
+ * `multipart/related` (the HTML sits in `multipart/alternative` and references
6
+ * `cid:`). A text message carries the same bytes as a normal attachment
7
+ * (`multipart/mixed`). The image bytes are already in hand — a sender reads them
8
+ * off a `peerBytes` ticket before calling in ({@link assembleEmailMime}).
9
+ */
10
+ import { z } from 'zod';
11
+ import { type PeerBytesTicket } from '../interfaces/addon-peer-bytes.js';
12
+ /** How many images one email will carry. */
13
+ export declare const EMAIL_IMAGE_MAX_COUNT: number;
14
+ /** Total image bytes one email will carry. */
15
+ export declare const EMAIL_IMAGE_MAX_TOTAL_BYTES: number;
16
+ /**
17
+ * Where an HTML body leaves room for the inline images: under the text, above
18
+ * the click link. The builder replaces it; a message with no image loses it.
19
+ */
20
+ export declare const EMAIL_IMAGE_SLOT: string;
21
+ /** An image a sender still has to read (`peerBytes` ticket, not the bytes). */
22
+ export interface EmailImagePart {
23
+ readonly ticket: PeerBytesTicket;
24
+ readonly mime: string;
25
+ readonly name: string;
26
+ readonly contentId: string;
27
+ readonly placement: 'inline' | 'attachment';
28
+ readonly deviceId?: number;
29
+ }
30
+ export declare const EmailImagePartSchema: z.ZodType<EmailImagePart>;
31
+ /** An image whose bytes are already in hand, ready for the MIME body. */
32
+ export interface EmailMimeImage {
33
+ readonly bytes: Uint8Array;
34
+ readonly mime: string;
35
+ readonly name: string;
36
+ readonly contentId: string;
37
+ readonly placement: 'inline' | 'attachment';
38
+ }
39
+ /** The headers and bodies `buildRawMime` renders. `images` are bytes, not tickets. */
40
+ export interface RawMimeInput {
41
+ readonly from: string;
42
+ readonly to: string | readonly string[];
43
+ readonly cc?: readonly string[];
44
+ readonly bcc?: readonly string[];
45
+ readonly replyTo?: string;
46
+ readonly subject: string;
47
+ readonly text: string;
48
+ readonly html?: string;
49
+ readonly images?: readonly EmailMimeImage[];
50
+ }
51
+ /** Render one mail. No I/O: the caller has already decided which images survived. */
52
+ export declare function buildRawMime(input: RawMimeInput): string;
@@ -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-iddnCQ51.mjs";
2
+ import { a as DeviceType, i as DeviceRole, s as errMsg } from "./composed-stable-id-B3wcvtvW.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -7938,7 +7938,7 @@ var MODEL_FORMATS = [
7938
7938
  //#region src/generated/cap-vocabulary.ts
7939
7939
  /**
7940
7940
  * THE cap vocabulary (D920), projected from the declarations of every
7941
- * `*.cap.ts` (D1050): 205 caps (104 device, 101 system).
7941
+ * `*.cap.ts` (D1050): 206 caps (105 device, 101 system).
7942
7942
  * Device caps in their declared picker order, then system caps by name.
7943
7943
  */
7944
7944
  var CAP_VOCABULARY = {
@@ -7948,41 +7948,57 @@ var CAP_VOCABULARY = {
7948
7948
  en: "Switch",
7949
7949
  it: "Interruttore"
7950
7950
  },
7951
- actions: [{
7952
- id: "switch.on",
7953
- method: "setState",
7954
- label: {
7955
- en: "Turn on",
7956
- it: "Accendi"
7957
- },
7958
- phrase: {
7959
- en: "Turn on {device}",
7960
- it: "Accendi {device}"
7961
- },
7962
- icon: "power",
7963
- args: { on: true },
7964
- effect: {
7965
- field: "on",
7966
- value: true
7967
- }
7968
- }, {
7969
- id: "switch.off",
7970
- method: "setState",
7971
- label: {
7972
- en: "Turn off",
7973
- it: "Spegni"
7951
+ actions: [
7952
+ {
7953
+ id: "switch.on",
7954
+ method: "setState",
7955
+ label: {
7956
+ en: "Turn on",
7957
+ it: "Accendi"
7958
+ },
7959
+ phrase: {
7960
+ en: "Turn on {device}",
7961
+ it: "Accendi {device}"
7962
+ },
7963
+ icon: "power",
7964
+ args: { on: true },
7965
+ effect: {
7966
+ field: "on",
7967
+ value: true
7968
+ }
7974
7969
  },
7975
- phrase: {
7976
- en: "Turn off {device}",
7977
- it: "Spegni {device}"
7970
+ {
7971
+ id: "switch.off",
7972
+ method: "setState",
7973
+ label: {
7974
+ en: "Turn off",
7975
+ it: "Spegni"
7976
+ },
7977
+ phrase: {
7978
+ en: "Turn off {device}",
7979
+ it: "Spegni {device}"
7980
+ },
7981
+ icon: "power-off",
7982
+ args: { on: false },
7983
+ effect: {
7984
+ field: "on",
7985
+ value: false
7986
+ }
7978
7987
  },
7979
- icon: "power-off",
7980
- args: { on: false },
7981
- effect: {
7982
- field: "on",
7983
- value: false
7988
+ {
7989
+ id: "switch.toggle",
7990
+ method: "toggle",
7991
+ label: {
7992
+ en: "Toggle",
7993
+ it: "Commuta"
7994
+ },
7995
+ phrase: {
7996
+ en: "Toggle {device}",
7997
+ it: "Commuta {device}"
7998
+ },
7999
+ icon: "toggle-right"
7984
8000
  }
7985
- }],
8001
+ ],
7986
8002
  state: [{
7987
8003
  kind: "boolean",
7988
8004
  field: "on",
@@ -14864,6 +14880,13 @@ var CAP_VOCABULARY = {
14864
14880
  }
14865
14881
  ]
14866
14882
  },
14883
+ "energy-system": {
14884
+ scope: "device",
14885
+ noun: {
14886
+ en: "Energy system",
14887
+ it: "Sistema energetico"
14888
+ }
14889
+ },
14867
14890
  "air-quality-sensor": {
14868
14891
  scope: "device",
14869
14892
  noun: {
@@ -17112,6 +17135,7 @@ var CAP_NAMES = Object.freeze([
17112
17135
  "do-not-disturb",
17113
17136
  "doorbell",
17114
17137
  "embedding-encoder",
17138
+ "energy-system",
17115
17139
  "enum-sensor",
17116
17140
  "event-emitter",
17117
17141
  "face-gallery",
@@ -17890,6 +17914,96 @@ var CAP_STATE_LEAVES = Object.freeze({
17890
17914
  "path": "pressCountSinceStart",
17891
17915
  "valueType": "number"
17892
17916
  }],
17917
+ "energy-system": [
17918
+ {
17919
+ "path": "solar.powerW",
17920
+ "valueType": "number"
17921
+ },
17922
+ {
17923
+ "path": "solar.energyKwh",
17924
+ "valueType": "number"
17925
+ },
17926
+ {
17927
+ "path": "solar.todayKwh",
17928
+ "valueType": "number"
17929
+ },
17930
+ {
17931
+ "path": "grid.powerW",
17932
+ "valueType": "number"
17933
+ },
17934
+ {
17935
+ "path": "grid.importKwh",
17936
+ "valueType": "number"
17937
+ },
17938
+ {
17939
+ "path": "grid.exportKwh",
17940
+ "valueType": "number"
17941
+ },
17942
+ {
17943
+ "path": "grid.importTodayKwh",
17944
+ "valueType": "number"
17945
+ },
17946
+ {
17947
+ "path": "grid.exportTodayKwh",
17948
+ "valueType": "number"
17949
+ },
17950
+ {
17951
+ "path": "house.powerW",
17952
+ "valueType": "number"
17953
+ },
17954
+ {
17955
+ "path": "house.energyKwh",
17956
+ "valueType": "number"
17957
+ },
17958
+ {
17959
+ "path": "house.todayKwh",
17960
+ "valueType": "number"
17961
+ },
17962
+ {
17963
+ "path": "heatPump.powerW",
17964
+ "valueType": "number"
17965
+ },
17966
+ {
17967
+ "path": "heatPump.energyKwh",
17968
+ "valueType": "number"
17969
+ },
17970
+ {
17971
+ "path": "heatPump.todayKwh",
17972
+ "valueType": "number"
17973
+ },
17974
+ {
17975
+ "path": "storage.stateOfChargePct",
17976
+ "valueType": "number"
17977
+ },
17978
+ {
17979
+ "path": "storage.storedKwh",
17980
+ "valueType": "number"
17981
+ },
17982
+ {
17983
+ "path": "storage.capacityKwh",
17984
+ "valueType": "number"
17985
+ },
17986
+ {
17987
+ "path": "storage.powerW",
17988
+ "valueType": "number"
17989
+ },
17990
+ {
17991
+ "path": "storage.chargedKwh",
17992
+ "valueType": "number"
17993
+ },
17994
+ {
17995
+ "path": "storage.dischargedKwh",
17996
+ "valueType": "number"
17997
+ },
17998
+ {
17999
+ "path": "storage.chargedTodayKwh",
18000
+ "valueType": "number"
18001
+ },
18002
+ {
18003
+ "path": "storage.dischargedTodayKwh",
18004
+ "valueType": "number"
18005
+ }
18006
+ ],
17893
18007
  "enum-sensor": [{
17894
18008
  "path": "value",
17895
18009
  "valueType": "string"
@@ -19812,6 +19926,7 @@ function createDeviceProxy(api, binding, opts) {
19812
19926
  getStatus: (input) => dispatch("do-not-disturb", "doNotDisturb", "getStatus", "query", input)
19813
19927
  };
19814
19928
  const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
19929
+ const energySystemInterface = { getStatus: (input) => dispatch("energy-system", "energySystem", "getStatus", "query", input) };
19815
19930
  const enumSensorInterface = { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) };
19816
19931
  const eventEmitterInterface = { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) };
19817
19932
  const fanControlInterface = {
@@ -20166,6 +20281,7 @@ function createDeviceProxy(api, binding, opts) {
20166
20281
  const streamSignalsInterface = { listSignals: (input) => dispatch("stream-signals", "streamSignals", "listSignals", "query", input) };
20167
20282
  const switchInterface = {
20168
20283
  setState: (input) => dispatch("switch", "switch", "setState", "mutation", input),
20284
+ toggle: (input) => dispatch("switch", "switch", "toggle", "mutation", input),
20169
20285
  getStatus: (input) => dispatch("switch", "switch", "getStatus", "query", input)
20170
20286
  };
20171
20287
  const tamperInterface = { getStatus: (input) => dispatch("tamper", "tamper", "getStatus", "query", input) };
@@ -20438,6 +20554,7 @@ function createDeviceProxy(api, binding, opts) {
20438
20554
  dishwasher: createSliceHandle(stateSource, binding.deviceId, "dishwasher"),
20439
20555
  doNotDisturb: createSliceHandle(stateSource, binding.deviceId, "do-not-disturb"),
20440
20556
  doorbell: createSliceHandle(stateSource, binding.deviceId, "doorbell"),
20557
+ energySystem: createSliceHandle(stateSource, binding.deviceId, "energy-system"),
20441
20558
  enumSensor: createSliceHandle(stateSource, binding.deviceId, "enum-sensor"),
20442
20559
  eventEmitter: createSliceHandle(stateSource, binding.deviceId, "event-emitter"),
20443
20560
  fanControl: createSliceHandle(stateSource, binding.deviceId, "fan-control"),
@@ -20533,6 +20650,7 @@ function createDeviceProxy(api, binding, opts) {
20533
20650
  ...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
20534
20651
  ...bound("do-not-disturb") ? { doNotDisturb: doNotDisturbInterface } : {},
20535
20652
  ...bound("doorbell") ? { doorbell: doorbellInterface } : {},
20653
+ ...bound("energy-system") ? { energySystem: energySystemInterface } : {},
20536
20654
  ...bound("enum-sensor") ? { enumSensor: enumSensorInterface } : {},
20537
20655
  ...bound("event-emitter") ? { eventEmitter: eventEmitterInterface } : {},
20538
20656
  ...bound("fan-control") ? { fanControl: fanControlInterface } : {},
@@ -20634,7 +20752,7 @@ function createDeviceProxy(api, binding, opts) {
20634
20752
  * can answer "may a rule actuate this?" without importing the schema barrel
20635
20753
  * (~144MB RSS per runner, D28).
20636
20754
  *
20637
- * Coverage: 104 device-scoped capabilities.
20755
+ * Coverage: 105 device-scoped capabilities.
20638
20756
  */
20639
20757
  var DEVICE_SCOPED_CAPS = new Set([
20640
20758
  "accessories",
@@ -20671,6 +20789,7 @@ var DEVICE_SCOPED_CAPS = new Set([
20671
20789
  "dishwasher",
20672
20790
  "do-not-disturb",
20673
20791
  "doorbell",
20792
+ "energy-system",
20674
20793
  "enum-sensor",
20675
20794
  "event-emitter",
20676
20795
  "fan-control",
@@ -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-BmJ_5GiE.js");
2
+ const require_composed_stable_id = require("./composed-stable-id-Bp33yrYi.js");
3
3
  let zod = require("zod");
4
4
  //#region src/audio/audio-chunk-format.ts
5
5
  /**
@@ -7938,7 +7938,7 @@ var MODEL_FORMATS = [
7938
7938
  //#region src/generated/cap-vocabulary.ts
7939
7939
  /**
7940
7940
  * THE cap vocabulary (D920), projected from the declarations of every
7941
- * `*.cap.ts` (D1050): 205 caps (104 device, 101 system).
7941
+ * `*.cap.ts` (D1050): 206 caps (105 device, 101 system).
7942
7942
  * Device caps in their declared picker order, then system caps by name.
7943
7943
  */
7944
7944
  var CAP_VOCABULARY = {
@@ -7948,41 +7948,57 @@ var CAP_VOCABULARY = {
7948
7948
  en: "Switch",
7949
7949
  it: "Interruttore"
7950
7950
  },
7951
- actions: [{
7952
- id: "switch.on",
7953
- method: "setState",
7954
- label: {
7955
- en: "Turn on",
7956
- it: "Accendi"
7957
- },
7958
- phrase: {
7959
- en: "Turn on {device}",
7960
- it: "Accendi {device}"
7961
- },
7962
- icon: "power",
7963
- args: { on: true },
7964
- effect: {
7965
- field: "on",
7966
- value: true
7967
- }
7968
- }, {
7969
- id: "switch.off",
7970
- method: "setState",
7971
- label: {
7972
- en: "Turn off",
7973
- it: "Spegni"
7951
+ actions: [
7952
+ {
7953
+ id: "switch.on",
7954
+ method: "setState",
7955
+ label: {
7956
+ en: "Turn on",
7957
+ it: "Accendi"
7958
+ },
7959
+ phrase: {
7960
+ en: "Turn on {device}",
7961
+ it: "Accendi {device}"
7962
+ },
7963
+ icon: "power",
7964
+ args: { on: true },
7965
+ effect: {
7966
+ field: "on",
7967
+ value: true
7968
+ }
7974
7969
  },
7975
- phrase: {
7976
- en: "Turn off {device}",
7977
- it: "Spegni {device}"
7970
+ {
7971
+ id: "switch.off",
7972
+ method: "setState",
7973
+ label: {
7974
+ en: "Turn off",
7975
+ it: "Spegni"
7976
+ },
7977
+ phrase: {
7978
+ en: "Turn off {device}",
7979
+ it: "Spegni {device}"
7980
+ },
7981
+ icon: "power-off",
7982
+ args: { on: false },
7983
+ effect: {
7984
+ field: "on",
7985
+ value: false
7986
+ }
7978
7987
  },
7979
- icon: "power-off",
7980
- args: { on: false },
7981
- effect: {
7982
- field: "on",
7983
- value: false
7988
+ {
7989
+ id: "switch.toggle",
7990
+ method: "toggle",
7991
+ label: {
7992
+ en: "Toggle",
7993
+ it: "Commuta"
7994
+ },
7995
+ phrase: {
7996
+ en: "Toggle {device}",
7997
+ it: "Commuta {device}"
7998
+ },
7999
+ icon: "toggle-right"
7984
8000
  }
7985
- }],
8001
+ ],
7986
8002
  state: [{
7987
8003
  kind: "boolean",
7988
8004
  field: "on",
@@ -14864,6 +14880,13 @@ var CAP_VOCABULARY = {
14864
14880
  }
14865
14881
  ]
14866
14882
  },
14883
+ "energy-system": {
14884
+ scope: "device",
14885
+ noun: {
14886
+ en: "Energy system",
14887
+ it: "Sistema energetico"
14888
+ }
14889
+ },
14867
14890
  "air-quality-sensor": {
14868
14891
  scope: "device",
14869
14892
  noun: {
@@ -17112,6 +17135,7 @@ var CAP_NAMES = Object.freeze([
17112
17135
  "do-not-disturb",
17113
17136
  "doorbell",
17114
17137
  "embedding-encoder",
17138
+ "energy-system",
17115
17139
  "enum-sensor",
17116
17140
  "event-emitter",
17117
17141
  "face-gallery",
@@ -17890,6 +17914,96 @@ var CAP_STATE_LEAVES = Object.freeze({
17890
17914
  "path": "pressCountSinceStart",
17891
17915
  "valueType": "number"
17892
17916
  }],
17917
+ "energy-system": [
17918
+ {
17919
+ "path": "solar.powerW",
17920
+ "valueType": "number"
17921
+ },
17922
+ {
17923
+ "path": "solar.energyKwh",
17924
+ "valueType": "number"
17925
+ },
17926
+ {
17927
+ "path": "solar.todayKwh",
17928
+ "valueType": "number"
17929
+ },
17930
+ {
17931
+ "path": "grid.powerW",
17932
+ "valueType": "number"
17933
+ },
17934
+ {
17935
+ "path": "grid.importKwh",
17936
+ "valueType": "number"
17937
+ },
17938
+ {
17939
+ "path": "grid.exportKwh",
17940
+ "valueType": "number"
17941
+ },
17942
+ {
17943
+ "path": "grid.importTodayKwh",
17944
+ "valueType": "number"
17945
+ },
17946
+ {
17947
+ "path": "grid.exportTodayKwh",
17948
+ "valueType": "number"
17949
+ },
17950
+ {
17951
+ "path": "house.powerW",
17952
+ "valueType": "number"
17953
+ },
17954
+ {
17955
+ "path": "house.energyKwh",
17956
+ "valueType": "number"
17957
+ },
17958
+ {
17959
+ "path": "house.todayKwh",
17960
+ "valueType": "number"
17961
+ },
17962
+ {
17963
+ "path": "heatPump.powerW",
17964
+ "valueType": "number"
17965
+ },
17966
+ {
17967
+ "path": "heatPump.energyKwh",
17968
+ "valueType": "number"
17969
+ },
17970
+ {
17971
+ "path": "heatPump.todayKwh",
17972
+ "valueType": "number"
17973
+ },
17974
+ {
17975
+ "path": "storage.stateOfChargePct",
17976
+ "valueType": "number"
17977
+ },
17978
+ {
17979
+ "path": "storage.storedKwh",
17980
+ "valueType": "number"
17981
+ },
17982
+ {
17983
+ "path": "storage.capacityKwh",
17984
+ "valueType": "number"
17985
+ },
17986
+ {
17987
+ "path": "storage.powerW",
17988
+ "valueType": "number"
17989
+ },
17990
+ {
17991
+ "path": "storage.chargedKwh",
17992
+ "valueType": "number"
17993
+ },
17994
+ {
17995
+ "path": "storage.dischargedKwh",
17996
+ "valueType": "number"
17997
+ },
17998
+ {
17999
+ "path": "storage.chargedTodayKwh",
18000
+ "valueType": "number"
18001
+ },
18002
+ {
18003
+ "path": "storage.dischargedTodayKwh",
18004
+ "valueType": "number"
18005
+ }
18006
+ ],
17893
18007
  "enum-sensor": [{
17894
18008
  "path": "value",
17895
18009
  "valueType": "string"
@@ -19812,6 +19926,7 @@ function createDeviceProxy(api, binding, opts) {
19812
19926
  getStatus: (input) => dispatch("do-not-disturb", "doNotDisturb", "getStatus", "query", input)
19813
19927
  };
19814
19928
  const doorbellInterface = { getStatus: (input) => dispatch("doorbell", "doorbell", "getStatus", "query", input) };
19929
+ const energySystemInterface = { getStatus: (input) => dispatch("energy-system", "energySystem", "getStatus", "query", input) };
19815
19930
  const enumSensorInterface = { getStatus: (input) => dispatch("enum-sensor", "enumSensor", "getStatus", "query", input) };
19816
19931
  const eventEmitterInterface = { getStatus: (input) => dispatch("event-emitter", "eventEmitter", "getStatus", "query", input) };
19817
19932
  const fanControlInterface = {
@@ -20166,6 +20281,7 @@ function createDeviceProxy(api, binding, opts) {
20166
20281
  const streamSignalsInterface = { listSignals: (input) => dispatch("stream-signals", "streamSignals", "listSignals", "query", input) };
20167
20282
  const switchInterface = {
20168
20283
  setState: (input) => dispatch("switch", "switch", "setState", "mutation", input),
20284
+ toggle: (input) => dispatch("switch", "switch", "toggle", "mutation", input),
20169
20285
  getStatus: (input) => dispatch("switch", "switch", "getStatus", "query", input)
20170
20286
  };
20171
20287
  const tamperInterface = { getStatus: (input) => dispatch("tamper", "tamper", "getStatus", "query", input) };
@@ -20438,6 +20554,7 @@ function createDeviceProxy(api, binding, opts) {
20438
20554
  dishwasher: createSliceHandle(stateSource, binding.deviceId, "dishwasher"),
20439
20555
  doNotDisturb: createSliceHandle(stateSource, binding.deviceId, "do-not-disturb"),
20440
20556
  doorbell: createSliceHandle(stateSource, binding.deviceId, "doorbell"),
20557
+ energySystem: createSliceHandle(stateSource, binding.deviceId, "energy-system"),
20441
20558
  enumSensor: createSliceHandle(stateSource, binding.deviceId, "enum-sensor"),
20442
20559
  eventEmitter: createSliceHandle(stateSource, binding.deviceId, "event-emitter"),
20443
20560
  fanControl: createSliceHandle(stateSource, binding.deviceId, "fan-control"),
@@ -20533,6 +20650,7 @@ function createDeviceProxy(api, binding, opts) {
20533
20650
  ...bound("dishwasher") ? { dishwasher: dishwasherInterface } : {},
20534
20651
  ...bound("do-not-disturb") ? { doNotDisturb: doNotDisturbInterface } : {},
20535
20652
  ...bound("doorbell") ? { doorbell: doorbellInterface } : {},
20653
+ ...bound("energy-system") ? { energySystem: energySystemInterface } : {},
20536
20654
  ...bound("enum-sensor") ? { enumSensor: enumSensorInterface } : {},
20537
20655
  ...bound("event-emitter") ? { eventEmitter: eventEmitterInterface } : {},
20538
20656
  ...bound("fan-control") ? { fanControl: fanControlInterface } : {},
@@ -20634,7 +20752,7 @@ function createDeviceProxy(api, binding, opts) {
20634
20752
  * can answer "may a rule actuate this?" without importing the schema barrel
20635
20753
  * (~144MB RSS per runner, D28).
20636
20754
  *
20637
- * Coverage: 104 device-scoped capabilities.
20755
+ * Coverage: 105 device-scoped capabilities.
20638
20756
  */
20639
20757
  var DEVICE_SCOPED_CAPS = new Set([
20640
20758
  "accessories",
@@ -20671,6 +20789,7 @@ var DEVICE_SCOPED_CAPS = new Set([
20671
20789
  "dishwasher",
20672
20790
  "do-not-disturb",
20673
20791
  "doorbell",
20792
+ "energy-system",
20674
20793
  "enum-sensor",
20675
20794
  "event-emitter",
20676
20795
  "fan-control",