@camstack/addon-export-google 0.1.122 → 0.1.124
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 +12 -0
- package/dist/export-google.addon.js +1366 -553
- package/dist/export-google.addon.mjs +1366 -553
- package/package.json +2 -2
|
@@ -859,7 +859,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
859
859
|
return EventCategory;
|
|
860
860
|
}({});
|
|
861
861
|
//#endregion
|
|
862
|
-
//#region ../types/dist/device-type-
|
|
862
|
+
//#region ../types/dist/device-type-D1fH5kaC.mjs
|
|
863
863
|
/**
|
|
864
864
|
import { errMsg } from '@camstack/types'
|
|
865
865
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -1048,6 +1048,9 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
|
1048
1048
|
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
1049
1049
|
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
1050
1050
|
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
1051
|
+
/** Cover has a real stop: `stop` halts the travel in place. Gates the stop
|
|
1052
|
+
* control in exporters; a provider whose `stop` is a no-op never declares it. */
|
|
1053
|
+
DeviceFeature["CoverStoppable"] = "cover-stoppable";
|
|
1051
1054
|
/** Valve exposes intermediate position control (0..100). Gates the
|
|
1052
1055
|
* position slider / drag surface UI. */
|
|
1053
1056
|
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
@@ -1087,6 +1090,12 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
|
1087
1090
|
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
1088
1091
|
/** Media player exposes stop distinct from pause. */
|
|
1089
1092
|
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
1093
|
+
/** Media player exposes volume up / down in steps (an infrared TV has no level). */
|
|
1094
|
+
DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
|
|
1095
|
+
/** Media player exposes channel up / down in steps. */
|
|
1096
|
+
DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
|
|
1097
|
+
/** Media player exposes power on / off. */
|
|
1098
|
+
DeviceFeature["MediaPlayerPower"] = "media-player-power";
|
|
1090
1099
|
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
1091
1100
|
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
1092
1101
|
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
@@ -5913,7 +5922,7 @@ var ZodIssueCode = {
|
|
|
5913
5922
|
var ZodFirstPartyTypeKind;
|
|
5914
5923
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5915
5924
|
//#endregion
|
|
5916
|
-
//#region ../types/dist/sleep-
|
|
5925
|
+
//#region ../types/dist/sleep-BkzQdpzF.mjs
|
|
5917
5926
|
/**
|
|
5918
5927
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5919
5928
|
* window to float samples (D455).
|
|
@@ -5992,6 +6001,22 @@ function buildAlawTable() {
|
|
|
5992
6001
|
}
|
|
5993
6002
|
buildUlawTable();
|
|
5994
6003
|
buildAlawTable();
|
|
6004
|
+
/**
|
|
6005
|
+
* An addon whose own migrations did not apply refuses to initialise (D987). The error is typed
|
|
6006
|
+
* so a runner hosting several addons can tell "this addon is blocked" from a crash and keep its
|
|
6007
|
+
* co-located siblings running. Recognised by NAME and shape, never `instanceof`: a forked addon
|
|
6008
|
+
* bundles its own copy of this module, so the class the runner sees is not the one that threw.
|
|
6009
|
+
*/
|
|
6010
|
+
var MIGRATIONS_BLOCKED_ERROR_NAME = "AddonMigrationsBlockedError";
|
|
6011
|
+
var AddonMigrationsBlockedError = class extends Error {
|
|
6012
|
+
/** The ledger ids that did not apply and block the owner. */
|
|
6013
|
+
migrationIds;
|
|
6014
|
+
constructor(migrationIds) {
|
|
6015
|
+
super(`migration(s) ${migrationIds.join(", ")} did not apply and block this addon — fix or retry them (migrations.retry), then restart it`);
|
|
6016
|
+
this.name = MIGRATIONS_BLOCKED_ERROR_NAME;
|
|
6017
|
+
this.migrationIds = migrationIds;
|
|
6018
|
+
}
|
|
6019
|
+
};
|
|
5995
6020
|
/** Is this field's stored value a credential? */
|
|
5996
6021
|
function isSecretConfigField(field) {
|
|
5997
6022
|
if (field.type === "password") return true;
|
|
@@ -6030,7 +6055,7 @@ function isKeychainStoredField(field) {
|
|
|
6030
6055
|
var SECRET_CLEAR = { $secretClear: true };
|
|
6031
6056
|
/** The `'***'` token D634 redaction writes for non-admins. */
|
|
6032
6057
|
var LEGACY_DEVICE_REDACTION = "***";
|
|
6033
|
-
function isRecord$
|
|
6058
|
+
function isRecord$7(value) {
|
|
6034
6059
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6035
6060
|
}
|
|
6036
6061
|
function makeSecretMarker(ref) {
|
|
@@ -6041,12 +6066,12 @@ function makeSecretMarker(ref) {
|
|
|
6041
6066
|
}
|
|
6042
6067
|
/** A stored marker: an object whose `$secret` is a non-empty string. */
|
|
6043
6068
|
function isSecretMarker(value) {
|
|
6044
|
-
if (!isRecord$
|
|
6069
|
+
if (!isRecord$7(value)) return false;
|
|
6045
6070
|
const ref = value["$secret"];
|
|
6046
6071
|
return typeof ref === "string" && ref.length > 0;
|
|
6047
6072
|
}
|
|
6048
6073
|
function isSecretClear(value) {
|
|
6049
|
-
return isRecord$
|
|
6074
|
+
return isRecord$7(value) && value["$secretClear"] === true;
|
|
6050
6075
|
}
|
|
6051
6076
|
/**
|
|
6052
6077
|
* The UI view of a stored secret field value: a marker becomes "set", inline
|
|
@@ -6799,7 +6824,7 @@ var KeychainWriteRefusedError = class extends Error {
|
|
|
6799
6824
|
}
|
|
6800
6825
|
};
|
|
6801
6826
|
var KEEP = { kind: "keep" };
|
|
6802
|
-
function isRecord$
|
|
6827
|
+
function isRecord$6(value) {
|
|
6803
6828
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6804
6829
|
}
|
|
6805
6830
|
function defaultMintId() {
|
|
@@ -6812,7 +6837,7 @@ function collectSecretMarkerRefs(value, out = []) {
|
|
|
6812
6837
|
return out;
|
|
6813
6838
|
}
|
|
6814
6839
|
if (Array.isArray(value)) for (const item of value) collectSecretMarkerRefs(item, out);
|
|
6815
|
-
else if (isRecord$
|
|
6840
|
+
else if (isRecord$6(value)) for (const child of Object.values(value)) collectSecretMarkerRefs(child, out);
|
|
6816
6841
|
return out;
|
|
6817
6842
|
}
|
|
6818
6843
|
async function storedValueEquals(secrets, marker, candidate) {
|
|
@@ -6867,7 +6892,7 @@ function rowId(row, idKey) {
|
|
|
6867
6892
|
return null;
|
|
6868
6893
|
}
|
|
6869
6894
|
async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
6870
|
-
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$
|
|
6895
|
+
const storedRows = Array.isArray(stored) ? stored.filter(isRecord$6) : [];
|
|
6871
6896
|
if (!Array.isArray(incoming)) {
|
|
6872
6897
|
ctx.deletes.push(...collectSecretMarkerRefs(storedRows));
|
|
6873
6898
|
return {
|
|
@@ -6883,7 +6908,7 @@ async function writeArray(ctx, node, incoming, stored, fieldPath) {
|
|
|
6883
6908
|
const kept = /* @__PURE__ */ new Set();
|
|
6884
6909
|
const rows = [];
|
|
6885
6910
|
for (const row of incoming) {
|
|
6886
|
-
if (!isRecord$
|
|
6911
|
+
if (!isRecord$6(row)) {
|
|
6887
6912
|
rows.push(row);
|
|
6888
6913
|
continue;
|
|
6889
6914
|
}
|
|
@@ -6908,7 +6933,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6908
6933
|
case "leaf": return writeLeaf(ctx, incoming, stored, fieldPath);
|
|
6909
6934
|
case "array": return writeArray(ctx, node, incoming, stored, fieldPath);
|
|
6910
6935
|
case "object": {
|
|
6911
|
-
if (!isRecord$
|
|
6936
|
+
if (!isRecord$6(incoming)) {
|
|
6912
6937
|
if (incoming === void 0) return KEEP;
|
|
6913
6938
|
ctx.deletes.push(...collectSecretMarkerRefs(stored));
|
|
6914
6939
|
return {
|
|
@@ -6916,7 +6941,7 @@ async function writeNode(ctx, node, incoming, stored, fieldPath) {
|
|
|
6916
6941
|
value: incoming
|
|
6917
6942
|
};
|
|
6918
6943
|
}
|
|
6919
|
-
const storedObj = isRecord$
|
|
6944
|
+
const storedObj = isRecord$6(stored) ? stored : {};
|
|
6920
6945
|
return {
|
|
6921
6946
|
kind: "value",
|
|
6922
6947
|
value: await writeMembers(ctx, node.children, incoming, storedObj, (m) => `${fieldPath}.${m}`)
|
|
@@ -7039,7 +7064,7 @@ async function resolveSecretMarkers(value, secrets, options = {}) {
|
|
|
7039
7064
|
value: items
|
|
7040
7065
|
};
|
|
7041
7066
|
}
|
|
7042
|
-
if (isRecord$
|
|
7067
|
+
if (isRecord$6(v)) {
|
|
7043
7068
|
const out = {};
|
|
7044
7069
|
for (const [k, child] of Object.entries(v)) {
|
|
7045
7070
|
const s = substitute(child);
|
|
@@ -7071,7 +7096,7 @@ var SecretOverwriteRefusedError = class extends Error {
|
|
|
7071
7096
|
this.name = "SecretOverwriteRefusedError";
|
|
7072
7097
|
}
|
|
7073
7098
|
};
|
|
7074
|
-
function isRecord$
|
|
7099
|
+
function isRecord$5(value) {
|
|
7075
7100
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7076
7101
|
}
|
|
7077
7102
|
function resolvedValue(pass, marker) {
|
|
@@ -7100,7 +7125,7 @@ function inArray(pass, incoming, stored) {
|
|
|
7100
7125
|
return incoming.map((item, index) => {
|
|
7101
7126
|
const twin = stored[index];
|
|
7102
7127
|
if (isSecretMarker(twin)) return typeof item === "string" && item === resolvedValue(pass, twin) ? twin : item;
|
|
7103
|
-
if (isRecord$
|
|
7128
|
+
if (isRecord$5(item) && isRecord$5(twin)) return inArrayRow(pass, item, twin);
|
|
7104
7129
|
if (Array.isArray(item) && Array.isArray(twin)) return inArray(pass, item, twin);
|
|
7105
7130
|
return item;
|
|
7106
7131
|
});
|
|
@@ -7111,7 +7136,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
7111
7136
|
const twin = stored[key];
|
|
7112
7137
|
if (isSecretMarker(twin)) {
|
|
7113
7138
|
if (typeof value === "string" && value === resolvedValue(pass, twin)) out[key] = twin;
|
|
7114
|
-
} else if (isRecord$
|
|
7139
|
+
} else if (isRecord$5(value) && isRecord$5(twin)) out[key] = inArrayRow(pass, value, twin);
|
|
7115
7140
|
else if (Array.isArray(value) && Array.isArray(twin)) out[key] = inArray(pass, value, twin);
|
|
7116
7141
|
}
|
|
7117
7142
|
return out;
|
|
@@ -7119,7 +7144,7 @@ function inArrayRow(pass, incoming, stored) {
|
|
|
7119
7144
|
async function walk(pass, incoming, stored) {
|
|
7120
7145
|
if (isSecretMarker(stored)) return atMarker(pass, incoming, stored);
|
|
7121
7146
|
if (Array.isArray(incoming) && Array.isArray(stored)) return inArray(pass, incoming, stored);
|
|
7122
|
-
if (!isRecord$
|
|
7147
|
+
if (!isRecord$5(incoming) || !isRecord$5(stored)) return incoming;
|
|
7123
7148
|
const out = { ...incoming };
|
|
7124
7149
|
for (const [key, value] of Object.entries(incoming)) out[key] = await walk(pass, value, stored[key]);
|
|
7125
7150
|
return out;
|
|
@@ -7150,7 +7175,7 @@ async function restoreUnchangedSecrets(input) {
|
|
|
7150
7175
|
function isJsonEqual(a, b) {
|
|
7151
7176
|
if (Object.is(a, b)) return true;
|
|
7152
7177
|
if (Array.isArray(a)) return Array.isArray(b) && a.length === b.length && a.every((v, i) => isJsonEqual(v, b[i]));
|
|
7153
|
-
if (isRecord$
|
|
7178
|
+
if (isRecord$5(a) && isRecord$5(b)) {
|
|
7154
7179
|
const keys = Object.keys(a);
|
|
7155
7180
|
if (keys.length !== Object.keys(b).length) return false;
|
|
7156
7181
|
return keys.every((k) => Object.prototype.hasOwnProperty.call(b, k) && isJsonEqual(a[k], b[k]));
|
|
@@ -7174,7 +7199,7 @@ function markerKeysOf(blob, owner) {
|
|
|
7174
7199
|
}
|
|
7175
7200
|
function nodeFromStored(value, owner) {
|
|
7176
7201
|
if (isSecretMarker(value)) return isSecretRefOwnedBy(value.$secret, owner) ? { kind: "leaf" } : null;
|
|
7177
|
-
if (!isRecord$
|
|
7202
|
+
if (!isRecord$5(value)) return null;
|
|
7178
7203
|
const children = /* @__PURE__ */ new Map();
|
|
7179
7204
|
for (const [key, child] of Object.entries(value)) {
|
|
7180
7205
|
const node = nodeFromStored(child, owner);
|
|
@@ -7645,7 +7670,7 @@ var BaseAddon = class {
|
|
|
7645
7670
|
startMigration: (input) => api.startMigration.mutate(input),
|
|
7646
7671
|
finishMigration: (input) => api.finishMigration.mutate(input)
|
|
7647
7672
|
}, migrations, this.ctx.logger);
|
|
7648
|
-
if (report.blockOwner.length > 0) throw new
|
|
7673
|
+
if (report.blockOwner.length > 0) throw new AddonMigrationsBlockedError(report.blockOwner);
|
|
7649
7674
|
return report;
|
|
7650
7675
|
}
|
|
7651
7676
|
/**
|
|
@@ -7793,6 +7818,44 @@ var BaseAddon = class {
|
|
|
7793
7818
|
return null;
|
|
7794
7819
|
}
|
|
7795
7820
|
/**
|
|
7821
|
+
* D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
|
|
7822
|
+
* provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
|
|
7823
|
+
* declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
|
|
7824
|
+
* {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
|
|
7825
|
+
* contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
|
|
7826
|
+
*/
|
|
7827
|
+
async clusterSettingsSchema(_cap) {
|
|
7828
|
+
return null;
|
|
7829
|
+
}
|
|
7830
|
+
/**
|
|
7831
|
+
* D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
|
|
7832
|
+
* `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
|
|
7833
|
+
* forgotten node's rows go in one central delete.
|
|
7834
|
+
*/
|
|
7835
|
+
async nodeSettingsSchema(_cap) {
|
|
7836
|
+
return null;
|
|
7837
|
+
}
|
|
7838
|
+
/**
|
|
7839
|
+
* D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
|
|
7840
|
+
* or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
|
|
7841
|
+
* as device row, then this default, then the schema default (`resolveDeviceSettings`).
|
|
7842
|
+
*/
|
|
7843
|
+
async deviceDefaultsSchema(_cap) {
|
|
7844
|
+
return null;
|
|
7845
|
+
}
|
|
7846
|
+
/**
|
|
7847
|
+
* The host's read of the scoped declarations: the schema one capability declares for `scope`,
|
|
7848
|
+
* or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
|
|
7849
|
+
* host asks this method.
|
|
7850
|
+
*/
|
|
7851
|
+
async getScopedSettingsSchema(scope, cap) {
|
|
7852
|
+
switch (scope) {
|
|
7853
|
+
case "cluster": return this.clusterSettingsSchema(cap);
|
|
7854
|
+
case "node": return this.nodeSettingsSchema(cap);
|
|
7855
|
+
case "device-defaults": return this.deviceDefaultsSchema(cap);
|
|
7856
|
+
}
|
|
7857
|
+
}
|
|
7858
|
+
/**
|
|
7796
7859
|
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
7797
7860
|
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
7798
7861
|
*/
|
|
@@ -7947,6 +8010,10 @@ var BaseAddon = class {
|
|
|
7947
8010
|
const stored = keychain ? await this.readAddonStoreWithRetry() : {};
|
|
7948
8011
|
const patch = {};
|
|
7949
8012
|
for (const key of keys) {
|
|
8013
|
+
if (tree.get(key)?.kind === "array") {
|
|
8014
|
+
patch[key] = [];
|
|
8015
|
+
continue;
|
|
8016
|
+
}
|
|
7950
8017
|
const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
|
|
7951
8018
|
patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
|
|
7952
8019
|
}
|
|
@@ -8586,6 +8653,21 @@ function normalizeAddonInitResult(result) {
|
|
|
8586
8653
|
if (Array.isArray(result)) return { providers: result };
|
|
8587
8654
|
return result;
|
|
8588
8655
|
}
|
|
8656
|
+
/** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
|
|
8657
|
+
/** The files a kind may live in. `history` is device-history's (D850), never records. */
|
|
8658
|
+
var RECORD_DATABASES = ["settings", "events"];
|
|
8659
|
+
/** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
|
|
8660
|
+
var RECORD_CLASSES = [
|
|
8661
|
+
"config",
|
|
8662
|
+
"ledger",
|
|
8663
|
+
"audit",
|
|
8664
|
+
"mirror",
|
|
8665
|
+
"ephemeral"
|
|
8666
|
+
];
|
|
8667
|
+
var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
|
|
8668
|
+
var RECORD_MAX_DATA_BYTES = 1024 * 1024;
|
|
8669
|
+
var RECORD_BATCH_MAX = 1e3;
|
|
8670
|
+
var RECORD_QUERY_MAX = 1e3;
|
|
8589
8671
|
/**
|
|
8590
8672
|
* The share-view scope kinds a share-link token can carry. The hub mints
|
|
8591
8673
|
* and validates them (`ShareViewGrantSchema` builds its
|
|
@@ -8610,21 +8692,6 @@ var PeerBytesTicketSchema = object({
|
|
|
8610
8692
|
*/
|
|
8611
8693
|
declaredBytes: number().int().nonnegative().nullable()
|
|
8612
8694
|
});
|
|
8613
|
-
/** Limits and names of `ctx.records` (D881). One authority; the engine and the facade read it. */
|
|
8614
|
-
/** The files a kind may live in. `history` is device-history's (D850), never records. */
|
|
8615
|
-
var RECORD_DATABASES = ["settings", "events"];
|
|
8616
|
-
/** The classes of a kind: the `@durable` vocabulary, one authority (replaces the annotation). */
|
|
8617
|
-
var RECORD_CLASSES = [
|
|
8618
|
-
"config",
|
|
8619
|
-
"ledger",
|
|
8620
|
-
"audit",
|
|
8621
|
-
"mirror",
|
|
8622
|
-
"ephemeral"
|
|
8623
|
-
];
|
|
8624
|
-
var RECORD_DEFAULT_MAX_DATA_BYTES = 64 * 1024;
|
|
8625
|
-
var RECORD_MAX_DATA_BYTES = 1024 * 1024;
|
|
8626
|
-
var RECORD_BATCH_MAX = 1e3;
|
|
8627
|
-
var RECORD_QUERY_MAX = 1e3;
|
|
8628
8695
|
/**
|
|
8629
8696
|
* Record kinds (D881): the declaration an addon makes of one kind of fact, the
|
|
8630
8697
|
* Zod row schema that describes it, and the helper that turns the two into the
|
|
@@ -9343,6 +9410,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
9343
9410
|
"backup",
|
|
9344
9411
|
"battery",
|
|
9345
9412
|
"binary",
|
|
9413
|
+
"board-key-source",
|
|
9346
9414
|
"brightness",
|
|
9347
9415
|
"broker",
|
|
9348
9416
|
"button",
|
|
@@ -9406,6 +9474,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
9406
9474
|
"humidity-sensor",
|
|
9407
9475
|
"image",
|
|
9408
9476
|
"image-settings",
|
|
9477
|
+
"integration-instances",
|
|
9409
9478
|
"integrations",
|
|
9410
9479
|
"intercom",
|
|
9411
9480
|
"ir-transmitter",
|
|
@@ -9463,6 +9532,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
9463
9532
|
"privacy-mask",
|
|
9464
9533
|
"ptz",
|
|
9465
9534
|
"ptz-autotrack",
|
|
9535
|
+
"pump-cycle",
|
|
9466
9536
|
"reboot",
|
|
9467
9537
|
"record-entries",
|
|
9468
9538
|
"recording",
|
|
@@ -10755,18 +10825,6 @@ Object.freeze({
|
|
|
10755
10825
|
"path": "pumpRunning",
|
|
10756
10826
|
"valueType": "boolean"
|
|
10757
10827
|
},
|
|
10758
|
-
{
|
|
10759
|
-
"path": "pumpIntervalEnabled",
|
|
10760
|
-
"valueType": "boolean"
|
|
10761
|
-
},
|
|
10762
|
-
{
|
|
10763
|
-
"path": "pumpOnTime",
|
|
10764
|
-
"valueType": "number"
|
|
10765
|
-
},
|
|
10766
|
-
{
|
|
10767
|
-
"path": "pumpOffTime",
|
|
10768
|
-
"valueType": "number"
|
|
10769
|
-
},
|
|
10770
10828
|
{
|
|
10771
10829
|
"path": "lastDrink",
|
|
10772
10830
|
"valueType": "number"
|
|
@@ -10890,6 +10948,20 @@ Object.freeze({
|
|
|
10890
10948
|
"valueType": "number"
|
|
10891
10949
|
}
|
|
10892
10950
|
],
|
|
10951
|
+
"pump-cycle": [
|
|
10952
|
+
{
|
|
10953
|
+
"path": "enabled",
|
|
10954
|
+
"valueType": "boolean"
|
|
10955
|
+
},
|
|
10956
|
+
{
|
|
10957
|
+
"path": "onTime",
|
|
10958
|
+
"valueType": "number"
|
|
10959
|
+
},
|
|
10960
|
+
{
|
|
10961
|
+
"path": "offTime",
|
|
10962
|
+
"valueType": "number"
|
|
10963
|
+
}
|
|
10964
|
+
],
|
|
10893
10965
|
"recording-archive": [
|
|
10894
10966
|
{
|
|
10895
10967
|
"path": "deviceId",
|
|
@@ -11339,7 +11411,7 @@ object({
|
|
|
11339
11411
|
params: record(string(), union([string(), number()])).optional()
|
|
11340
11412
|
});
|
|
11341
11413
|
//#endregion
|
|
11342
|
-
//#region ../types/dist/composition-
|
|
11414
|
+
//#region ../types/dist/composition-CRNwcFYY.mjs
|
|
11343
11415
|
/**
|
|
11344
11416
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
11345
11417
|
*
|
|
@@ -12102,38 +12174,6 @@ function validateExpressionSource(src) {
|
|
|
12102
12174
|
return null;
|
|
12103
12175
|
}
|
|
12104
12176
|
/**
|
|
12105
|
-
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
12106
|
-
*
|
|
12107
|
-
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
12108
|
-
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
12109
|
-
* a cycle, so running starts only after 30 s above the line.
|
|
12110
|
-
*
|
|
12111
|
-
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
12112
|
-
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
12113
|
-
* report "finished" in the middle of the program, so the stop dwell is
|
|
12114
|
-
* 10 minutes on every type. The number is stored per type so one machine
|
|
12115
|
-
* can move later without moving the others.
|
|
12116
|
-
*/
|
|
12117
|
-
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
12118
|
-
var APPLIANCE_KINDS = [
|
|
12119
|
-
"washer",
|
|
12120
|
-
"dryer",
|
|
12121
|
-
"dishwasher"
|
|
12122
|
-
];
|
|
12123
|
-
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
12124
|
-
/**
|
|
12125
|
-
* A dumb plug-in stove or heater, built from a smart plug (a `Heater`).
|
|
12126
|
-
*
|
|
12127
|
-
* The plug is the actuator: `switch.setState` is a FORWARD to the plug's own
|
|
12128
|
-
* (D967), so the heater switches exactly as the plug does. Running is the
|
|
12129
|
-
* plug being on; when a power reading is also named, running is the draw
|
|
12130
|
-
* staying above the line instead (a plug left on with the stove's own
|
|
12131
|
-
* thermostat open is not heating). 50 W is far above any standby and below
|
|
12132
|
-
* the smallest radiator.
|
|
12133
|
-
*/
|
|
12134
|
-
var HEATER_TEMPLATE_ID = "heater";
|
|
12135
|
-
DeviceType.Heater;
|
|
12136
|
-
/**
|
|
12137
12177
|
* Statistics and integrals over a history read (D944).
|
|
12138
12178
|
*
|
|
12139
12179
|
* Pure: the same points always give the same answer, so a restart recomputes
|
|
@@ -12277,34 +12317,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
|
|
|
12277
12317
|
/** Actuator groups only. Readings leave this unset. */
|
|
12278
12318
|
active: ActiveCriterionSchema.optional()
|
|
12279
12319
|
}),
|
|
12280
|
-
object({
|
|
12281
|
-
kind: literal("appliance"),
|
|
12282
|
-
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
12283
|
-
appliance: _enum(APPLIANCE_KINDS),
|
|
12284
|
-
thresholdWatts: number().positive(),
|
|
12285
|
-
startDwellMs: number().int().nonnegative(),
|
|
12286
|
-
stopDwellMs: number().int().nonnegative(),
|
|
12287
|
-
member: HelperMemberSchema,
|
|
12288
|
-
/**
|
|
12289
|
-
* The plug that powers the appliance (`switch.on`). Optional: when set, the
|
|
12290
|
-
* composition carries a `power-source` feature, so the hub can cut and restore
|
|
12291
|
-
* that plug (power-source link of a NEW-target composition).
|
|
12292
|
-
*/
|
|
12293
|
-
powerSwitch: HelperMemberSchema.optional(),
|
|
12294
|
-
/** How long a forced restart keeps the plug off; the cap's default when unset. */
|
|
12295
|
-
offSeconds: number().optional()
|
|
12296
|
-
}),
|
|
12297
|
-
object({
|
|
12298
|
-
kind: literal("heater"),
|
|
12299
|
-
templateId: literal(HEATER_TEMPLATE_ID),
|
|
12300
|
-
/** The plug, read and commanded at `switch.on`. */
|
|
12301
|
-
plug: HelperMemberSchema,
|
|
12302
|
-
/** The plug's power reading, when it has one: running is then the draw, not the switch. */
|
|
12303
|
-
meter: HelperMemberSchema.optional(),
|
|
12304
|
-
thresholdWatts: number().positive(),
|
|
12305
|
-
startDwellMs: number().int().nonnegative(),
|
|
12306
|
-
stopDwellMs: number().int().nonnegative()
|
|
12307
|
-
}),
|
|
12308
12320
|
object({
|
|
12309
12321
|
kind: literal("statistic"),
|
|
12310
12322
|
stat: _enum(STATISTIC_STATS),
|
|
@@ -12476,7 +12488,14 @@ var CompositionForwardCommandSchema = object({
|
|
|
12476
12488
|
method: string().min(1),
|
|
12477
12489
|
args: record(string().min(1), CompositionForwardArgSchema).optional()
|
|
12478
12490
|
});
|
|
12479
|
-
var CompositionCommandTargetSchema = discriminatedUnion("kind", [
|
|
12491
|
+
var CompositionCommandTargetSchema = discriminatedUnion("kind", [
|
|
12492
|
+
CompositionForwardCommandSchema,
|
|
12493
|
+
CompositionCodeSourceSchema,
|
|
12494
|
+
object({
|
|
12495
|
+
kind: literal("extension"),
|
|
12496
|
+
target: literal("remote")
|
|
12497
|
+
})
|
|
12498
|
+
]);
|
|
12480
12499
|
/** An item key inside an item-array cap (`consumables.items[<key>]`). */
|
|
12481
12500
|
var COMPOSITION_ITEM_KEY_RE = /^[a-z0-9][a-z0-9-]{0,47}$/;
|
|
12482
12501
|
/**
|
|
@@ -12521,7 +12540,7 @@ var CompositionSchema = object({
|
|
|
12521
12540
|
kind: literal("existing"),
|
|
12522
12541
|
device: CompositionSourceRefSchema
|
|
12523
12542
|
})]),
|
|
12524
|
-
features: array(CompositionFeatureSchema).min(
|
|
12543
|
+
features: array(CompositionFeatureSchema).min(0).max(16),
|
|
12525
12544
|
/**
|
|
12526
12545
|
* Present when the block is a helper template. Absent on a free
|
|
12527
12546
|
* composition (the room example, device 4603). The editor reads this,
|
|
@@ -12553,6 +12572,73 @@ var NodeColorIdSchema = _enum([
|
|
|
12553
12572
|
"node-g",
|
|
12554
12573
|
"node-h"
|
|
12555
12574
|
]);
|
|
12575
|
+
//#endregion
|
|
12576
|
+
//#region ../types/dist/index.mjs
|
|
12577
|
+
var SMTP_INBOUND_DEFAULT_PORT = 2525;
|
|
12578
|
+
var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
|
|
12579
|
+
var SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES = 25 * 1024 * 1024;
|
|
12580
|
+
/** The text excerpt a message carries on the bus. */
|
|
12581
|
+
var SMTP_INBOUND_TEXT_MAX_CHARS = 4096;
|
|
12582
|
+
var PortSchema = number().int().min(1).max(65535);
|
|
12583
|
+
/** A recipient local-part: what stands before the `@`. */
|
|
12584
|
+
var SmtpRecipientSchema = string().min(1).max(64).regex(/^[A-Za-z0-9._+-]+$/);
|
|
12585
|
+
object({
|
|
12586
|
+
port: PortSchema.default(SMTP_INBOUND_DEFAULT_PORT),
|
|
12587
|
+
bindHost: string().min(1).default("0.0.0.0"),
|
|
12588
|
+
domain: string().min(1).default(SMTP_INBOUND_DEFAULT_DOMAIN),
|
|
12589
|
+
requireAuth: boolean().default(true),
|
|
12590
|
+
username: string().default(""),
|
|
12591
|
+
password: string().default("").meta({ secret: true }),
|
|
12592
|
+
starttls: boolean().default(false),
|
|
12593
|
+
maxMessageBytes: number().int().positive().default(SMTP_INBOUND_DEFAULT_MAX_MESSAGE_BYTES)
|
|
12594
|
+
});
|
|
12595
|
+
object({
|
|
12596
|
+
host: string().min(1).nullable(),
|
|
12597
|
+
hostReason: string().nullable(),
|
|
12598
|
+
port: PortSchema,
|
|
12599
|
+
domain: string().min(1),
|
|
12600
|
+
requireAuth: boolean(),
|
|
12601
|
+
username: string(),
|
|
12602
|
+
password: string(),
|
|
12603
|
+
starttls: boolean()
|
|
12604
|
+
});
|
|
12605
|
+
object({
|
|
12606
|
+
recipients: array(SmtpRecipientSchema).min(1),
|
|
12607
|
+
/**
|
|
12608
|
+
* Who is subscribing. A second `subscribe` with the same id REPLACES that subscriber's
|
|
12609
|
+
* recipients (the way a consumer that restarted, or lost a device, declares its set again);
|
|
12610
|
+
* a recipient held by another subscriber is refused with `smtp-inbound/recipient-claimed`.
|
|
12611
|
+
* Absent, the subscriber is anonymous and unique.
|
|
12612
|
+
*/
|
|
12613
|
+
subscriberId: string().min(1).max(64).optional()
|
|
12614
|
+
});
|
|
12615
|
+
var SmtpInboundAttachmentSchema = object({
|
|
12616
|
+
filename: string(),
|
|
12617
|
+
contentType: string(),
|
|
12618
|
+
bytes: number().int().nonnegative()
|
|
12619
|
+
});
|
|
12620
|
+
/** The payload of one `broker.message` (the key is the recipient local-part). */
|
|
12621
|
+
var SmtpInboundMessageSchema = object({
|
|
12622
|
+
/** Monotonic per mailbox; a gap tells a consumer it missed an event. */
|
|
12623
|
+
seq: number().int().positive(),
|
|
12624
|
+
messageId: string(),
|
|
12625
|
+
receivedAt: number().int().nonnegative(),
|
|
12626
|
+
from: string(),
|
|
12627
|
+
to: string(),
|
|
12628
|
+
subject: string(),
|
|
12629
|
+
text: string().max(SMTP_INBOUND_TEXT_MAX_CHARS),
|
|
12630
|
+
attachments: array(SmtpInboundAttachmentSchema)
|
|
12631
|
+
});
|
|
12632
|
+
object({
|
|
12633
|
+
/** The newest seq issued so far (0 before any mail). */
|
|
12634
|
+
lastSeq: number().int().nonnegative(),
|
|
12635
|
+
/** The oldest seq still retained; messages below it are gone. */
|
|
12636
|
+
oldestSeq: number().int().nonnegative(),
|
|
12637
|
+
messages: array(object({
|
|
12638
|
+
key: string(),
|
|
12639
|
+
message: SmtpInboundMessageSchema
|
|
12640
|
+
}))
|
|
12641
|
+
});
|
|
12556
12642
|
new Set([
|
|
12557
12643
|
"track",
|
|
12558
12644
|
"face",
|
|
@@ -18959,24 +19045,52 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
18959
19045
|
args: { on: false }
|
|
18960
19046
|
},
|
|
18961
19047
|
{
|
|
18962
|
-
id: "petFountain.
|
|
18963
|
-
method: "
|
|
19048
|
+
id: "petFountain.resetDailyConsumption",
|
|
19049
|
+
method: "resetDailyConsumption",
|
|
19050
|
+
label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
|
|
19051
|
+
phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
|
|
19052
|
+
icon: "rotate-ccw"
|
|
19053
|
+
}
|
|
19054
|
+
],
|
|
19055
|
+
state: [{
|
|
19056
|
+
kind: "boolean",
|
|
19057
|
+
field: "empty",
|
|
19058
|
+
label: t("Tank empty", "Serbatoio vuoto"),
|
|
19059
|
+
whenTrue: t("When the tank of {device} is empty", "Quando il serbatoio di {device} è vuoto"),
|
|
19060
|
+
whenFalse: t("When the tank of {device} is refilled", "Quando il serbatoio di {device} viene riempito"),
|
|
19061
|
+
icon: "droplet"
|
|
19062
|
+
}, {
|
|
19063
|
+
kind: "numeric",
|
|
19064
|
+
field: "waterLevel",
|
|
19065
|
+
quantity: t("the water level", "il livello dell’acqua"),
|
|
19066
|
+
label: t("Water level", "Livello dell’acqua"),
|
|
19067
|
+
unit: "%",
|
|
19068
|
+
icon: "droplets"
|
|
19069
|
+
}]
|
|
19070
|
+
},
|
|
19071
|
+
"pump-cycle": {
|
|
19072
|
+
scope: "device",
|
|
19073
|
+
noun: t("Pump cycle", "Ciclo della pompa"),
|
|
19074
|
+
actions: [
|
|
19075
|
+
{
|
|
19076
|
+
id: "pumpCycle.on",
|
|
19077
|
+
method: "setEnabled",
|
|
18964
19078
|
label: t("Pump cycle on", "Ciclo pompa attivo"),
|
|
18965
19079
|
phrase: t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
|
|
18966
19080
|
icon: "timer",
|
|
18967
19081
|
args: { on: true }
|
|
18968
19082
|
},
|
|
18969
19083
|
{
|
|
18970
|
-
id: "
|
|
18971
|
-
method: "
|
|
19084
|
+
id: "pumpCycle.off",
|
|
19085
|
+
method: "setEnabled",
|
|
18972
19086
|
label: t("Pump cycle off", "Ciclo pompa spento"),
|
|
18973
19087
|
phrase: t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
|
|
18974
19088
|
icon: "timer-off",
|
|
18975
19089
|
args: { on: false }
|
|
18976
19090
|
},
|
|
18977
19091
|
{
|
|
18978
|
-
id: "
|
|
18979
|
-
method: "
|
|
19092
|
+
id: "pumpCycle.onMinutes",
|
|
19093
|
+
method: "setOnMinutes",
|
|
18980
19094
|
label: t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
|
|
18981
19095
|
phrase: t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
|
|
18982
19096
|
icon: "timer",
|
|
@@ -18992,8 +19106,8 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
18992
19106
|
}]
|
|
18993
19107
|
},
|
|
18994
19108
|
{
|
|
18995
|
-
id: "
|
|
18996
|
-
method: "
|
|
19109
|
+
id: "pumpCycle.offMinutes",
|
|
19110
|
+
method: "setOffMinutes",
|
|
18997
19111
|
label: t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
|
|
18998
19112
|
phrase: t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
|
|
18999
19113
|
icon: "timer-off",
|
|
@@ -19007,35 +19121,63 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
19007
19121
|
unit: "min"
|
|
19008
19122
|
}
|
|
19009
19123
|
}]
|
|
19010
|
-
},
|
|
19011
|
-
{
|
|
19012
|
-
id: "petFountain.resetDailyConsumption",
|
|
19013
|
-
method: "resetDailyConsumption",
|
|
19014
|
-
label: t("Clear daily consumption", "Azzera il consumo giornaliero"),
|
|
19015
|
-
phrase: t("Clear the daily water consumption of {device}", "Azzera il consumo giornaliero di acqua di {device}"),
|
|
19016
|
-
icon: "rotate-ccw"
|
|
19017
19124
|
}
|
|
19018
19125
|
],
|
|
19019
19126
|
state: [{
|
|
19020
19127
|
kind: "boolean",
|
|
19021
|
-
field: "
|
|
19022
|
-
label: t("
|
|
19023
|
-
whenTrue: t("When
|
|
19024
|
-
whenFalse: t("When
|
|
19025
|
-
icon: "
|
|
19026
|
-
}, {
|
|
19027
|
-
kind: "numeric",
|
|
19028
|
-
field: "waterLevel",
|
|
19029
|
-
quantity: t("the water level", "il livello dell’acqua"),
|
|
19030
|
-
label: t("Water level", "Livello dell’acqua"),
|
|
19031
|
-
unit: "%",
|
|
19032
|
-
icon: "droplets"
|
|
19128
|
+
field: "enabled",
|
|
19129
|
+
label: t("Pump cycle", "Ciclo pompa"),
|
|
19130
|
+
whenTrue: t("When {device} starts running its pump on a cycle", "Quando {device} inizia a far lavorare la pompa a ciclo"),
|
|
19131
|
+
whenFalse: t("When {device} runs its pump continuously", "Quando {device} fa lavorare la pompa in continuo"),
|
|
19132
|
+
icon: "timer"
|
|
19033
19133
|
}]
|
|
19034
19134
|
},
|
|
19035
19135
|
"media-player": {
|
|
19036
19136
|
scope: "device",
|
|
19037
19137
|
noun: t("Media player", "Lettore multimediale"),
|
|
19038
19138
|
actions: [
|
|
19139
|
+
{
|
|
19140
|
+
id: "media.turnOn",
|
|
19141
|
+
method: "turnOn",
|
|
19142
|
+
label: t("Turn on", "Accendi"),
|
|
19143
|
+
phrase: t("Turn on {device}", "Accendi {device}"),
|
|
19144
|
+
icon: "power"
|
|
19145
|
+
},
|
|
19146
|
+
{
|
|
19147
|
+
id: "media.turnOff",
|
|
19148
|
+
method: "turnOff",
|
|
19149
|
+
label: t("Turn off", "Spegni"),
|
|
19150
|
+
phrase: t("Turn off {device}", "Spegni {device}"),
|
|
19151
|
+
icon: "power"
|
|
19152
|
+
},
|
|
19153
|
+
{
|
|
19154
|
+
id: "media.volumeUp",
|
|
19155
|
+
method: "volumeUp",
|
|
19156
|
+
label: t("Volume up", "Alza il volume"),
|
|
19157
|
+
phrase: t("Raise the volume of {device}", "Alza il volume di {device}"),
|
|
19158
|
+
icon: "volume-2"
|
|
19159
|
+
},
|
|
19160
|
+
{
|
|
19161
|
+
id: "media.volumeDown",
|
|
19162
|
+
method: "volumeDown",
|
|
19163
|
+
label: t("Volume down", "Abbassa il volume"),
|
|
19164
|
+
phrase: t("Lower the volume of {device}", "Abbassa il volume di {device}"),
|
|
19165
|
+
icon: "volume-2"
|
|
19166
|
+
},
|
|
19167
|
+
{
|
|
19168
|
+
id: "media.channelUp",
|
|
19169
|
+
method: "channelUp",
|
|
19170
|
+
label: t("Channel up", "Canale successivo"),
|
|
19171
|
+
phrase: t("Go to the next channel on {device}", "Passa al canale successivo su {device}"),
|
|
19172
|
+
icon: "skip-forward"
|
|
19173
|
+
},
|
|
19174
|
+
{
|
|
19175
|
+
id: "media.channelDown",
|
|
19176
|
+
method: "channelDown",
|
|
19177
|
+
label: t("Channel down", "Canale precedente"),
|
|
19178
|
+
phrase: t("Go to the previous channel on {device}", "Torna al canale precedente su {device}"),
|
|
19179
|
+
icon: "skip-back"
|
|
19180
|
+
},
|
|
19039
19181
|
{
|
|
19040
19182
|
id: "media.play",
|
|
19041
19183
|
method: "play",
|
|
@@ -20922,6 +21064,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
20922
21064
|
"audio-analyzer": system(PIPELINE),
|
|
20923
21065
|
"audio-codec": system(INTERNAL),
|
|
20924
21066
|
"auth-provider": system(IDENTITY),
|
|
21067
|
+
"board-key-source": system(INTERNAL),
|
|
20925
21068
|
backup: system("system backups — run and restored from the Backups page"),
|
|
20926
21069
|
broker: system("message-broker connections — configured, not actuated"),
|
|
20927
21070
|
"calendar-source": system(INTERNAL),
|
|
@@ -20956,6 +21099,7 @@ var SYSTEM_CAP_VOCABULARY = {
|
|
|
20956
21099
|
"load-contribution": system(INTERNAL),
|
|
20957
21100
|
"local-network": system(NETWORK),
|
|
20958
21101
|
"log-channels": system(INTERNAL),
|
|
21102
|
+
"integration-instances": system(INTERNAL),
|
|
20959
21103
|
"log-destination": system(INTERNAL),
|
|
20960
21104
|
"login-method": system(IDENTITY),
|
|
20961
21105
|
"mesh-network": system(NETWORK),
|
|
@@ -43102,7 +43246,7 @@ var TargetKindCapsSchema = object({
|
|
|
43102
43246
|
* the union is large and not meant for runtime validation here; the exported
|
|
43103
43247
|
* `TargetKind` type re-tightens `configSchema` to `ConfigUISchema`.
|
|
43104
43248
|
*/
|
|
43105
|
-
var ConfigSchemaPassthrough$
|
|
43249
|
+
var ConfigSchemaPassthrough$4 = unknown();
|
|
43106
43250
|
var TargetKindSchema = object({
|
|
43107
43251
|
kind: string(),
|
|
43108
43252
|
label: string(),
|
|
@@ -43139,7 +43283,7 @@ var TargetKindSchema = object({
|
|
|
43139
43283
|
* its raster path, which is the safe default for an unknown image.
|
|
43140
43284
|
*/
|
|
43141
43285
|
iconMediaType: string().optional(),
|
|
43142
|
-
configSchema: ConfigSchemaPassthrough$
|
|
43286
|
+
configSchema: ConfigSchemaPassthrough$4,
|
|
43143
43287
|
/**
|
|
43144
43288
|
* The config keys that decide WHERE this kind's secrets are sent (server,
|
|
43145
43289
|
* base URL, instance, chat, recipient). A save that changes any of them
|
|
@@ -45467,6 +45611,49 @@ object({
|
|
|
45467
45611
|
});
|
|
45468
45612
|
DeviceType.Sensor;
|
|
45469
45613
|
/**
|
|
45614
|
+
* Why a board key could not be read. Typed so a caller reports the cause and
|
|
45615
|
+
* never treats "could not read" as "has no key" (D49).
|
|
45616
|
+
*/
|
|
45617
|
+
var BoardKeyFailureReasonSchema = _enum([
|
|
45618
|
+
"unknown-source",
|
|
45619
|
+
"not-admin",
|
|
45620
|
+
"no-builder",
|
|
45621
|
+
"no-ingress-url",
|
|
45622
|
+
"unreachable",
|
|
45623
|
+
"unknown-board",
|
|
45624
|
+
"no-encryption-key",
|
|
45625
|
+
"unreadable-config"
|
|
45626
|
+
]);
|
|
45627
|
+
var BoardKeySourceSchema = object({
|
|
45628
|
+
sourceId: string(),
|
|
45629
|
+
name: string()
|
|
45630
|
+
});
|
|
45631
|
+
var BoardKeyBoardSchema = object({
|
|
45632
|
+
/** The builder's file name, e.g. `kitchen.yaml`: the handle `getBoardKey` takes. */
|
|
45633
|
+
configuration: string(),
|
|
45634
|
+
/** The node name the builder gives the board. */
|
|
45635
|
+
name: string(),
|
|
45636
|
+
/** The address the builder knows the board by, when it has one. */
|
|
45637
|
+
address: string().nullable()
|
|
45638
|
+
});
|
|
45639
|
+
var BoardKeyFailureSchema = object({
|
|
45640
|
+
ok: literal(false),
|
|
45641
|
+
reason: BoardKeyFailureReasonSchema,
|
|
45642
|
+
detail: string().optional()
|
|
45643
|
+
});
|
|
45644
|
+
var ListBoardsResultSchema = discriminatedUnion("ok", [object({
|
|
45645
|
+
ok: literal(true),
|
|
45646
|
+
boards: array(BoardKeyBoardSchema).readonly()
|
|
45647
|
+
}), BoardKeyFailureSchema]);
|
|
45648
|
+
var GetBoardKeyResultSchema = discriminatedUnion("ok", [object({
|
|
45649
|
+
ok: literal(true),
|
|
45650
|
+
key: string()
|
|
45651
|
+
}), BoardKeyFailureSchema]);
|
|
45652
|
+
method(_void(), array(BoardKeySourceSchema).readonly(), { auth: "admin" }), method(object({ sourceId: string().min(1) }), ListBoardsResultSchema, { auth: "admin" }), method(object({
|
|
45653
|
+
sourceId: string().min(1),
|
|
45654
|
+
configuration: string().min(1)
|
|
45655
|
+
}), GetBoardKeyResultSchema, { auth: "admin" });
|
|
45656
|
+
/**
|
|
45470
45657
|
* Dimmable-light brightness control. Co-exists with `switch` on the
|
|
45471
45658
|
* same device — the switch toggles on/off, this cap sets the level
|
|
45472
45659
|
* applied when the light is on. Drivers map their per-vendor dim
|
|
@@ -47555,6 +47742,188 @@ DeviceType.Control, method(object({
|
|
|
47555
47742
|
kind: "mutation",
|
|
47556
47743
|
auth: "protected"
|
|
47557
47744
|
});
|
|
47745
|
+
/**
|
|
47746
|
+
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
47747
|
+
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
47748
|
+
* `DeviceType.MediaPlayer`. Disjoint from the camera streaming
|
|
47749
|
+
* surface — those use `DeviceType.Camera` + the broker pipeline.
|
|
47750
|
+
*
|
|
47751
|
+
* The cap declares a wide method surface; not every backend supports
|
|
47752
|
+
* every method. Drivers signal sub-capability via the
|
|
47753
|
+
* `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
|
|
47754
|
+
* corresponding method) so the UI gates buttons without a slice
|
|
47755
|
+
* fetch — same pattern as `PanTiltZoom` for cameras.
|
|
47756
|
+
*/
|
|
47757
|
+
var MediaPlayerStateSchema = _enum([
|
|
47758
|
+
"off",
|
|
47759
|
+
"on",
|
|
47760
|
+
"idle",
|
|
47761
|
+
"playing",
|
|
47762
|
+
"paused",
|
|
47763
|
+
"buffering",
|
|
47764
|
+
"standby"
|
|
47765
|
+
]);
|
|
47766
|
+
var MediaPlayerRepeatSchema = _enum([
|
|
47767
|
+
"off",
|
|
47768
|
+
"all",
|
|
47769
|
+
"one"
|
|
47770
|
+
]);
|
|
47771
|
+
var MediaInfoSchema = object({
|
|
47772
|
+
/** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
|
|
47773
|
+
* `podcast`, …). */
|
|
47774
|
+
type: string(),
|
|
47775
|
+
/** Human-readable title. */
|
|
47776
|
+
title: string(),
|
|
47777
|
+
/** Optional artist / channel / station label. */
|
|
47778
|
+
artist: string().optional(),
|
|
47779
|
+
/** Optional album / season / show name. */
|
|
47780
|
+
album: string().optional(),
|
|
47781
|
+
/** Optional cover-art / thumbnail URL. */
|
|
47782
|
+
imageUrl: string().optional()
|
|
47783
|
+
});
|
|
47784
|
+
/**
|
|
47785
|
+
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
47786
|
+
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
47787
|
+
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
47788
|
+
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
47789
|
+
* guess, never as a reading.
|
|
47790
|
+
*/
|
|
47791
|
+
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
47792
|
+
/** The fields of a media-player status a driver can only guess. */
|
|
47793
|
+
var MediaPlayerAssumedFieldSchema = _enum([
|
|
47794
|
+
"state",
|
|
47795
|
+
"volumeLevel",
|
|
47796
|
+
"isMuted",
|
|
47797
|
+
"source"
|
|
47798
|
+
]);
|
|
47799
|
+
var MediaPlayerStatusSchema = object({
|
|
47800
|
+
/** Playback lifecycle state. */
|
|
47801
|
+
state: MediaPlayerStateSchema,
|
|
47802
|
+
/**
|
|
47803
|
+
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
47804
|
+
* A slice written before this field existed parses as `reported`.
|
|
47805
|
+
*/
|
|
47806
|
+
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
47807
|
+
/**
|
|
47808
|
+
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
47809
|
+
* this is not empty; a field not listed here is a reading even then (power
|
|
47810
|
+
* from a running-state source, mute guessed from the last send).
|
|
47811
|
+
*/
|
|
47812
|
+
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
47813
|
+
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
47814
|
+
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
47815
|
+
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
47816
|
+
/** Mute toggle distinct from volume=0. Null when no mute surface.
|
|
47817
|
+
* Pair with `DeviceFeature.MediaPlayerMute`. */
|
|
47818
|
+
isMuted: boolean().nullable(),
|
|
47819
|
+
/** Active source / input. Empty when no source surface. */
|
|
47820
|
+
source: string(),
|
|
47821
|
+
/** Selectable sources. Empty when no source surface.
|
|
47822
|
+
* Pair with `DeviceFeature.MediaPlayerSelectSource`. */
|
|
47823
|
+
availableSources: array(string()),
|
|
47824
|
+
/** Currently-playing media info. Null when nothing is playing. */
|
|
47825
|
+
currentMedia: MediaInfoSchema.nullable(),
|
|
47826
|
+
/** Current playback position in ms. Null when not seekable or
|
|
47827
|
+
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
47828
|
+
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
47829
|
+
/** Total duration of the current media in ms. Null when unknown
|
|
47830
|
+
* (live stream) or nothing is playing. */
|
|
47831
|
+
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
47832
|
+
/** Shuffle toggle. Null when no shuffle surface.
|
|
47833
|
+
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
47834
|
+
shuffle: boolean().nullable(),
|
|
47835
|
+
/** Repeat mode. Null when no repeat surface.
|
|
47836
|
+
* Pair with `DeviceFeature.MediaPlayerRepeat`. */
|
|
47837
|
+
repeat: MediaPlayerRepeatSchema.nullable(),
|
|
47838
|
+
/** Ms epoch when the slice was last updated. */
|
|
47839
|
+
lastChangedAt: number()
|
|
47840
|
+
});
|
|
47841
|
+
var stepInput = object({
|
|
47842
|
+
deviceId: number().int().nonnegative(),
|
|
47843
|
+
/** How many presses: the caller's count (Alexa `volumeSteps`, `channelCount`). */
|
|
47844
|
+
steps: number().int().min(1).max(50).default(1)
|
|
47845
|
+
});
|
|
47846
|
+
var deviceOnly = object({ deviceId: number().int().nonnegative() });
|
|
47847
|
+
DeviceType.MediaPlayer, method(deviceOnly, _void(), {
|
|
47848
|
+
kind: "mutation",
|
|
47849
|
+
auth: "protected"
|
|
47850
|
+
}), method(deviceOnly, _void(), {
|
|
47851
|
+
kind: "mutation",
|
|
47852
|
+
auth: "protected"
|
|
47853
|
+
}), method(stepInput, _void(), {
|
|
47854
|
+
kind: "mutation",
|
|
47855
|
+
auth: "protected"
|
|
47856
|
+
}), method(stepInput, _void(), {
|
|
47857
|
+
kind: "mutation",
|
|
47858
|
+
auth: "protected"
|
|
47859
|
+
}), method(stepInput, _void(), {
|
|
47860
|
+
kind: "mutation",
|
|
47861
|
+
auth: "protected"
|
|
47862
|
+
}), method(stepInput, _void(), {
|
|
47863
|
+
kind: "mutation",
|
|
47864
|
+
auth: "protected"
|
|
47865
|
+
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
47866
|
+
kind: "mutation",
|
|
47867
|
+
auth: "protected"
|
|
47868
|
+
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
47869
|
+
kind: "mutation",
|
|
47870
|
+
auth: "protected"
|
|
47871
|
+
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
47872
|
+
kind: "mutation",
|
|
47873
|
+
auth: "protected"
|
|
47874
|
+
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
47875
|
+
kind: "mutation",
|
|
47876
|
+
auth: "protected"
|
|
47877
|
+
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
47878
|
+
kind: "mutation",
|
|
47879
|
+
auth: "protected"
|
|
47880
|
+
}), method(object({
|
|
47881
|
+
deviceId: number().int().nonnegative(),
|
|
47882
|
+
position: number().int().nonnegative()
|
|
47883
|
+
}), _void(), {
|
|
47884
|
+
kind: "mutation",
|
|
47885
|
+
auth: "protected"
|
|
47886
|
+
}), method(object({
|
|
47887
|
+
deviceId: number().int().nonnegative(),
|
|
47888
|
+
volumeLevel: number().min(0).max(100)
|
|
47889
|
+
}), _void(), {
|
|
47890
|
+
kind: "mutation",
|
|
47891
|
+
auth: "protected"
|
|
47892
|
+
}), method(object({
|
|
47893
|
+
deviceId: number().int().nonnegative(),
|
|
47894
|
+
muted: boolean()
|
|
47895
|
+
}), _void(), {
|
|
47896
|
+
kind: "mutation",
|
|
47897
|
+
auth: "protected"
|
|
47898
|
+
}), method(object({
|
|
47899
|
+
deviceId: number().int().nonnegative(),
|
|
47900
|
+
shuffle: boolean()
|
|
47901
|
+
}), _void(), {
|
|
47902
|
+
kind: "mutation",
|
|
47903
|
+
auth: "protected"
|
|
47904
|
+
}), method(object({
|
|
47905
|
+
deviceId: number().int().nonnegative(),
|
|
47906
|
+
repeat: MediaPlayerRepeatSchema
|
|
47907
|
+
}), _void(), {
|
|
47908
|
+
kind: "mutation",
|
|
47909
|
+
auth: "protected"
|
|
47910
|
+
}), method(object({
|
|
47911
|
+
deviceId: number().int().nonnegative(),
|
|
47912
|
+
source: string().min(1)
|
|
47913
|
+
}), _void(), {
|
|
47914
|
+
kind: "mutation",
|
|
47915
|
+
auth: "protected"
|
|
47916
|
+
}), method(object({
|
|
47917
|
+
deviceId: number().int().nonnegative(),
|
|
47918
|
+
/** Media identifier / URL. */
|
|
47919
|
+
mediaId: string().min(1),
|
|
47920
|
+
/** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
|
|
47921
|
+
* passes it through to the upstream service. */
|
|
47922
|
+
mediaType: string().min(1)
|
|
47923
|
+
}), _void(), {
|
|
47924
|
+
kind: "mutation",
|
|
47925
|
+
auth: "protected"
|
|
47926
|
+
});
|
|
47558
47927
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Heater, DeviceType.Dryer, DeviceType.Gateway, DeviceType.Camera, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Heater, DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder, DeviceType.Heater;
|
|
47559
47928
|
var NUMBER = {
|
|
47560
47929
|
kind: "fixed",
|
|
@@ -48002,49 +48371,6 @@ function actuator(input) {
|
|
|
48002
48371
|
};
|
|
48003
48372
|
}
|
|
48004
48373
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
48005
|
-
var PowerSourceRefusalReasonSchema = _enum([
|
|
48006
|
-
"no-power-source",
|
|
48007
|
-
"switch-missing",
|
|
48008
|
-
"switch-offline",
|
|
48009
|
-
"switch-unknown",
|
|
48010
|
-
"restart-in-progress",
|
|
48011
|
-
"switch-call-failed"
|
|
48012
|
-
]);
|
|
48013
|
-
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
48014
|
-
accepted: literal(false),
|
|
48015
|
-
reason: PowerSourceRefusalReasonSchema,
|
|
48016
|
-
/** One line for the operator, naming the switch. */
|
|
48017
|
-
message: string()
|
|
48018
|
-
})]);
|
|
48019
|
-
var PowerSourceInfoSchema = object({
|
|
48020
|
-
/** False when the device has no power source linked; the rest is then empty. */
|
|
48021
|
-
linked: boolean(),
|
|
48022
|
-
switchDeviceId: number().nullable(),
|
|
48023
|
-
switchName: string().nullable(),
|
|
48024
|
-
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
48025
|
-
switchOn: boolean().nullable(),
|
|
48026
|
-
switchOnline: boolean().nullable(),
|
|
48027
|
-
restartInProgress: boolean(),
|
|
48028
|
-
offSeconds: number().int()
|
|
48029
|
-
});
|
|
48030
|
-
object({
|
|
48031
|
-
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
48032
|
-
switchOn: boolean().nullable(),
|
|
48033
|
-
offSeconds: number().int(),
|
|
48034
|
-
lastFetchedAt: number()
|
|
48035
|
-
});
|
|
48036
|
-
DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
|
|
48037
|
-
var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
|
|
48038
|
-
systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
48039
|
-
kind: "mutation",
|
|
48040
|
-
auth: "admin"
|
|
48041
|
-
}), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
48042
|
-
kind: "mutation",
|
|
48043
|
-
auth: "admin"
|
|
48044
|
-
}), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
48045
|
-
kind: "mutation",
|
|
48046
|
-
auth: "admin"
|
|
48047
|
-
});
|
|
48048
48374
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
48049
48375
|
DeviceType.Camera;
|
|
48050
48376
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
@@ -48072,6 +48398,165 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
|
|
|
48072
48398
|
}).optional()
|
|
48073
48399
|
})) });
|
|
48074
48400
|
/**
|
|
48401
|
+
* A saved Customize assignment (D936). The schema is the type: callers use
|
|
48402
|
+
* `z.infer`, they do not restate the shape.
|
|
48403
|
+
*/
|
|
48404
|
+
var OverrideSourceSchema = object({
|
|
48405
|
+
addonId: string().min(1),
|
|
48406
|
+
stableId: string().min(1),
|
|
48407
|
+
cap: string().min(1),
|
|
48408
|
+
fieldPath: string().min(1)
|
|
48409
|
+
});
|
|
48410
|
+
var IdentityTransformDraftSchema = object({ kind: literal("identity") });
|
|
48411
|
+
var InvertTransformDraftSchema = object({ kind: literal("invert") });
|
|
48412
|
+
var ThresholdTransformDraftSchema = object({
|
|
48413
|
+
kind: literal("threshold"),
|
|
48414
|
+
comparison: _enum(["gte", "lte"]),
|
|
48415
|
+
threshold: number(),
|
|
48416
|
+
startDwellMs: number().nonnegative(),
|
|
48417
|
+
stopDwellMs: number().nonnegative()
|
|
48418
|
+
});
|
|
48419
|
+
var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
|
|
48420
|
+
IdentityTransformDraftSchema,
|
|
48421
|
+
InvertTransformDraftSchema,
|
|
48422
|
+
ThresholdTransformDraftSchema,
|
|
48423
|
+
object({
|
|
48424
|
+
kind: literal("linear"),
|
|
48425
|
+
scale: number(),
|
|
48426
|
+
offset: number(),
|
|
48427
|
+
clampMin: number().optional(),
|
|
48428
|
+
clampMax: number().optional()
|
|
48429
|
+
}),
|
|
48430
|
+
object({
|
|
48431
|
+
kind: literal("enum-map"),
|
|
48432
|
+
mapping: record(string(), string().nullable())
|
|
48433
|
+
}),
|
|
48434
|
+
object({ kind: literal("number") })
|
|
48435
|
+
]);
|
|
48436
|
+
var ScalarOverrideDraftSchema = object({
|
|
48437
|
+
kind: literal("scalar"),
|
|
48438
|
+
cap: string().min(1),
|
|
48439
|
+
targetId: string().min(1),
|
|
48440
|
+
source: OverrideSourceSchema,
|
|
48441
|
+
transform: CustomizeTransformDraftSchema
|
|
48442
|
+
});
|
|
48443
|
+
var KeyedArrayOverrideDraftSchema = object({
|
|
48444
|
+
kind: literal("keyedArray"),
|
|
48445
|
+
cap: string().min(1),
|
|
48446
|
+
targetId: string().min(1),
|
|
48447
|
+
key: string().min(1),
|
|
48448
|
+
label: string().min(1),
|
|
48449
|
+
fieldPath: string().min(1),
|
|
48450
|
+
source: OverrideSourceSchema,
|
|
48451
|
+
transform: CustomizeTransformDraftSchema
|
|
48452
|
+
});
|
|
48453
|
+
var PulseOverrideDraftSchema = object({
|
|
48454
|
+
kind: literal("pulse"),
|
|
48455
|
+
cap: string().min(1),
|
|
48456
|
+
targetId: string().min(1),
|
|
48457
|
+
enabled: boolean(),
|
|
48458
|
+
debounceMs: number().nonnegative(),
|
|
48459
|
+
edges: array(_enum([
|
|
48460
|
+
"rising",
|
|
48461
|
+
"button",
|
|
48462
|
+
"native-event"
|
|
48463
|
+
])).min(1).optional(),
|
|
48464
|
+
sources: array(OverrideSourceSchema).min(1)
|
|
48465
|
+
});
|
|
48466
|
+
var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
|
|
48467
|
+
"in-addition",
|
|
48468
|
+
"confirm",
|
|
48469
|
+
"replace"
|
|
48470
|
+
]).optional() });
|
|
48471
|
+
discriminatedUnion("kind", [
|
|
48472
|
+
ScalarOverrideDraftSchema,
|
|
48473
|
+
KeyedArrayOverrideDraftSchema,
|
|
48474
|
+
PulseOverrideDraftSchema,
|
|
48475
|
+
object({
|
|
48476
|
+
kind: literal("span"),
|
|
48477
|
+
cap: string().min(1),
|
|
48478
|
+
targetId: string().min(1),
|
|
48479
|
+
timeoutMs: number().nonnegative(),
|
|
48480
|
+
cooldownMs: number().nonnegative().optional(),
|
|
48481
|
+
sources: array(SpanSourceDraftSchema)
|
|
48482
|
+
})
|
|
48483
|
+
]);
|
|
48484
|
+
object({
|
|
48485
|
+
targetId: string().min(1),
|
|
48486
|
+
configured: boolean(),
|
|
48487
|
+
source: _enum(["native", "assigned"]),
|
|
48488
|
+
state: _enum([
|
|
48489
|
+
"active",
|
|
48490
|
+
"stale",
|
|
48491
|
+
"released",
|
|
48492
|
+
"unavailable"
|
|
48493
|
+
]),
|
|
48494
|
+
reason: string().nullable()
|
|
48495
|
+
});
|
|
48496
|
+
/**
|
|
48497
|
+
* What a running-threshold proposal says (planning#405). The schema is the
|
|
48498
|
+
* type: the algorithm, the capability method and the UI all read `z.infer`.
|
|
48499
|
+
*
|
|
48500
|
+
* A proposal is read-only advice: it carries the numbers it was derived from
|
|
48501
|
+
* (`evidence`) so the operator can judge it, and an `insufficient` answer names
|
|
48502
|
+
* WHY with a typed reason and the catalog defaults, never an invented number.
|
|
48503
|
+
*/
|
|
48504
|
+
var RunningProposalTierSchema = _enum(["raw", "5m"]);
|
|
48505
|
+
var RunningProposalConfidenceSchema = _enum([
|
|
48506
|
+
"high",
|
|
48507
|
+
"medium",
|
|
48508
|
+
"low"
|
|
48509
|
+
]);
|
|
48510
|
+
var RunningProposalInsufficientReasonSchema = _enum([
|
|
48511
|
+
"no-history",
|
|
48512
|
+
"span-too-short",
|
|
48513
|
+
"truncated",
|
|
48514
|
+
"no-idle-floor",
|
|
48515
|
+
"no-runs",
|
|
48516
|
+
"no-separation"
|
|
48517
|
+
]);
|
|
48518
|
+
var RunningProposalReplaySchema = object({
|
|
48519
|
+
/** Intervals the real dwell expression held true over the window. */
|
|
48520
|
+
intervals: number().int().nonnegative(),
|
|
48521
|
+
/** Intervals outside every run, or a second interval inside one. */
|
|
48522
|
+
extra: number().int().nonnegative(),
|
|
48523
|
+
/** Runs without an interval of their own (none, or merged into a neighbour). */
|
|
48524
|
+
missed: number().int().nonnegative()
|
|
48525
|
+
});
|
|
48526
|
+
var RunningProposalEvidenceSchema = object({
|
|
48527
|
+
tier: RunningProposalTierSchema,
|
|
48528
|
+
spanMs: number().nonnegative(),
|
|
48529
|
+
from: number(),
|
|
48530
|
+
to: number(),
|
|
48531
|
+
points: number().int().nonnegative(),
|
|
48532
|
+
runsFound: number().int().nonnegative(),
|
|
48533
|
+
pausesFound: number().int().nonnegative(),
|
|
48534
|
+
longestPauseMs: number().nonnegative(),
|
|
48535
|
+
idleFloorW: number(),
|
|
48536
|
+
noiseCeilingW: number(),
|
|
48537
|
+
plateauW: number(),
|
|
48538
|
+
replay: RunningProposalReplaySchema
|
|
48539
|
+
});
|
|
48540
|
+
var RunningProposalInsufficientEvidenceSchema = object({
|
|
48541
|
+
spanMs: number().nonnegative(),
|
|
48542
|
+
points: number().int().nonnegative(),
|
|
48543
|
+
runsFound: number().int().nonnegative()
|
|
48544
|
+
});
|
|
48545
|
+
var RunningThresholdProposalSchema = discriminatedUnion("state", [object({
|
|
48546
|
+
state: literal("proposal"),
|
|
48547
|
+
transform: ThresholdTransformDraftSchema,
|
|
48548
|
+
evidence: RunningProposalEvidenceSchema,
|
|
48549
|
+
confidence: RunningProposalConfidenceSchema,
|
|
48550
|
+
/** Why the confidence is not higher; empty when nothing held it back. */
|
|
48551
|
+
notes: array(string())
|
|
48552
|
+
}), object({
|
|
48553
|
+
state: literal("insufficient"),
|
|
48554
|
+
reason: RunningProposalInsufficientReasonSchema,
|
|
48555
|
+
evidence: RunningProposalInsufficientEvidenceSchema,
|
|
48556
|
+
/** The catalog defaults, offered as what stands when nothing better is known. */
|
|
48557
|
+
fallback: ThresholdTransformDraftSchema
|
|
48558
|
+
})]);
|
|
48559
|
+
/**
|
|
48075
48560
|
* The report of a one-shot "move this owner's plaintext secrets into the
|
|
48076
48561
|
* keychain" run (D878). COUNTS only - never a value, never a ref.
|
|
48077
48562
|
*
|
|
@@ -48361,6 +48846,14 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
|
|
|
48361
48846
|
kind: "mutation",
|
|
48362
48847
|
auth: "admin",
|
|
48363
48848
|
access: "view"
|
|
48849
|
+
}), method(object({
|
|
48850
|
+
deviceId: number().int(),
|
|
48851
|
+
cap: string().min(1),
|
|
48852
|
+
fieldPath: string().min(1),
|
|
48853
|
+
deviceType: _enum(DeviceType).optional()
|
|
48854
|
+
}), RunningThresholdProposalSchema, {
|
|
48855
|
+
auth: "admin",
|
|
48856
|
+
access: "view"
|
|
48364
48857
|
}), method(object({
|
|
48365
48858
|
blockId: string().min(1),
|
|
48366
48859
|
trace: AutomationRunTraceSchema.optional(),
|
|
@@ -49169,7 +49662,53 @@ method(object({
|
|
|
49169
49662
|
* exposes only the COMMON surface: link state, supported device
|
|
49170
49663
|
* kinds (so the UI can filter the device picker), and per-device
|
|
49171
49664
|
* expose/unexpose.
|
|
49665
|
+
*
|
|
49666
|
+
* INSTANCES. One export addon can serve several independent targets (a
|
|
49667
|
+
* HomeKit bridge, a Home Assistant broker). `listInstances` names them.
|
|
49668
|
+
* `instanceId` on a READ is optional: absent = the whole addon (linked if any
|
|
49669
|
+
* enabled instance is, `exposedDeviceCount` = distinct devices, `setup` = the
|
|
49670
|
+
* default instance's); present = that instance; an id the provider does not
|
|
49671
|
+
* serve is refused with `ExportInstanceUnknownError` (`export-instance-unknown`),
|
|
49672
|
+
* never answered empty. `instanceId` on a WRITE is REQUIRED: a membership
|
|
49673
|
+
* change always names the target it changes. A single-instance provider
|
|
49674
|
+
* accepts an absent id on a read or its own id, and refuses any other.
|
|
49675
|
+
*/
|
|
49676
|
+
/** Which instance of an export addon a call addresses. Absent on a read = the whole addon. */
|
|
49677
|
+
var InstanceIdSchema$1 = string().min(1);
|
|
49678
|
+
var InstancePinSchema = object({ instanceId: InstanceIdSchema$1.optional() });
|
|
49679
|
+
/** One independent export target of an addon. */
|
|
49680
|
+
var ExportInstanceSchema = object({
|
|
49681
|
+
instanceId: InstanceIdSchema$1,
|
|
49682
|
+
name: string(),
|
|
49683
|
+
enabled: boolean(),
|
|
49684
|
+
kind: string().optional()
|
|
49685
|
+
});
|
|
49686
|
+
var EXPORT_INSTANCE_UNKNOWN = "export-instance-unknown";
|
|
49687
|
+
/** The named failure of an `instanceId` the provider does not serve. The message starts with the code. */
|
|
49688
|
+
var ExportInstanceUnknownError = class extends Error {
|
|
49689
|
+
code = EXPORT_INSTANCE_UNKNOWN;
|
|
49690
|
+
instanceId;
|
|
49691
|
+
constructor(addon, instanceId) {
|
|
49692
|
+
super(`${EXPORT_INSTANCE_UNKNOWN}: ${addon} serves no instance "${instanceId}"`);
|
|
49693
|
+
this.name = "ExportInstanceUnknownError";
|
|
49694
|
+
this.instanceId = instanceId;
|
|
49695
|
+
}
|
|
49696
|
+
};
|
|
49697
|
+
/**
|
|
49698
|
+
* The instance a `getStatus` call names. The cap's `status` block injects a per-device
|
|
49699
|
+
* `getStatus({ deviceId })` beside the method's own `{ instanceId? }`, so the provider sees
|
|
49700
|
+
* both shapes; only the second names an instance (a per-device status read is addon-wide).
|
|
49172
49701
|
*/
|
|
49702
|
+
function statusInstanceOf(input) {
|
|
49703
|
+
return "instanceId" in input ? input.instanceId : void 0;
|
|
49704
|
+
}
|
|
49705
|
+
/**
|
|
49706
|
+
* A single-instance provider's check: an absent id or its own passes, any other throws
|
|
49707
|
+
* `ExportInstanceUnknownError`.
|
|
49708
|
+
*/
|
|
49709
|
+
function assertOwnExportInstance(addon, own, instanceId) {
|
|
49710
|
+
if (instanceId !== void 0 && instanceId !== own) throw new ExportInstanceUnknownError(addon, instanceId);
|
|
49711
|
+
}
|
|
49173
49712
|
var LinkStateSchema = _enum([
|
|
49174
49713
|
"unlinked",
|
|
49175
49714
|
"linked",
|
|
@@ -49220,10 +49759,14 @@ var ExposedDeviceSchema = object({
|
|
|
49220
49759
|
capabilities: array(string()).optional()
|
|
49221
49760
|
});
|
|
49222
49761
|
var ExposeInputSchema = object({
|
|
49762
|
+
instanceId: InstanceIdSchema$1,
|
|
49223
49763
|
deviceId: string(),
|
|
49224
49764
|
capabilities: array(string()).optional()
|
|
49225
49765
|
});
|
|
49226
|
-
var UnexposeInputSchema = object({
|
|
49766
|
+
var UnexposeInputSchema = object({
|
|
49767
|
+
instanceId: InstanceIdSchema$1,
|
|
49768
|
+
deviceId: string()
|
|
49769
|
+
});
|
|
49227
49770
|
/**
|
|
49228
49771
|
* What an exporter may expose besides devices (D968). An action and a
|
|
49229
49772
|
* notification target are LIST ENTRIES, never devices (D954): they enter an
|
|
@@ -49252,8 +49795,14 @@ var ExposedEntitySchema = object({
|
|
|
49252
49795
|
entity: ExportEntityRefSchema,
|
|
49253
49796
|
exposedAs: string().optional()
|
|
49254
49797
|
});
|
|
49255
|
-
var ExposeEntityInputSchema = object({
|
|
49256
|
-
|
|
49798
|
+
var ExposeEntityInputSchema = object({
|
|
49799
|
+
instanceId: InstanceIdSchema$1,
|
|
49800
|
+
entity: ExportEntityRefSchema
|
|
49801
|
+
});
|
|
49802
|
+
var UnexposeEntityInputSchema = object({
|
|
49803
|
+
instanceId: InstanceIdSchema$1,
|
|
49804
|
+
entity: ExportEntityRefSchema
|
|
49805
|
+
});
|
|
49257
49806
|
var deviceExportCapability = {
|
|
49258
49807
|
name: "device-export",
|
|
49259
49808
|
scope: "system",
|
|
@@ -49273,9 +49822,10 @@ var deviceExportCapability = {
|
|
|
49273
49822
|
*/
|
|
49274
49823
|
exposesDeviceSettings: true,
|
|
49275
49824
|
methods: {
|
|
49276
|
-
getStatus: method(
|
|
49277
|
-
|
|
49278
|
-
|
|
49825
|
+
getStatus: method(InstancePinSchema, DeviceExportStatusSchema),
|
|
49826
|
+
listInstances: method(_void(), array(ExportInstanceSchema)),
|
|
49827
|
+
listSupportedDeviceKinds: method(InstancePinSchema, array(DeviceKindSchema)),
|
|
49828
|
+
listExposedDevices: method(InstancePinSchema, array(ExposedDeviceSchema)),
|
|
49279
49829
|
exposeDevice: method(ExposeInputSchema, _void(), {
|
|
49280
49830
|
kind: "mutation",
|
|
49281
49831
|
auth: "admin"
|
|
@@ -49285,7 +49835,7 @@ var deviceExportCapability = {
|
|
|
49285
49835
|
auth: "admin"
|
|
49286
49836
|
}),
|
|
49287
49837
|
listSupportedEntityKinds: optionalMethod(_void(), array(ExportEntityKindSchema)),
|
|
49288
|
-
listExposedEntities: optionalMethod(
|
|
49838
|
+
listExposedEntities: optionalMethod(InstancePinSchema, array(ExposedEntitySchema)),
|
|
49289
49839
|
exposeEntity: optionalMethod(ExposeEntityInputSchema, _void(), {
|
|
49290
49840
|
kind: "mutation",
|
|
49291
49841
|
auth: "admin"
|
|
@@ -51169,7 +51719,7 @@ object({
|
|
|
51169
51719
|
/** Ms epoch of the last value received from the appliance; 0 = never. */
|
|
51170
51720
|
lastFetchedAt: number()
|
|
51171
51721
|
});
|
|
51172
|
-
var DeviceIdSchema$
|
|
51722
|
+
var DeviceIdSchema$2 = number().int().nonnegative();
|
|
51173
51723
|
/** A value a program option or setting can take. */
|
|
51174
51724
|
var DishwasherValueSchema = union([
|
|
51175
51725
|
boolean(),
|
|
@@ -51233,77 +51783,77 @@ var DishwasherOptionsSchema = object({
|
|
|
51233
51783
|
options: array(DishwasherOptionDescriptorSchema)
|
|
51234
51784
|
});
|
|
51235
51785
|
DeviceType.Dishwasher, method(object({
|
|
51236
|
-
deviceId: DeviceIdSchema$
|
|
51786
|
+
deviceId: DeviceIdSchema$2,
|
|
51237
51787
|
program: string().min(1).optional(),
|
|
51238
51788
|
options: record(string(), DishwasherValueSchema).optional()
|
|
51239
51789
|
}), _void(), {
|
|
51240
51790
|
kind: "mutation",
|
|
51241
51791
|
auth: "protected"
|
|
51242
|
-
}), method(object({ deviceId: DeviceIdSchema$
|
|
51792
|
+
}), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
|
|
51243
51793
|
kind: "mutation",
|
|
51244
51794
|
auth: "protected"
|
|
51245
|
-
}), method(object({ deviceId: DeviceIdSchema$
|
|
51795
|
+
}), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
|
|
51246
51796
|
kind: "mutation",
|
|
51247
51797
|
auth: "protected"
|
|
51248
|
-
}), method(object({ deviceId: DeviceIdSchema$
|
|
51798
|
+
}), method(object({ deviceId: DeviceIdSchema$2 }), _void(), {
|
|
51249
51799
|
kind: "mutation",
|
|
51250
51800
|
auth: "protected"
|
|
51251
51801
|
}), method(object({
|
|
51252
|
-
deviceId: DeviceIdSchema$
|
|
51802
|
+
deviceId: DeviceIdSchema$2,
|
|
51253
51803
|
program: string().min(1)
|
|
51254
51804
|
}), _void(), {
|
|
51255
51805
|
kind: "mutation",
|
|
51256
51806
|
auth: "protected"
|
|
51257
51807
|
}), method(object({
|
|
51258
|
-
deviceId: DeviceIdSchema$
|
|
51808
|
+
deviceId: DeviceIdSchema$2,
|
|
51259
51809
|
on: boolean()
|
|
51260
51810
|
}), _void(), {
|
|
51261
51811
|
kind: "mutation",
|
|
51262
51812
|
auth: "protected"
|
|
51263
51813
|
}), method(object({
|
|
51264
|
-
deviceId: DeviceIdSchema$
|
|
51814
|
+
deviceId: DeviceIdSchema$2,
|
|
51265
51815
|
on: boolean()
|
|
51266
51816
|
}), _void(), {
|
|
51267
51817
|
kind: "mutation",
|
|
51268
51818
|
auth: "protected"
|
|
51269
51819
|
}), method(object({
|
|
51270
|
-
deviceId: DeviceIdSchema$
|
|
51820
|
+
deviceId: DeviceIdSchema$2,
|
|
51271
51821
|
on: boolean()
|
|
51272
51822
|
}), _void(), {
|
|
51273
51823
|
kind: "mutation",
|
|
51274
51824
|
auth: "protected"
|
|
51275
51825
|
}), method(object({
|
|
51276
|
-
deviceId: DeviceIdSchema$
|
|
51826
|
+
deviceId: DeviceIdSchema$2,
|
|
51277
51827
|
on: boolean()
|
|
51278
51828
|
}), _void(), {
|
|
51279
51829
|
kind: "mutation",
|
|
51280
51830
|
auth: "protected"
|
|
51281
51831
|
}), method(object({
|
|
51282
|
-
deviceId: DeviceIdSchema$
|
|
51832
|
+
deviceId: DeviceIdSchema$2,
|
|
51283
51833
|
on: boolean()
|
|
51284
51834
|
}), _void(), {
|
|
51285
51835
|
kind: "mutation",
|
|
51286
51836
|
auth: "protected"
|
|
51287
51837
|
}), method(object({
|
|
51288
|
-
deviceId: DeviceIdSchema$
|
|
51838
|
+
deviceId: DeviceIdSchema$2,
|
|
51289
51839
|
on: boolean()
|
|
51290
51840
|
}), _void(), {
|
|
51291
51841
|
kind: "mutation",
|
|
51292
51842
|
auth: "protected"
|
|
51293
51843
|
}), method(object({
|
|
51294
|
-
deviceId: DeviceIdSchema$
|
|
51844
|
+
deviceId: DeviceIdSchema$2,
|
|
51295
51845
|
on: boolean()
|
|
51296
51846
|
}), _void(), {
|
|
51297
51847
|
kind: "mutation",
|
|
51298
51848
|
auth: "protected"
|
|
51299
51849
|
}), method(object({
|
|
51300
|
-
deviceId: DeviceIdSchema$
|
|
51850
|
+
deviceId: DeviceIdSchema$2,
|
|
51301
51851
|
key: string().min(1),
|
|
51302
51852
|
value: DishwasherValueSchema
|
|
51303
51853
|
}), _void(), {
|
|
51304
51854
|
kind: "mutation",
|
|
51305
51855
|
auth: "protected"
|
|
51306
|
-
}), method(object({ deviceId: DeviceIdSchema$
|
|
51856
|
+
}), method(object({ deviceId: DeviceIdSchema$2 }), DishwasherOptionsSchema, { auth: "protected" });
|
|
51307
51857
|
/**
|
|
51308
51858
|
* Palette entry ids (D939). Audio is the one gradient; `audio-*` leaves are
|
|
51309
51859
|
* not entries. `heatmapScrub` is a mark, not an event kind.
|
|
@@ -52490,15 +53040,15 @@ var FanPresetCaptureResultSchema = object({
|
|
|
52490
53040
|
items: array(FanCaptureItemSchema),
|
|
52491
53041
|
omitted: array(FanCaptureOmissionSchema)
|
|
52492
53042
|
});
|
|
52493
|
-
var deviceInput$
|
|
53043
|
+
var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
|
|
52494
53044
|
DeviceType.Fan;
|
|
52495
|
-
method(deviceInput$
|
|
53045
|
+
method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
|
|
52496
53046
|
kind: "mutation",
|
|
52497
53047
|
auth: "admin"
|
|
52498
|
-
}), method(deviceInput$
|
|
53048
|
+
}), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
|
|
52499
53049
|
kind: "mutation",
|
|
52500
53050
|
auth: "protected"
|
|
52501
|
-
}), method(deviceInput$
|
|
53051
|
+
}), method(deviceInput$2.extend({
|
|
52502
53052
|
fields: array(FanCaptureFieldSchema).optional(),
|
|
52503
53053
|
steps: array(ActionStepSchema).max(20).default([])
|
|
52504
53054
|
}), FanPresetCaptureResultSchema, { auth: "protected" });
|
|
@@ -53002,6 +53552,133 @@ method(_void(), array(IntegrationWithStateSchema)), method(object({ id: string()
|
|
|
53002
53552
|
auth: "admin"
|
|
53003
53553
|
});
|
|
53004
53554
|
/**
|
|
53555
|
+
* `integration-instances` - the connection of an addon that holds ONE or SEVERAL
|
|
53556
|
+
* (an account, a relay, a destination) as typed records (D985, D986). The addon's
|
|
53557
|
+
* own function page reads and writes them (Logging for Loki); the Integrations
|
|
53558
|
+
* page lists only the integrations that bring devices (D996).
|
|
53559
|
+
*
|
|
53560
|
+
* A collection of providers: each addon that holds connections registers one and a
|
|
53561
|
+
* caller reaches a provider with the pinned `addonId`.
|
|
53562
|
+
*
|
|
53563
|
+
* Identity: the instance id is immutable and opaque to the caller. A record the
|
|
53564
|
+
* Loki migration made keeps the `integrations` registry id it was created under
|
|
53565
|
+
* (`int_NNNN`); a single instance made by its function page takes the addon id.
|
|
53566
|
+
* `name` is the editable label.
|
|
53567
|
+
*
|
|
53568
|
+
* Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
|
|
53569
|
+
* the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
|
|
53570
|
+
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
53571
|
+
* clears it.
|
|
53572
|
+
*/
|
|
53573
|
+
var ConfigSchemaPassthrough$3 = custom();
|
|
53574
|
+
var IntegrationInstanceIdSchema = string().min(1);
|
|
53575
|
+
var IntegrationInstanceModeSchema = _enum(["single", "multiple"]);
|
|
53576
|
+
/**
|
|
53577
|
+
* One kind of instance a provider can create (an adapter, an account type). The sign-in and
|
|
53578
|
+
* connect fields follow the `broker` contract (`broker.cap.ts`): `signIn.basePath` is a
|
|
53579
|
+
* hub-relative route set speaking the sign-in contract, `connectPath` / `disconnectPath` open an
|
|
53580
|
+
* interactive account link (popup) and may carry `{{brokerId}}`, which the UI replaces with the
|
|
53581
|
+
* instance id.
|
|
53582
|
+
*/
|
|
53583
|
+
var IntegrationInstanceKindSchema = object({
|
|
53584
|
+
/** Stable id of the kind, sent back as `createInstance.kind`. */
|
|
53585
|
+
id: string().min(1),
|
|
53586
|
+
label: string().min(1),
|
|
53587
|
+
/** The kind signs in through a server-held interactive session. */
|
|
53588
|
+
signIn: object({
|
|
53589
|
+
basePath: string().min(1),
|
|
53590
|
+
methods: array(_enum(["device-code", "proxy"])).optional()
|
|
53591
|
+
}).optional(),
|
|
53592
|
+
/** Relative hub path to start an interactive account link of an instance of this kind. */
|
|
53593
|
+
connectPath: string().min(1).optional(),
|
|
53594
|
+
/** Relative hub path to disconnect that account. */
|
|
53595
|
+
disconnectPath: string().min(1).optional()
|
|
53596
|
+
});
|
|
53597
|
+
var IntegrationInstanceDescriptionSchema = object({
|
|
53598
|
+
/** `single`: at most one instance can exist (Loki). `multiple`: an account each. */
|
|
53599
|
+
instanceMode: IntegrationInstanceModeSchema,
|
|
53600
|
+
/** What the instance is, for the UI (`destination`, `relay`, `account`). */
|
|
53601
|
+
kind: string(),
|
|
53602
|
+
/** True when `testInstance` really probes the remote. */
|
|
53603
|
+
canTest: boolean(),
|
|
53604
|
+
/**
|
|
53605
|
+
* The kinds an instance can be of. Absent or one entry: nothing to choose; more than one: the
|
|
53606
|
+
* Add flow asks which first and sends it as `createInstance.kind`.
|
|
53607
|
+
*/
|
|
53608
|
+
kinds: array(IntegrationInstanceKindSchema).optional(),
|
|
53609
|
+
/**
|
|
53610
|
+
* The provider accepts `createInstance.id` for an id that once existed (an adopted id, because
|
|
53611
|
+
* devices carry it). The UI then offers "restore under its old id" on Add. Absent means no.
|
|
53612
|
+
*/
|
|
53613
|
+
allowRestoreId: boolean().optional(),
|
|
53614
|
+
/**
|
|
53615
|
+
* `createInstance` without an `id` works: the provider mints it. Absent means the caller must
|
|
53616
|
+
* send an id (the UI then mints an opaque one).
|
|
53617
|
+
*/
|
|
53618
|
+
mintsId: boolean().optional()
|
|
53619
|
+
});
|
|
53620
|
+
var IntegrationInstanceStatusSchema = object({
|
|
53621
|
+
state: _enum([
|
|
53622
|
+
"ok",
|
|
53623
|
+
"off",
|
|
53624
|
+
"error",
|
|
53625
|
+
"unknown"
|
|
53626
|
+
]),
|
|
53627
|
+
detail: string().optional(),
|
|
53628
|
+
/** A short human word for the state ("Signed in", "Token expired"); shown instead of `state`. */
|
|
53629
|
+
label: string().optional()
|
|
53630
|
+
});
|
|
53631
|
+
var IntegrationInstanceSchema = object({
|
|
53632
|
+
id: IntegrationInstanceIdSchema,
|
|
53633
|
+
name: string(),
|
|
53634
|
+
/** The addon's own rule (an URL is present, a client id is present...). */
|
|
53635
|
+
configured: boolean(),
|
|
53636
|
+
/**
|
|
53637
|
+
* The instance's own on/off switch (D996): always present, derived from the record body
|
|
53638
|
+
* (`enabled !== false`, so a row written before the field existed is on).
|
|
53639
|
+
*/
|
|
53640
|
+
enabled: boolean(),
|
|
53641
|
+
/** The kind of this instance (one of `describe().kinds[].id`), when the provider has kinds. */
|
|
53642
|
+
kind: string().optional(),
|
|
53643
|
+
/** Values for the instance form; a secret is a `SecretFieldView`, never text. */
|
|
53644
|
+
formValues: record(string(), unknown()),
|
|
53645
|
+
status: IntegrationInstanceStatusSchema.optional(),
|
|
53646
|
+
/** Epoch ms of the last probe of the remote that produced `status`; absent when never checked. */
|
|
53647
|
+
lastCheckedAt: number().optional()
|
|
53648
|
+
});
|
|
53649
|
+
var IntegrationInstancePatchSchema = object({
|
|
53650
|
+
id: IntegrationInstanceIdSchema,
|
|
53651
|
+
name: string().min(1).optional(),
|
|
53652
|
+
/** Omitted / '' / redaction token keeps a secret; `{ $secretClear: true }` clears it. */
|
|
53653
|
+
values: record(string(), unknown())
|
|
53654
|
+
});
|
|
53655
|
+
method(_void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3, { auth: "admin" }), method(_void(), array(IntegrationInstanceSchema).readonly(), { auth: "admin" }), method(object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }), method(object({
|
|
53656
|
+
id: IntegrationInstanceIdSchema.optional(),
|
|
53657
|
+
name: string().min(1),
|
|
53658
|
+
kind: string().min(1).optional()
|
|
53659
|
+
}), object({ id: string() }), {
|
|
53660
|
+
kind: "mutation",
|
|
53661
|
+
auth: "admin"
|
|
53662
|
+
}), method(IntegrationInstancePatchSchema, object({ ok: literal(true) }), {
|
|
53663
|
+
kind: "mutation",
|
|
53664
|
+
auth: "admin"
|
|
53665
|
+
}), method(object({
|
|
53666
|
+
id: IntegrationInstanceIdSchema,
|
|
53667
|
+
enabled: boolean()
|
|
53668
|
+
}), object({ ok: literal(true) }), {
|
|
53669
|
+
kind: "mutation",
|
|
53670
|
+
auth: "admin"
|
|
53671
|
+
}), method(object({ id: IntegrationInstanceIdSchema }), object({ ok: literal(true) }), {
|
|
53672
|
+
kind: "mutation",
|
|
53673
|
+
auth: "admin"
|
|
53674
|
+
}), optionalMethod(object({
|
|
53675
|
+
id: IntegrationInstanceIdSchema.nullable(),
|
|
53676
|
+
values: record(string(), unknown())
|
|
53677
|
+
}), TestConnectionResultSchema$1, {
|
|
53678
|
+
kind: "mutation",
|
|
53679
|
+
auth: "admin"
|
|
53680
|
+
});
|
|
53681
|
+
/**
|
|
53005
53682
|
* Two-way audio / talk-back cap. Clients open a WebRTC audio-only
|
|
53006
53683
|
* session (server-initiated offer pattern, identical to the main
|
|
53007
53684
|
* video WebRTC flow) and the browser captures the mic; the server
|
|
@@ -54799,6 +55476,11 @@ var LogEntrySchema = object({
|
|
|
54799
55476
|
* flight, and not asking for the next slice ends the scan.
|
|
54800
55477
|
*/
|
|
54801
55478
|
var LogReadQuerySchema = object({
|
|
55479
|
+
/**
|
|
55480
|
+
* Which destination INSTANCE answers (a destination addon may hold several records). Absent ⇒
|
|
55481
|
+
* the provider's first readable one, so a caller written before instances existed is unchanged.
|
|
55482
|
+
*/
|
|
55483
|
+
instanceId: string().min(1).max(200).optional(),
|
|
54802
55484
|
/** Correlates `cancelRead`. Caller-chosen, unique per in-flight read. */
|
|
54803
55485
|
requestId: string().min(1).max(64).optional(),
|
|
54804
55486
|
/** The device the line is about (`tags.deviceId`, numeric). */
|
|
@@ -54861,6 +55543,8 @@ var LogReadResultSchema = object({
|
|
|
54861
55543
|
/** True when `cancelRead` ended this slice early. */
|
|
54862
55544
|
cancelled: boolean().optional()
|
|
54863
55545
|
});
|
|
55546
|
+
/** Names one destination instance; absent ⇒ the provider's first readable one. */
|
|
55547
|
+
var LogInstanceSelectorSchema = object({ instanceId: string().min(1).max(200).optional() });
|
|
54864
55548
|
var LogReadCapabilitiesSchema = object({
|
|
54865
55549
|
/** False ⇒ this destination only ships lines (console, forwarder, an unconfigured Loki). */
|
|
54866
55550
|
readable: boolean(),
|
|
@@ -54879,7 +55563,7 @@ var LogReadCapabilitiesSchema = object({
|
|
|
54879
55563
|
/** How far back the store reaches, when the provider knows (days). */
|
|
54880
55564
|
retentionDays: number().nullable()
|
|
54881
55565
|
});
|
|
54882
|
-
method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(
|
|
55566
|
+
method(LogEntrySchema, _void(), { kind: "mutation" }), optionalMethod(LogInstanceSelectorSchema, LogReadCapabilitiesSchema, { auth: "admin" }), optionalMethod(LogReadQuerySchema, LogReadResultSchema, { auth: "admin" }), optionalMethod(object({ requestId: string().min(1).max(64) }), object({ cancelled: boolean() }), {
|
|
54883
55567
|
kind: "mutation",
|
|
54884
55568
|
auth: "admin"
|
|
54885
55569
|
});
|
|
@@ -54983,164 +55667,6 @@ var LoginMethodContributionSchema = discriminatedUnion("kind", [
|
|
|
54983
55667
|
]);
|
|
54984
55668
|
method(_void(), array(LoginMethodContributionSchema).readonly());
|
|
54985
55669
|
/**
|
|
54986
|
-
* Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
|
|
54987
|
-
* Apple TV, Spotify, Roku, generic OTT receivers, …) on
|
|
54988
|
-
* `DeviceType.MediaPlayer`. Disjoint from the camera streaming
|
|
54989
|
-
* surface — those use `DeviceType.Camera` + the broker pipeline.
|
|
54990
|
-
*
|
|
54991
|
-
* The cap declares a wide method surface; not every backend supports
|
|
54992
|
-
* every method. Drivers signal sub-capability via the
|
|
54993
|
-
* `DeviceFeature.MediaPlayerXxx` flags (paired one-to-one with the
|
|
54994
|
-
* corresponding method) so the UI gates buttons without a slice
|
|
54995
|
-
* fetch — same pattern as `PanTiltZoom` for cameras.
|
|
54996
|
-
*/
|
|
54997
|
-
var MediaPlayerStateSchema = _enum([
|
|
54998
|
-
"off",
|
|
54999
|
-
"on",
|
|
55000
|
-
"idle",
|
|
55001
|
-
"playing",
|
|
55002
|
-
"paused",
|
|
55003
|
-
"buffering",
|
|
55004
|
-
"standby"
|
|
55005
|
-
]);
|
|
55006
|
-
var MediaPlayerRepeatSchema = _enum([
|
|
55007
|
-
"off",
|
|
55008
|
-
"all",
|
|
55009
|
-
"one"
|
|
55010
|
-
]);
|
|
55011
|
-
var MediaInfoSchema = object({
|
|
55012
|
-
/** Free-form media kind (`music`, `tvshow`, `movie`, `app`, `channel`,
|
|
55013
|
-
* `podcast`, …). */
|
|
55014
|
-
type: string(),
|
|
55015
|
-
/** Human-readable title. */
|
|
55016
|
-
title: string(),
|
|
55017
|
-
/** Optional artist / channel / station label. */
|
|
55018
|
-
artist: string().optional(),
|
|
55019
|
-
/** Optional album / season / show name. */
|
|
55020
|
-
album: string().optional(),
|
|
55021
|
-
/** Optional cover-art / thumbnail URL. */
|
|
55022
|
-
imageUrl: string().optional()
|
|
55023
|
-
});
|
|
55024
|
-
/**
|
|
55025
|
-
* Where `state`, `volumeLevel`, `isMuted` and `source` come from. `reported`:
|
|
55026
|
-
* the device said so. `assumed`: the driver has no feedback (infrared) and
|
|
55027
|
-
* tracks what it last SENT; it moves only after a send was accepted, and a
|
|
55028
|
-
* human at the real remote makes it wrong. A UI shows an assumed value as a
|
|
55029
|
-
* guess, never as a reading.
|
|
55030
|
-
*/
|
|
55031
|
-
var MediaPlayerStateSourceSchema = _enum(["reported", "assumed"]);
|
|
55032
|
-
/** The fields of a media-player status a driver can only guess. */
|
|
55033
|
-
var MediaPlayerAssumedFieldSchema = _enum([
|
|
55034
|
-
"state",
|
|
55035
|
-
"volumeLevel",
|
|
55036
|
-
"isMuted",
|
|
55037
|
-
"source"
|
|
55038
|
-
]);
|
|
55039
|
-
object({
|
|
55040
|
-
/** Playback lifecycle state. */
|
|
55041
|
-
state: MediaPlayerStateSchema,
|
|
55042
|
-
/**
|
|
55043
|
-
* Whether the state fields are readings or the driver's own bookkeeping.
|
|
55044
|
-
* A slice written before this field existed parses as `reported`.
|
|
55045
|
-
*/
|
|
55046
|
-
stateSource: MediaPlayerStateSourceSchema.default("reported"),
|
|
55047
|
-
/**
|
|
55048
|
-
* Which fields are the driver's own guess. `stateSource` is `assumed` when
|
|
55049
|
-
* this is not empty; a field not listed here is a reading even then (power
|
|
55050
|
-
* from a running-state source, mute guessed from the last send).
|
|
55051
|
-
*/
|
|
55052
|
-
assumedFields: array(MediaPlayerAssumedFieldSchema).default([]),
|
|
55053
|
-
/** Volume as 0..100 inclusive. Null when the device has no volume
|
|
55054
|
-
* surface. Pair with `DeviceFeature.MediaPlayerVolume`. */
|
|
55055
|
-
volumeLevel: number().min(0).max(100).nullable().meta(readingMeta("percentage")),
|
|
55056
|
-
/** Mute toggle distinct from volume=0. Null when no mute surface.
|
|
55057
|
-
* Pair with `DeviceFeature.MediaPlayerMute`. */
|
|
55058
|
-
isMuted: boolean().nullable(),
|
|
55059
|
-
/** Active source / input. Empty when no source surface. */
|
|
55060
|
-
source: string(),
|
|
55061
|
-
/** Selectable sources. Empty when no source surface.
|
|
55062
|
-
* Pair with `DeviceFeature.MediaPlayerSelectSource`. */
|
|
55063
|
-
availableSources: array(string()),
|
|
55064
|
-
/** Currently-playing media info. Null when nothing is playing. */
|
|
55065
|
-
currentMedia: MediaInfoSchema.nullable(),
|
|
55066
|
-
/** Current playback position in ms. Null when not seekable or
|
|
55067
|
-
* nothing is playing. Pair with `DeviceFeature.MediaPlayerSeek`. */
|
|
55068
|
-
position: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
55069
|
-
/** Total duration of the current media in ms. Null when unknown
|
|
55070
|
-
* (live stream) or nothing is playing. */
|
|
55071
|
-
duration: number().int().nonnegative().nullable().meta(readingMeta("duration-ms")),
|
|
55072
|
-
/** Shuffle toggle. Null when no shuffle surface.
|
|
55073
|
-
* Pair with `DeviceFeature.MediaPlayerShuffle`. */
|
|
55074
|
-
shuffle: boolean().nullable(),
|
|
55075
|
-
/** Repeat mode. Null when no repeat surface.
|
|
55076
|
-
* Pair with `DeviceFeature.MediaPlayerRepeat`. */
|
|
55077
|
-
repeat: MediaPlayerRepeatSchema.nullable(),
|
|
55078
|
-
/** Ms epoch when the slice was last updated. */
|
|
55079
|
-
lastChangedAt: number()
|
|
55080
|
-
});
|
|
55081
|
-
DeviceType.MediaPlayer, method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
55082
|
-
kind: "mutation",
|
|
55083
|
-
auth: "protected"
|
|
55084
|
-
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
55085
|
-
kind: "mutation",
|
|
55086
|
-
auth: "protected"
|
|
55087
|
-
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
55088
|
-
kind: "mutation",
|
|
55089
|
-
auth: "protected"
|
|
55090
|
-
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
55091
|
-
kind: "mutation",
|
|
55092
|
-
auth: "protected"
|
|
55093
|
-
}), method(object({ deviceId: number().int().nonnegative() }), _void(), {
|
|
55094
|
-
kind: "mutation",
|
|
55095
|
-
auth: "protected"
|
|
55096
|
-
}), method(object({
|
|
55097
|
-
deviceId: number().int().nonnegative(),
|
|
55098
|
-
position: number().int().nonnegative()
|
|
55099
|
-
}), _void(), {
|
|
55100
|
-
kind: "mutation",
|
|
55101
|
-
auth: "protected"
|
|
55102
|
-
}), method(object({
|
|
55103
|
-
deviceId: number().int().nonnegative(),
|
|
55104
|
-
volumeLevel: number().min(0).max(100)
|
|
55105
|
-
}), _void(), {
|
|
55106
|
-
kind: "mutation",
|
|
55107
|
-
auth: "protected"
|
|
55108
|
-
}), method(object({
|
|
55109
|
-
deviceId: number().int().nonnegative(),
|
|
55110
|
-
muted: boolean()
|
|
55111
|
-
}), _void(), {
|
|
55112
|
-
kind: "mutation",
|
|
55113
|
-
auth: "protected"
|
|
55114
|
-
}), method(object({
|
|
55115
|
-
deviceId: number().int().nonnegative(),
|
|
55116
|
-
shuffle: boolean()
|
|
55117
|
-
}), _void(), {
|
|
55118
|
-
kind: "mutation",
|
|
55119
|
-
auth: "protected"
|
|
55120
|
-
}), method(object({
|
|
55121
|
-
deviceId: number().int().nonnegative(),
|
|
55122
|
-
repeat: MediaPlayerRepeatSchema
|
|
55123
|
-
}), _void(), {
|
|
55124
|
-
kind: "mutation",
|
|
55125
|
-
auth: "protected"
|
|
55126
|
-
}), method(object({
|
|
55127
|
-
deviceId: number().int().nonnegative(),
|
|
55128
|
-
source: string().min(1)
|
|
55129
|
-
}), _void(), {
|
|
55130
|
-
kind: "mutation",
|
|
55131
|
-
auth: "protected"
|
|
55132
|
-
}), method(object({
|
|
55133
|
-
deviceId: number().int().nonnegative(),
|
|
55134
|
-
/** Media identifier / URL. */
|
|
55135
|
-
mediaId: string().min(1),
|
|
55136
|
-
/** Media kind (`music`, `tvshow`, `movie`, `app`, …) — provider
|
|
55137
|
-
* passes it through to the upstream service. */
|
|
55138
|
-
mediaType: string().min(1)
|
|
55139
|
-
}), _void(), {
|
|
55140
|
-
kind: "mutation",
|
|
55141
|
-
auth: "protected"
|
|
55142
|
-
});
|
|
55143
|
-
/**
|
|
55144
55670
|
* mesh-network — collection cap for mesh-VPN providers.
|
|
55145
55671
|
*
|
|
55146
55672
|
* Different shape from `network-access` (public tunnels):
|
|
@@ -63034,7 +63560,14 @@ var NcMediaPolicySchema = object({
|
|
|
63034
63560
|
*/
|
|
63035
63561
|
profile: CamProfileSchema.optional(),
|
|
63036
63562
|
/** See {@link NcLinkedCameraModeSchema}. */
|
|
63037
|
-
linkedCameras: NcLinkedCameraModeSchema.optional()
|
|
63563
|
+
linkedCameras: NcLinkedCameraModeSchema.optional(),
|
|
63564
|
+
/**
|
|
63565
|
+
* Sensor rules only: may this rule wake a SLEEPING battery camera to take
|
|
63566
|
+
* the linked still it attaches (D998)? Absent means yes, an explicit `false`
|
|
63567
|
+
* opts out. Deliberately not a Zod default: a rule that never chose keeps
|
|
63568
|
+
* following the hub's. One bounded wake per event; nothing is attached later.
|
|
63569
|
+
*/
|
|
63570
|
+
wakeSleepingCamera: boolean().optional()
|
|
63038
63571
|
});
|
|
63039
63572
|
/**
|
|
63040
63573
|
* Cooldown GRANULARITY over the subject's class — how much a fired
|
|
@@ -63426,6 +63959,21 @@ var NcTemplateVarKindSchema = _enum([
|
|
|
63426
63959
|
"sound",
|
|
63427
63960
|
"system"
|
|
63428
63961
|
]);
|
|
63962
|
+
/**
|
|
63963
|
+
* The default title/body a rule of one SITUATION is delivered with when the
|
|
63964
|
+
* operator wrote no template — served so an editor can pre-fill it (and the
|
|
63965
|
+
* operator can rebuild it from placeholders) instead of starting from a blank
|
|
63966
|
+
* box that, once saved, silently replaces it. `id` names the situation inside
|
|
63967
|
+
* a rule `kind`: `appliance-cycle` is a `sensor` rule whose device is an
|
|
63968
|
+
* appliance finishing a cycle. Texts are raw templates (`{{var}}` intact), in
|
|
63969
|
+
* the hub's current language and with its overrides applied.
|
|
63970
|
+
*/
|
|
63971
|
+
var NcTemplateDefaultSchema = object({
|
|
63972
|
+
id: _enum(["appliance-cycle"]),
|
|
63973
|
+
kind: NcRuleKindSchema,
|
|
63974
|
+
title: string(),
|
|
63975
|
+
body: string()
|
|
63976
|
+
});
|
|
63429
63977
|
/** Which producer renders a template: an ordinary rule, a timelapse, a digest. */
|
|
63430
63978
|
var NcTemplateFamilySchema = _enum([
|
|
63431
63979
|
"rule",
|
|
@@ -64281,7 +64829,11 @@ method(object({}), object({ rules: array(NcRuleSchema) }), { auth: "admin" }), m
|
|
|
64281
64829
|
}), method(object({}), object({
|
|
64282
64830
|
catalog: array(NcConditionDescriptorSchema),
|
|
64283
64831
|
taxonomy: NcTaxonomySchema.optional()
|
|
64284
|
-
})), method(object({}), object({
|
|
64832
|
+
})), method(object({}), object({
|
|
64833
|
+
vars: array(NcTemplateVarDescriptorSchema),
|
|
64834
|
+
/** Per-situation default texts; absent on a hub that predates them. */
|
|
64835
|
+
defaults: array(NcTemplateDefaultSchema)
|
|
64836
|
+
})), method(NcTemplatePreviewInputSchema, NcTemplatePreviewSchema, {
|
|
64285
64837
|
kind: "mutation",
|
|
64286
64838
|
access: "view"
|
|
64287
64839
|
}), method(object({ filter: NcHistoryFilterSchema.default({ limit: 100 }) }), object({ entries: array(NcHistoryEntrySchema) }), { auth: "admin" }), method(object({}), NcRuleLastRunsSchema, { auth: "admin" }), method(object({ artifactId: string().min(1) }), object({ url: string().nullable() }), { auth: "admin" }), method(object({}), object({ snoozes: array(NcSnoozeSchema) }), { caller: "required" }), method(object({ snooze: NcSnoozeInputSchema }), object({ snooze: NcSnoozeSchema }), {
|
|
@@ -65045,52 +65597,27 @@ object({
|
|
|
65045
65597
|
empty: boolean().nullable(),
|
|
65046
65598
|
/** True while the pump is running. Null while unknown. */
|
|
65047
65599
|
pumpRunning: boolean().nullable(),
|
|
65048
|
-
/** True when the pump works on an on/off duty cycle rather than continuously. */
|
|
65049
|
-
pumpIntervalEnabled: boolean().nullable(),
|
|
65050
|
-
/** How long the pump runs per cycle, in seconds. */
|
|
65051
|
-
pumpOnTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
65052
|
-
/** How long the pump rests per cycle, in seconds. */
|
|
65053
|
-
pumpOffTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
65054
65600
|
/** Water drunk in the last drink, in litres. */
|
|
65055
65601
|
lastDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
65056
65602
|
/** Water drunk in the current hour, in litres. */
|
|
65057
65603
|
currentHourDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
65058
65604
|
/** Water drunk over the last 24 hours (rolling), in litres. */
|
|
65059
65605
|
last24hDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
65060
|
-
/** Water drunk since local midnight, in litres. */
|
|
65606
|
+
/** Water drunk since local midnight, in litres. Null when the fountain has no such sensor. */
|
|
65061
65607
|
todayDrink: number().min(0).nullable().meta(readingMeta("volume")),
|
|
65062
65608
|
/** Decoded fault message. Null means healthy; a non-null string is an active fault. */
|
|
65063
65609
|
error: string().nullable(),
|
|
65064
65610
|
/** Ms epoch when the slice was last refreshed. */
|
|
65065
65611
|
lastFetchedAt: number()
|
|
65066
65612
|
});
|
|
65067
|
-
var DeviceIdSchema = number().int().nonnegative();
|
|
65068
|
-
var MinutesSchema = number().int().min(0);
|
|
65613
|
+
var DeviceIdSchema$1 = number().int().nonnegative();
|
|
65069
65614
|
DeviceType.PetFountain, method(object({
|
|
65070
|
-
deviceId: DeviceIdSchema,
|
|
65071
|
-
on: boolean()
|
|
65072
|
-
}), _void(), {
|
|
65073
|
-
kind: "mutation",
|
|
65074
|
-
auth: "protected"
|
|
65075
|
-
}), method(object({
|
|
65076
|
-
deviceId: DeviceIdSchema,
|
|
65615
|
+
deviceId: DeviceIdSchema$1,
|
|
65077
65616
|
on: boolean()
|
|
65078
65617
|
}), _void(), {
|
|
65079
65618
|
kind: "mutation",
|
|
65080
65619
|
auth: "protected"
|
|
65081
|
-
}), method(object({
|
|
65082
|
-
deviceId: DeviceIdSchema,
|
|
65083
|
-
minutes: MinutesSchema
|
|
65084
|
-
}), _void(), {
|
|
65085
|
-
kind: "mutation",
|
|
65086
|
-
auth: "protected"
|
|
65087
|
-
}), method(object({
|
|
65088
|
-
deviceId: DeviceIdSchema,
|
|
65089
|
-
minutes: MinutesSchema
|
|
65090
|
-
}), _void(), {
|
|
65091
|
-
kind: "mutation",
|
|
65092
|
-
auth: "protected"
|
|
65093
|
-
}), method(object({ deviceId: DeviceIdSchema }), _void(), {
|
|
65620
|
+
}), method(object({ deviceId: DeviceIdSchema$1 }), _void(), {
|
|
65094
65621
|
kind: "mutation",
|
|
65095
65622
|
auth: "protected"
|
|
65096
65623
|
});
|
|
@@ -66624,6 +67151,49 @@ object({
|
|
|
66624
67151
|
DeviceType.PetFeeder,
|
|
66625
67152
|
DeviceType.Heater
|
|
66626
67153
|
].filter((type) => type !== DeviceType.Sensor);
|
|
67154
|
+
var PowerSourceRefusalReasonSchema = _enum([
|
|
67155
|
+
"no-power-source",
|
|
67156
|
+
"switch-missing",
|
|
67157
|
+
"switch-offline",
|
|
67158
|
+
"switch-unknown",
|
|
67159
|
+
"restart-in-progress",
|
|
67160
|
+
"switch-call-failed"
|
|
67161
|
+
]);
|
|
67162
|
+
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
67163
|
+
accepted: literal(false),
|
|
67164
|
+
reason: PowerSourceRefusalReasonSchema,
|
|
67165
|
+
/** One line for the operator, naming the switch. */
|
|
67166
|
+
message: string()
|
|
67167
|
+
})]);
|
|
67168
|
+
var PowerSourceInfoSchema = object({
|
|
67169
|
+
/** False when the device has no power source linked; the rest is then empty. */
|
|
67170
|
+
linked: boolean(),
|
|
67171
|
+
switchDeviceId: number().nullable(),
|
|
67172
|
+
switchName: string().nullable(),
|
|
67173
|
+
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
67174
|
+
switchOn: boolean().nullable(),
|
|
67175
|
+
switchOnline: boolean().nullable(),
|
|
67176
|
+
restartInProgress: boolean(),
|
|
67177
|
+
offSeconds: number().int()
|
|
67178
|
+
});
|
|
67179
|
+
object({
|
|
67180
|
+
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
67181
|
+
switchOn: boolean().nullable(),
|
|
67182
|
+
offSeconds: number().int(),
|
|
67183
|
+
lastFetchedAt: number()
|
|
67184
|
+
});
|
|
67185
|
+
DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
|
|
67186
|
+
var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
|
|
67187
|
+
systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
67188
|
+
kind: "mutation",
|
|
67189
|
+
auth: "admin"
|
|
67190
|
+
}), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
67191
|
+
kind: "mutation",
|
|
67192
|
+
auth: "admin"
|
|
67193
|
+
}), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
67194
|
+
kind: "mutation",
|
|
67195
|
+
auth: "admin"
|
|
67196
|
+
});
|
|
66627
67197
|
/**
|
|
66628
67198
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
66629
67199
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -67050,6 +67620,37 @@ DeviceType.Camera, method(object({ deviceId: number() }), PtzAutotrackStatusSche
|
|
|
67050
67620
|
deviceId: number(),
|
|
67051
67621
|
status: PtzAutotrackStatusSchema
|
|
67052
67622
|
});
|
|
67623
|
+
object({
|
|
67624
|
+
/** True when the pump works on the on/off cycle, false when it runs continuously. Null while unknown. */
|
|
67625
|
+
enabled: boolean().nullable(),
|
|
67626
|
+
/** How long the pump runs per cycle, in seconds. Null while unknown. */
|
|
67627
|
+
onTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
67628
|
+
/** How long the pump rests per cycle, in seconds. Null while unknown. */
|
|
67629
|
+
offTime: number().min(0).nullable().meta(readingMeta("duration")),
|
|
67630
|
+
/** Ms epoch when the slice was last refreshed. */
|
|
67631
|
+
lastFetchedAt: number()
|
|
67632
|
+
});
|
|
67633
|
+
var DeviceIdSchema = number().int().nonnegative();
|
|
67634
|
+
var MinutesSchema = number().int().min(0);
|
|
67635
|
+
DeviceType.PetFountain, method(object({
|
|
67636
|
+
deviceId: DeviceIdSchema,
|
|
67637
|
+
on: boolean()
|
|
67638
|
+
}), _void(), {
|
|
67639
|
+
kind: "mutation",
|
|
67640
|
+
auth: "protected"
|
|
67641
|
+
}), method(object({
|
|
67642
|
+
deviceId: DeviceIdSchema,
|
|
67643
|
+
minutes: MinutesSchema
|
|
67644
|
+
}), _void(), {
|
|
67645
|
+
kind: "mutation",
|
|
67646
|
+
auth: "protected"
|
|
67647
|
+
}), method(object({
|
|
67648
|
+
deviceId: DeviceIdSchema,
|
|
67649
|
+
minutes: MinutesSchema
|
|
67650
|
+
}), _void(), {
|
|
67651
|
+
kind: "mutation",
|
|
67652
|
+
auth: "protected"
|
|
67653
|
+
});
|
|
67053
67654
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, DeviceType.Gateway, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
67054
67655
|
kind: "mutation",
|
|
67055
67656
|
auth: "admin"
|
|
@@ -69763,7 +70364,13 @@ var RemoteMediaCommandSchema = _enum([
|
|
|
69763
70364
|
"next",
|
|
69764
70365
|
"previous",
|
|
69765
70366
|
"setMute",
|
|
69766
|
-
"selectSource"
|
|
70367
|
+
"selectSource",
|
|
70368
|
+
"turnOn",
|
|
70369
|
+
"turnOff",
|
|
70370
|
+
"volumeUp",
|
|
70371
|
+
"volumeDown",
|
|
70372
|
+
"channelUp",
|
|
70373
|
+
"channelDown"
|
|
69767
70374
|
]);
|
|
69768
70375
|
/** A send result, or `not-routed`: the role is not bound, so the native cap answers. */
|
|
69769
70376
|
var RemoteMediaCommandResultSchema = discriminatedUnion("status", [...RemoteSendResultSchema.options, object({ status: literal("not-routed") })]);
|
|
@@ -69784,7 +70391,7 @@ method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.e
|
|
|
69784
70391
|
}), RemoteSendResultSchema, {
|
|
69785
70392
|
kind: "mutation",
|
|
69786
70393
|
auth: "protected"
|
|
69787
|
-
}), method(deviceInput.extend({
|
|
70394
|
+
}), method(deviceInput, MediaPlayerStatusSchema.nullable(), { auth: "protected" }), method(deviceInput.extend({
|
|
69788
70395
|
command: RemoteMediaCommandSchema,
|
|
69789
70396
|
muted: boolean().optional(),
|
|
69790
70397
|
source: string().optional(),
|
|
@@ -70718,7 +71325,16 @@ DeviceType.Sensor;
|
|
|
70718
71325
|
* future fields without breaking the existing call sites.
|
|
70719
71326
|
*/
|
|
70720
71327
|
var EmailAddressSchema = email();
|
|
71328
|
+
/**
|
|
71329
|
+
* Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
|
|
71330
|
+
* relay, so a caller written before relays existed keeps working unchanged. A provider with one
|
|
71331
|
+
* fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
|
|
71332
|
+
* collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
|
|
71333
|
+
*/
|
|
71334
|
+
var InstanceIdSchema = string().min(1).optional();
|
|
71335
|
+
var RelayPinSchema = object({ instanceId: InstanceIdSchema });
|
|
70721
71336
|
var SendEmailInputSchema = object({
|
|
71337
|
+
instanceId: InstanceIdSchema,
|
|
70722
71338
|
to: union([EmailAddressSchema, array(EmailAddressSchema).min(1)]),
|
|
70723
71339
|
cc: array(EmailAddressSchema).optional(),
|
|
70724
71340
|
bcc: array(EmailAddressSchema).optional(),
|
|
@@ -70754,11 +71370,11 @@ method(SendEmailInputSchema, SendEmailResultSchema, {
|
|
|
70754
71370
|
kind: "mutation",
|
|
70755
71371
|
auth: "admin",
|
|
70756
71372
|
access: "create"
|
|
70757
|
-
}), method(
|
|
71373
|
+
}), method(RelayPinSchema, SmtpStatusSchema, {
|
|
70758
71374
|
kind: "mutation",
|
|
70759
71375
|
auth: "admin",
|
|
70760
71376
|
access: "view"
|
|
70761
|
-
}), method(
|
|
71377
|
+
}), method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" });
|
|
70762
71378
|
/**
|
|
70763
71379
|
* A single device snapshot returned as base64 JPEG/PNG.
|
|
70764
71380
|
*
|
|
@@ -70790,10 +71406,12 @@ DeviceType.Camera, method(object({
|
|
|
70790
71406
|
* even when the cache is well within the device's
|
|
70791
71407
|
* `snapshotMaxAgeS` window.
|
|
70792
71408
|
*
|
|
70793
|
-
* **`force` is
|
|
71409
|
+
* **`force` is a demand with a named principal, not a freshness
|
|
71410
|
+
* preference** — an operator button, the scheduled refresh (D847), or a
|
|
71411
|
+
* notification rule that left the camera's wake allowed (D998). On a
|
|
70794
71412
|
* battery camera it is the one thing that walks past the wrapper's
|
|
70795
|
-
* sleep gate and wakes the camera, so a
|
|
70796
|
-
*
|
|
71413
|
+
* sleep gate and wakes the camera, so a poller, a thumbnail or a
|
|
71414
|
+
* prestream must NEVER set it. Every such caller
|
|
70797
71415
|
* gets the cached frame, which on a sleeping battery camera is the
|
|
70798
71416
|
* correct answer: stale but honest beats woken.
|
|
70799
71417
|
*/
|
|
@@ -71608,7 +72226,11 @@ Object.values(DeviceType), method(_void(), array(StreamSignalSchema).readonly())
|
|
|
71608
72226
|
* `getSettingsUISchema()` surface.
|
|
71609
72227
|
*/
|
|
71610
72228
|
var SwitchStatusSchema = object({
|
|
71611
|
-
|
|
72229
|
+
/**
|
|
72230
|
+
* `null` = the device has never reported its state (a measurement that
|
|
72231
|
+
* has not happened is unknown, never `false`).
|
|
72232
|
+
*/
|
|
72233
|
+
on: boolean().nullable().meta({ label: "On" }),
|
|
71612
72234
|
/** Ms epoch of the last state change. Useful for UI "X minutes ago". */
|
|
71613
72235
|
lastChangedAt: number()
|
|
71614
72236
|
});
|
|
@@ -71620,7 +72242,7 @@ DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceTyp
|
|
|
71620
72242
|
auth: "protected"
|
|
71621
72243
|
}), object({
|
|
71622
72244
|
deviceId: number(),
|
|
71623
|
-
on: boolean(),
|
|
72245
|
+
on: boolean().nullable(),
|
|
71624
72246
|
lastChangedAt: number()
|
|
71625
72247
|
});
|
|
71626
72248
|
/** C0 controls, DEL and the C1 range: none of them belongs in a name. */
|
|
@@ -74632,6 +75254,26 @@ function buildDescriptor(capName, kind) {
|
|
|
74632
75254
|
* contributes one entry per bound cap present in this map.
|
|
74633
75255
|
*/
|
|
74634
75256
|
var EVENT_KIND_BY_CAP = Object.freeze(Object.fromEntries(Object.entries(CAP_TO_KIND).map(([capName, kind]) => [capName, buildDescriptor(capName, kind)])));
|
|
75257
|
+
/**
|
|
75258
|
+
* What a remote key is CALLED and what it LOOKS like, for every role (D963),
|
|
75259
|
+
* shared by the admin UI and the viewer. A role is data on the wire; each
|
|
75260
|
+
* client resolves its name from `label` (English and Italian side by side) and
|
|
75261
|
+
* its glyph from `icon`, a lucide id from the shared icon catalogue — the
|
|
75262
|
+
* server sends an id, a client maps it to its own icon set.
|
|
75263
|
+
*
|
|
75264
|
+
* `legend` is text printed on the key INSTEAD of a glyph (a digit has no
|
|
75265
|
+
* pictogram): a client that can draw text shows it, one that cannot falls back
|
|
75266
|
+
* to `icon`.
|
|
75267
|
+
*/
|
|
75268
|
+
function digit(n) {
|
|
75269
|
+
return {
|
|
75270
|
+
label: t(n, n),
|
|
75271
|
+
icon: "hash",
|
|
75272
|
+
legend: n
|
|
75273
|
+
};
|
|
75274
|
+
}
|
|
75275
|
+
digit("0"), digit("1"), digit("2"), digit("3"), digit("4"), digit("5"), digit("6"), digit("7"), digit("8"), digit("9");
|
|
75276
|
+
DeviceFeature.MediaPlayerPower, DeviceFeature.MediaPlayerVolumeStep, DeviceFeature.MediaPlayerChannelStep, DeviceFeature.MediaPlayerMute, DeviceFeature.MediaPlayerStop, DeviceFeature.MediaPlayerNext, DeviceFeature.MediaPlayerPrevious;
|
|
74635
75277
|
var btn = (idSuffix, row, col, init) => ({
|
|
74636
75278
|
idSuffix,
|
|
74637
75279
|
row,
|
|
@@ -74758,7 +75400,35 @@ discriminatedUnion("kind", [object({
|
|
|
74758
75400
|
kind: literal("pronto"),
|
|
74759
75401
|
code: string()
|
|
74760
75402
|
})]);
|
|
74761
|
-
|
|
75403
|
+
/**
|
|
75404
|
+
* Propose a running threshold from a device's own power history (planning#405).
|
|
75405
|
+
*
|
|
75406
|
+
* Pure and deterministic: the same series gives the same answer. The series is
|
|
75407
|
+
* a HELD-VALUE step series — a point's value stands until the next point — which
|
|
75408
|
+
* is how device-history stores a gauge, so "time at a level" is exact, not a
|
|
75409
|
+
* count of samples.
|
|
75410
|
+
*
|
|
75411
|
+
* 1. idle floor F = time-weighted median; noise ceiling N = highest value seen
|
|
75412
|
+
* near F. A device that is not near one level most of the time has no floor.
|
|
75413
|
+
* 2. coarse activity = above max(2N, N + 5 W); consecutive stretches are episodes.
|
|
75414
|
+
* 3. gaps between episodes split in two by the largest log-scale jump (>= 3x):
|
|
75415
|
+
* the short ones are pauses INSIDE a run (a soak), the long ones separate runs.
|
|
75416
|
+
* 4. T = geometric mean of N and the plateau's 10th percentile, snapped to a
|
|
75417
|
+
* grid a person would type; stop dwell covers the longest pause; start dwell
|
|
75418
|
+
* covers the longest standby blip above T.
|
|
75419
|
+
* 5. the numbers are proved by REPLAY through the real `dwell` evaluation: each
|
|
75420
|
+
* run must hold exactly one true interval and nothing may flap outside.
|
|
75421
|
+
*/
|
|
75422
|
+
var SECOND_MS = 1e3;
|
|
75423
|
+
var MINUTE_MS$1 = 60 * SECOND_MS;
|
|
75424
|
+
24 * (60 * MINUTE_MS$1);
|
|
75425
|
+
10 * MINUTE_MS$1;
|
|
75426
|
+
30 * SECOND_MS;
|
|
75427
|
+
60 * SECOND_MS;
|
|
75428
|
+
20 * MINUTE_MS$1;
|
|
75429
|
+
10 * SECOND_MS;
|
|
75430
|
+
10 * SECOND_MS;
|
|
75431
|
+
DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
|
|
74762
75432
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
74763
75433
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
74764
75434
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
@@ -75739,6 +76409,27 @@ Object.freeze({
|
|
|
75739
76409
|
access: "view",
|
|
75740
76410
|
role: "viewer"
|
|
75741
76411
|
},
|
|
76412
|
+
"boardKeySource.getBoardKey": {
|
|
76413
|
+
capName: "board-key-source",
|
|
76414
|
+
capScope: "system",
|
|
76415
|
+
addonId: null,
|
|
76416
|
+
access: "view",
|
|
76417
|
+
role: "admin"
|
|
76418
|
+
},
|
|
76419
|
+
"boardKeySource.listBoards": {
|
|
76420
|
+
capName: "board-key-source",
|
|
76421
|
+
capScope: "system",
|
|
76422
|
+
addonId: null,
|
|
76423
|
+
access: "view",
|
|
76424
|
+
role: "admin"
|
|
76425
|
+
},
|
|
76426
|
+
"boardKeySource.listSources": {
|
|
76427
|
+
capName: "board-key-source",
|
|
76428
|
+
capScope: "system",
|
|
76429
|
+
addonId: null,
|
|
76430
|
+
access: "view",
|
|
76431
|
+
role: "admin"
|
|
76432
|
+
},
|
|
75742
76433
|
"brightness.getStatus": {
|
|
75743
76434
|
capName: "brightness",
|
|
75744
76435
|
capScope: "device",
|
|
@@ -76278,6 +76969,13 @@ Object.freeze({
|
|
|
76278
76969
|
access: "create",
|
|
76279
76970
|
role: "admin"
|
|
76280
76971
|
},
|
|
76972
|
+
"coreBlocks.proposeRunningThreshold": {
|
|
76973
|
+
capName: "core-blocks",
|
|
76974
|
+
capScope: "system",
|
|
76975
|
+
addonId: null,
|
|
76976
|
+
access: "view",
|
|
76977
|
+
role: "admin"
|
|
76978
|
+
},
|
|
76281
76979
|
"coreBlocks.reportAutomationRun": {
|
|
76282
76980
|
capName: "core-blocks",
|
|
76283
76981
|
capScope: "system",
|
|
@@ -76789,6 +77487,13 @@ Object.freeze({
|
|
|
76789
77487
|
access: "view",
|
|
76790
77488
|
role: "admin"
|
|
76791
77489
|
},
|
|
77490
|
+
"deviceExport.listInstances": {
|
|
77491
|
+
capName: "device-export",
|
|
77492
|
+
capScope: "system",
|
|
77493
|
+
addonId: null,
|
|
77494
|
+
access: "view",
|
|
77495
|
+
role: "admin"
|
|
77496
|
+
},
|
|
76792
77497
|
"deviceExport.listSupportedDeviceKinds": {
|
|
76793
77498
|
capName: "device-export",
|
|
76794
77499
|
capScope: "system",
|
|
@@ -78378,6 +79083,69 @@ Object.freeze({
|
|
|
78378
79083
|
access: "create",
|
|
78379
79084
|
role: "admin"
|
|
78380
79085
|
},
|
|
79086
|
+
"integrationInstances.createInstance": {
|
|
79087
|
+
capName: "integration-instances",
|
|
79088
|
+
capScope: "system",
|
|
79089
|
+
addonId: null,
|
|
79090
|
+
access: "create",
|
|
79091
|
+
role: "admin"
|
|
79092
|
+
},
|
|
79093
|
+
"integrationInstances.deleteInstance": {
|
|
79094
|
+
capName: "integration-instances",
|
|
79095
|
+
capScope: "system",
|
|
79096
|
+
addonId: null,
|
|
79097
|
+
access: "delete",
|
|
79098
|
+
role: "admin"
|
|
79099
|
+
},
|
|
79100
|
+
"integrationInstances.describe": {
|
|
79101
|
+
capName: "integration-instances",
|
|
79102
|
+
capScope: "system",
|
|
79103
|
+
addonId: null,
|
|
79104
|
+
access: "view",
|
|
79105
|
+
role: "admin"
|
|
79106
|
+
},
|
|
79107
|
+
"integrationInstances.getInstance": {
|
|
79108
|
+
capName: "integration-instances",
|
|
79109
|
+
capScope: "system",
|
|
79110
|
+
addonId: null,
|
|
79111
|
+
access: "view",
|
|
79112
|
+
role: "admin"
|
|
79113
|
+
},
|
|
79114
|
+
"integrationInstances.instanceFormSchema": {
|
|
79115
|
+
capName: "integration-instances",
|
|
79116
|
+
capScope: "system",
|
|
79117
|
+
addonId: null,
|
|
79118
|
+
access: "view",
|
|
79119
|
+
role: "admin"
|
|
79120
|
+
},
|
|
79121
|
+
"integrationInstances.listInstances": {
|
|
79122
|
+
capName: "integration-instances",
|
|
79123
|
+
capScope: "system",
|
|
79124
|
+
addonId: null,
|
|
79125
|
+
access: "view",
|
|
79126
|
+
role: "admin"
|
|
79127
|
+
},
|
|
79128
|
+
"integrationInstances.setInstanceEnabled": {
|
|
79129
|
+
capName: "integration-instances",
|
|
79130
|
+
capScope: "system",
|
|
79131
|
+
addonId: null,
|
|
79132
|
+
access: "create",
|
|
79133
|
+
role: "admin"
|
|
79134
|
+
},
|
|
79135
|
+
"integrationInstances.testInstance": {
|
|
79136
|
+
capName: "integration-instances",
|
|
79137
|
+
capScope: "system",
|
|
79138
|
+
addonId: null,
|
|
79139
|
+
access: "create",
|
|
79140
|
+
role: "admin"
|
|
79141
|
+
},
|
|
79142
|
+
"integrationInstances.updateInstance": {
|
|
79143
|
+
capName: "integration-instances",
|
|
79144
|
+
capScope: "system",
|
|
79145
|
+
addonId: null,
|
|
79146
|
+
access: "create",
|
|
79147
|
+
role: "admin"
|
|
79148
|
+
},
|
|
78381
79149
|
"integrations.create": {
|
|
78382
79150
|
capName: "integrations",
|
|
78383
79151
|
capScope: "system",
|
|
@@ -79162,6 +79930,20 @@ Object.freeze({
|
|
|
79162
79930
|
access: "view",
|
|
79163
79931
|
role: "admin"
|
|
79164
79932
|
},
|
|
79933
|
+
"mediaPlayer.channelDown": {
|
|
79934
|
+
capName: "media-player",
|
|
79935
|
+
capScope: "device",
|
|
79936
|
+
addonId: null,
|
|
79937
|
+
access: "create",
|
|
79938
|
+
role: "viewer"
|
|
79939
|
+
},
|
|
79940
|
+
"mediaPlayer.channelUp": {
|
|
79941
|
+
capName: "media-player",
|
|
79942
|
+
capScope: "device",
|
|
79943
|
+
addonId: null,
|
|
79944
|
+
access: "create",
|
|
79945
|
+
role: "viewer"
|
|
79946
|
+
},
|
|
79165
79947
|
"mediaPlayer.getStatus": {
|
|
79166
79948
|
capName: "media-player",
|
|
79167
79949
|
capScope: "device",
|
|
@@ -79253,6 +80035,34 @@ Object.freeze({
|
|
|
79253
80035
|
access: "create",
|
|
79254
80036
|
role: "viewer"
|
|
79255
80037
|
},
|
|
80038
|
+
"mediaPlayer.turnOff": {
|
|
80039
|
+
capName: "media-player",
|
|
80040
|
+
capScope: "device",
|
|
80041
|
+
addonId: null,
|
|
80042
|
+
access: "create",
|
|
80043
|
+
role: "viewer"
|
|
80044
|
+
},
|
|
80045
|
+
"mediaPlayer.turnOn": {
|
|
80046
|
+
capName: "media-player",
|
|
80047
|
+
capScope: "device",
|
|
80048
|
+
addonId: null,
|
|
80049
|
+
access: "create",
|
|
80050
|
+
role: "viewer"
|
|
80051
|
+
},
|
|
80052
|
+
"mediaPlayer.volumeDown": {
|
|
80053
|
+
capName: "media-player",
|
|
80054
|
+
capScope: "device",
|
|
80055
|
+
addonId: null,
|
|
80056
|
+
access: "create",
|
|
80057
|
+
role: "viewer"
|
|
80058
|
+
},
|
|
80059
|
+
"mediaPlayer.volumeUp": {
|
|
80060
|
+
capName: "media-player",
|
|
80061
|
+
capScope: "device",
|
|
80062
|
+
addonId: null,
|
|
80063
|
+
access: "create",
|
|
80064
|
+
role: "viewer"
|
|
80065
|
+
},
|
|
79256
80066
|
"meshNetwork.getStatus": {
|
|
79257
80067
|
capName: "mesh-network",
|
|
79258
80068
|
capScope: "system",
|
|
@@ -80499,27 +81309,6 @@ Object.freeze({
|
|
|
80499
81309
|
access: "create",
|
|
80500
81310
|
role: "viewer"
|
|
80501
81311
|
},
|
|
80502
|
-
"petFountain.setPumpInterval": {
|
|
80503
|
-
capName: "pet-fountain",
|
|
80504
|
-
capScope: "device",
|
|
80505
|
-
addonId: null,
|
|
80506
|
-
access: "create",
|
|
80507
|
-
role: "viewer"
|
|
80508
|
-
},
|
|
80509
|
-
"petFountain.setPumpOffMinutes": {
|
|
80510
|
-
capName: "pet-fountain",
|
|
80511
|
-
capScope: "device",
|
|
80512
|
-
addonId: null,
|
|
80513
|
-
access: "create",
|
|
80514
|
-
role: "viewer"
|
|
80515
|
-
},
|
|
80516
|
-
"petFountain.setPumpOnMinutes": {
|
|
80517
|
-
capName: "pet-fountain",
|
|
80518
|
-
capScope: "device",
|
|
80519
|
-
addonId: null,
|
|
80520
|
-
access: "create",
|
|
80521
|
-
role: "viewer"
|
|
80522
|
-
},
|
|
80523
81312
|
"pipelineAnalytics.addRetrainFrameFromRecording": {
|
|
80524
81313
|
capName: "pipeline-analytics",
|
|
80525
81314
|
capScope: "device",
|
|
@@ -82298,6 +83087,34 @@ Object.freeze({
|
|
|
82298
83087
|
access: "create",
|
|
82299
83088
|
role: "admin"
|
|
82300
83089
|
},
|
|
83090
|
+
"pumpCycle.getStatus": {
|
|
83091
|
+
capName: "pump-cycle",
|
|
83092
|
+
capScope: "device",
|
|
83093
|
+
addonId: null,
|
|
83094
|
+
access: "view",
|
|
83095
|
+
role: "viewer"
|
|
83096
|
+
},
|
|
83097
|
+
"pumpCycle.setEnabled": {
|
|
83098
|
+
capName: "pump-cycle",
|
|
83099
|
+
capScope: "device",
|
|
83100
|
+
addonId: null,
|
|
83101
|
+
access: "create",
|
|
83102
|
+
role: "viewer"
|
|
83103
|
+
},
|
|
83104
|
+
"pumpCycle.setOffMinutes": {
|
|
83105
|
+
capName: "pump-cycle",
|
|
83106
|
+
capScope: "device",
|
|
83107
|
+
addonId: null,
|
|
83108
|
+
access: "create",
|
|
83109
|
+
role: "viewer"
|
|
83110
|
+
},
|
|
83111
|
+
"pumpCycle.setOnMinutes": {
|
|
83112
|
+
capName: "pump-cycle",
|
|
83113
|
+
capScope: "device",
|
|
83114
|
+
addonId: null,
|
|
83115
|
+
access: "create",
|
|
83116
|
+
role: "viewer"
|
|
83117
|
+
},
|
|
82301
83118
|
"reboot.reboot": {
|
|
82302
83119
|
capName: "reboot",
|
|
82303
83120
|
capScope: "device",
|
|
@@ -82802,6 +83619,13 @@ Object.freeze({
|
|
|
82802
83619
|
access: "create",
|
|
82803
83620
|
role: "admin"
|
|
82804
83621
|
},
|
|
83622
|
+
"remote.getAssumedStatus": {
|
|
83623
|
+
capName: "remote",
|
|
83624
|
+
capScope: "system",
|
|
83625
|
+
addonId: null,
|
|
83626
|
+
access: "view",
|
|
83627
|
+
role: "admin"
|
|
83628
|
+
},
|
|
82805
83629
|
"remote.getConfig": {
|
|
82806
83630
|
capName: "remote",
|
|
82807
83631
|
capScope: "system",
|
|
@@ -85642,6 +86466,11 @@ Object.freeze({
|
|
|
85642
86466
|
form: "single",
|
|
85643
86467
|
optional: false
|
|
85644
86468
|
}],
|
|
86469
|
+
"coreBlocks.proposeRunningThreshold": [{
|
|
86470
|
+
name: "deviceId",
|
|
86471
|
+
form: "single",
|
|
86472
|
+
optional: false
|
|
86473
|
+
}],
|
|
85645
86474
|
"cover.close": [{
|
|
85646
86475
|
name: "deviceId",
|
|
85647
86476
|
form: "single",
|
|
@@ -86493,6 +87322,16 @@ Object.freeze({
|
|
|
86493
87322
|
form: "single",
|
|
86494
87323
|
optional: true
|
|
86495
87324
|
}],
|
|
87325
|
+
"mediaPlayer.channelDown": [{
|
|
87326
|
+
name: "deviceId",
|
|
87327
|
+
form: "single",
|
|
87328
|
+
optional: false
|
|
87329
|
+
}],
|
|
87330
|
+
"mediaPlayer.channelUp": [{
|
|
87331
|
+
name: "deviceId",
|
|
87332
|
+
form: "single",
|
|
87333
|
+
optional: false
|
|
87334
|
+
}],
|
|
86496
87335
|
"mediaPlayer.getStatus": [{
|
|
86497
87336
|
name: "deviceId",
|
|
86498
87337
|
form: "single",
|
|
@@ -86558,6 +87397,26 @@ Object.freeze({
|
|
|
86558
87397
|
form: "single",
|
|
86559
87398
|
optional: false
|
|
86560
87399
|
}],
|
|
87400
|
+
"mediaPlayer.turnOff": [{
|
|
87401
|
+
name: "deviceId",
|
|
87402
|
+
form: "single",
|
|
87403
|
+
optional: false
|
|
87404
|
+
}],
|
|
87405
|
+
"mediaPlayer.turnOn": [{
|
|
87406
|
+
name: "deviceId",
|
|
87407
|
+
form: "single",
|
|
87408
|
+
optional: false
|
|
87409
|
+
}],
|
|
87410
|
+
"mediaPlayer.volumeDown": [{
|
|
87411
|
+
name: "deviceId",
|
|
87412
|
+
form: "single",
|
|
87413
|
+
optional: false
|
|
87414
|
+
}],
|
|
87415
|
+
"mediaPlayer.volumeUp": [{
|
|
87416
|
+
name: "deviceId",
|
|
87417
|
+
form: "single",
|
|
87418
|
+
optional: false
|
|
87419
|
+
}],
|
|
86561
87420
|
"meter.getStatus": [{
|
|
86562
87421
|
name: "deviceId",
|
|
86563
87422
|
form: "single",
|
|
@@ -86867,21 +87726,6 @@ Object.freeze({
|
|
|
86867
87726
|
form: "single",
|
|
86868
87727
|
optional: false
|
|
86869
87728
|
}],
|
|
86870
|
-
"petFountain.setPumpInterval": [{
|
|
86871
|
-
name: "deviceId",
|
|
86872
|
-
form: "single",
|
|
86873
|
-
optional: false
|
|
86874
|
-
}],
|
|
86875
|
-
"petFountain.setPumpOffMinutes": [{
|
|
86876
|
-
name: "deviceId",
|
|
86877
|
-
form: "single",
|
|
86878
|
-
optional: false
|
|
86879
|
-
}],
|
|
86880
|
-
"petFountain.setPumpOnMinutes": [{
|
|
86881
|
-
name: "deviceId",
|
|
86882
|
-
form: "single",
|
|
86883
|
-
optional: false
|
|
86884
|
-
}],
|
|
86885
87729
|
"pipelineAnalytics.addRetrainFrameFromRecording": [{
|
|
86886
87730
|
name: "deviceId",
|
|
86887
87731
|
form: "single",
|
|
@@ -87517,6 +88361,26 @@ Object.freeze({
|
|
|
87517
88361
|
form: "single",
|
|
87518
88362
|
optional: false
|
|
87519
88363
|
}],
|
|
88364
|
+
"pumpCycle.getStatus": [{
|
|
88365
|
+
name: "deviceId",
|
|
88366
|
+
form: "single",
|
|
88367
|
+
optional: false
|
|
88368
|
+
}],
|
|
88369
|
+
"pumpCycle.setEnabled": [{
|
|
88370
|
+
name: "deviceId",
|
|
88371
|
+
form: "single",
|
|
88372
|
+
optional: false
|
|
88373
|
+
}],
|
|
88374
|
+
"pumpCycle.setOffMinutes": [{
|
|
88375
|
+
name: "deviceId",
|
|
88376
|
+
form: "single",
|
|
88377
|
+
optional: false
|
|
88378
|
+
}],
|
|
88379
|
+
"pumpCycle.setOnMinutes": [{
|
|
88380
|
+
name: "deviceId",
|
|
88381
|
+
form: "single",
|
|
88382
|
+
optional: false
|
|
88383
|
+
}],
|
|
87520
88384
|
"reboot.reboot": [{
|
|
87521
88385
|
name: "deviceId",
|
|
87522
88386
|
form: "single",
|
|
@@ -87718,6 +88582,11 @@ Object.freeze({
|
|
|
87718
88582
|
form: "single",
|
|
87719
88583
|
optional: true
|
|
87720
88584
|
}],
|
|
88585
|
+
"remote.getAssumedStatus": [{
|
|
88586
|
+
name: "deviceId",
|
|
88587
|
+
form: "single",
|
|
88588
|
+
optional: false
|
|
88589
|
+
}],
|
|
87721
88590
|
"remote.getConfig": [{
|
|
87722
88591
|
name: "deviceId",
|
|
87723
88592
|
form: "single",
|
|
@@ -88265,99 +89134,6 @@ Object.freeze({
|
|
|
88265
89134
|
"network-access": "ingress",
|
|
88266
89135
|
"smtp-provider": "email"
|
|
88267
89136
|
});
|
|
88268
|
-
/**
|
|
88269
|
-
* A saved Customize assignment (D936). The schema is the type: callers use
|
|
88270
|
-
* `z.infer`, they do not restate the shape.
|
|
88271
|
-
*/
|
|
88272
|
-
var OverrideSourceSchema = object({
|
|
88273
|
-
addonId: string().min(1),
|
|
88274
|
-
stableId: string().min(1),
|
|
88275
|
-
cap: string().min(1),
|
|
88276
|
-
fieldPath: string().min(1)
|
|
88277
|
-
});
|
|
88278
|
-
var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
|
|
88279
|
-
object({ kind: literal("identity") }),
|
|
88280
|
-
object({ kind: literal("invert") }),
|
|
88281
|
-
object({
|
|
88282
|
-
kind: literal("threshold"),
|
|
88283
|
-
comparison: _enum(["gte", "lte"]),
|
|
88284
|
-
threshold: number(),
|
|
88285
|
-
startDwellMs: number().nonnegative(),
|
|
88286
|
-
stopDwellMs: number().nonnegative()
|
|
88287
|
-
}),
|
|
88288
|
-
object({
|
|
88289
|
-
kind: literal("linear"),
|
|
88290
|
-
scale: number(),
|
|
88291
|
-
offset: number(),
|
|
88292
|
-
clampMin: number().optional(),
|
|
88293
|
-
clampMax: number().optional()
|
|
88294
|
-
}),
|
|
88295
|
-
object({
|
|
88296
|
-
kind: literal("enum-map"),
|
|
88297
|
-
mapping: record(string(), string().nullable())
|
|
88298
|
-
}),
|
|
88299
|
-
object({ kind: literal("number") })
|
|
88300
|
-
]);
|
|
88301
|
-
var ScalarOverrideDraftSchema = object({
|
|
88302
|
-
kind: literal("scalar"),
|
|
88303
|
-
cap: string().min(1),
|
|
88304
|
-
targetId: string().min(1),
|
|
88305
|
-
source: OverrideSourceSchema,
|
|
88306
|
-
transform: CustomizeTransformDraftSchema
|
|
88307
|
-
});
|
|
88308
|
-
var KeyedArrayOverrideDraftSchema = object({
|
|
88309
|
-
kind: literal("keyedArray"),
|
|
88310
|
-
cap: string().min(1),
|
|
88311
|
-
targetId: string().min(1),
|
|
88312
|
-
key: string().min(1),
|
|
88313
|
-
label: string().min(1),
|
|
88314
|
-
fieldPath: string().min(1),
|
|
88315
|
-
source: OverrideSourceSchema,
|
|
88316
|
-
transform: CustomizeTransformDraftSchema
|
|
88317
|
-
});
|
|
88318
|
-
var PulseOverrideDraftSchema = object({
|
|
88319
|
-
kind: literal("pulse"),
|
|
88320
|
-
cap: string().min(1),
|
|
88321
|
-
targetId: string().min(1),
|
|
88322
|
-
enabled: boolean(),
|
|
88323
|
-
debounceMs: number().nonnegative(),
|
|
88324
|
-
edges: array(_enum([
|
|
88325
|
-
"rising",
|
|
88326
|
-
"button",
|
|
88327
|
-
"native-event"
|
|
88328
|
-
])).min(1).optional(),
|
|
88329
|
-
sources: array(OverrideSourceSchema).min(1)
|
|
88330
|
-
});
|
|
88331
|
-
var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
|
|
88332
|
-
"in-addition",
|
|
88333
|
-
"confirm",
|
|
88334
|
-
"replace"
|
|
88335
|
-
]).optional() });
|
|
88336
|
-
discriminatedUnion("kind", [
|
|
88337
|
-
ScalarOverrideDraftSchema,
|
|
88338
|
-
KeyedArrayOverrideDraftSchema,
|
|
88339
|
-
PulseOverrideDraftSchema,
|
|
88340
|
-
object({
|
|
88341
|
-
kind: literal("span"),
|
|
88342
|
-
cap: string().min(1),
|
|
88343
|
-
targetId: string().min(1),
|
|
88344
|
-
timeoutMs: number().nonnegative(),
|
|
88345
|
-
cooldownMs: number().nonnegative().optional(),
|
|
88346
|
-
sources: array(SpanSourceDraftSchema)
|
|
88347
|
-
})
|
|
88348
|
-
]);
|
|
88349
|
-
object({
|
|
88350
|
-
targetId: string().min(1),
|
|
88351
|
-
configured: boolean(),
|
|
88352
|
-
source: _enum(["native", "assigned"]),
|
|
88353
|
-
state: _enum([
|
|
88354
|
-
"active",
|
|
88355
|
-
"stale",
|
|
88356
|
-
"released",
|
|
88357
|
-
"unavailable"
|
|
88358
|
-
]),
|
|
88359
|
-
reason: string().nullable()
|
|
88360
|
-
});
|
|
88361
89137
|
var G711_SCALE_CORRECTION_DB = {
|
|
88362
89138
|
PCMU: 20 * Math.log10(4),
|
|
88363
89139
|
PCMA: 20 * Math.log10(8)
|
|
@@ -88973,6 +89749,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
88973
89749
|
[...RULE_TEXT],
|
|
88974
89750
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
88975
89751
|
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
89752
|
+
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
88976
89753
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
88977
89754
|
([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
|
|
88978
89755
|
([...RULE_TEXT], [...CONSUMABLE]),
|
|
@@ -90685,18 +91462,29 @@ function buildGoogleOauthIntegration() {
|
|
|
90685
91462
|
*
|
|
90686
91463
|
* Idempotent: a store without either key yields an empty plan, which writes nothing.
|
|
90687
91464
|
*/
|
|
90688
|
-
/** The
|
|
90689
|
-
var
|
|
91465
|
+
/** The addon id, the prefix of its rows in the canonical settings table. */
|
|
91466
|
+
var GOOGLE_ADDON_ID = "export-google";
|
|
91467
|
+
/**
|
|
91468
|
+
* Where the addon's global settings live: the canonical `addon-settings` table, one row per
|
|
91469
|
+
* key, id `<addonId>.<key>`, data `{ addonId, key, value }` (never a per-addon scoped table,
|
|
91470
|
+
* which exists only when something lazily declared it).
|
|
91471
|
+
*/
|
|
91472
|
+
var ADDON_SETTINGS_TABLE = "addon-settings";
|
|
90690
91473
|
var RETIRED_PUBLIC_URL_KEYS = ["publicHubUrl", "detectedPublicHubUrl"];
|
|
90691
91474
|
async function planDropPublicHubUrl(ports) {
|
|
90692
91475
|
const stored = await ports.readStored();
|
|
90693
91476
|
const present = RETIRED_PUBLIC_URL_KEYS.filter((key) => key in stored);
|
|
90694
91477
|
if (present.length === 0) return { edits: [] };
|
|
91478
|
+
const rowId = (key) => `${GOOGLE_ADDON_ID}.${key}`;
|
|
90695
91479
|
return { edits: [{
|
|
90696
91480
|
op: "deleteKeys",
|
|
90697
|
-
scope:
|
|
90698
|
-
keys:
|
|
90699
|
-
precondition: preconditionOf(Object.fromEntries(present.map((key) => [key,
|
|
91481
|
+
scope: ADDON_SETTINGS_TABLE,
|
|
91482
|
+
keys: present.map(rowId),
|
|
91483
|
+
precondition: preconditionOf(Object.fromEntries(present.map((key) => [rowId(key), {
|
|
91484
|
+
addonId: GOOGLE_ADDON_ID,
|
|
91485
|
+
key,
|
|
91486
|
+
value: stored[key]
|
|
91487
|
+
}])))
|
|
90700
91488
|
}] };
|
|
90701
91489
|
}
|
|
90702
91490
|
//#endregion
|
|
@@ -90854,30 +91642,55 @@ var ExportGoogleAddon = class extends BaseAddon {
|
|
|
90854
91642
|
actionScenes.reconcile().catch((err) => {
|
|
90855
91643
|
this.ctx.logger.warn("export-google: action scene reconcile at boot failed", { meta: { error: errMsg$1(err) } });
|
|
90856
91644
|
});
|
|
91645
|
+
const ownInstance = (instanceId) => assertOwnExportInstance("export-google", ADDON_ID, instanceId);
|
|
90857
91646
|
const deviceExportProvider = {
|
|
90858
|
-
getStatus: async () =>
|
|
90859
|
-
|
|
90860
|
-
|
|
90861
|
-
|
|
90862
|
-
|
|
90863
|
-
|
|
90864
|
-
|
|
90865
|
-
|
|
90866
|
-
|
|
91647
|
+
getStatus: async (input) => {
|
|
91648
|
+
ownInstance(statusInstanceOf(input));
|
|
91649
|
+
return {
|
|
91650
|
+
linkState: this.config.linkedAccounts.length > 0 ? "linked" : "unlinked",
|
|
91651
|
+
exposedDeviceCount: this.config.exposed.length,
|
|
91652
|
+
setup: await this.buildSetupBlock()
|
|
91653
|
+
};
|
|
91654
|
+
},
|
|
91655
|
+
listInstances: async () => [{
|
|
91656
|
+
instanceId: ADDON_ID,
|
|
91657
|
+
name: "Google Home",
|
|
91658
|
+
enabled: true,
|
|
91659
|
+
kind: "google-home"
|
|
91660
|
+
}],
|
|
91661
|
+
listSupportedDeviceKinds: async ({ instanceId }) => {
|
|
91662
|
+
ownInstance(instanceId);
|
|
91663
|
+
return [...SUPPORTED_DEVICE_KINDS];
|
|
91664
|
+
},
|
|
91665
|
+
listExposedDevices: async ({ instanceId }) => {
|
|
91666
|
+
ownInstance(instanceId);
|
|
91667
|
+
return this.config.exposed.map((entry) => ({ deviceId: String(entry.deviceId) }));
|
|
91668
|
+
},
|
|
91669
|
+
exposeDevice: async ({ instanceId, deviceId }) => {
|
|
91670
|
+
ownInstance(instanceId);
|
|
91671
|
+
return this.exposeDevice(deviceId);
|
|
91672
|
+
},
|
|
91673
|
+
unexposeDevice: async ({ instanceId, deviceId }) => {
|
|
91674
|
+
ownInstance(instanceId);
|
|
91675
|
+
return this.unexposeDevice(deviceId);
|
|
91676
|
+
},
|
|
90867
91677
|
listSupportedEntityKinds: async () => ["device", "action"],
|
|
90868
|
-
listExposedEntities: async () => {
|
|
91678
|
+
listExposedEntities: async ({ instanceId }) => {
|
|
91679
|
+
ownInstance(instanceId);
|
|
90869
91680
|
await actionScenes.reconcile();
|
|
90870
91681
|
return [...this.config.exposed.map((entry) => ({ entity: {
|
|
90871
91682
|
kind: "device",
|
|
90872
91683
|
deviceId: String(entry.deviceId)
|
|
90873
91684
|
} })), ...actionScenes.list()];
|
|
90874
91685
|
},
|
|
90875
|
-
exposeEntity: async ({ entity }) => {
|
|
91686
|
+
exposeEntity: async ({ instanceId, entity }) => {
|
|
91687
|
+
ownInstance(instanceId);
|
|
90876
91688
|
if (entity.kind === "device") return this.exposeDevice(entity.deviceId);
|
|
90877
91689
|
if (entity.kind === "action") return actionScenes.expose(entity.actionId);
|
|
90878
91690
|
throw new Error("export-google: a notification target cannot be exported to Google Home");
|
|
90879
91691
|
},
|
|
90880
|
-
unexposeEntity: async ({ entity }) => {
|
|
91692
|
+
unexposeEntity: async ({ instanceId, entity }) => {
|
|
91693
|
+
ownInstance(instanceId);
|
|
90881
91694
|
if (entity.kind === "device") return this.unexposeDevice(entity.deviceId);
|
|
90882
91695
|
if (entity.kind === "action") return actionScenes.unexpose(entity.actionId);
|
|
90883
91696
|
throw new Error("export-google: a notification target cannot be exported to Google Home");
|