@camstack/addon-admin-ui 1.2.665 → 1.2.667
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 +17 -0
- package/dist/assets/Addons-BXMGqN8h.js +5 -0
- package/dist/assets/{AdminPage-B3Kuwjd2.js → AdminPage-DK-0OzOy.js} +1 -1
- package/dist/assets/AdminSectionedPage-B_9SwfCU.js +1 -0
- package/dist/assets/AiProfiles-BmWMaG1p.js +3 -0
- package/dist/assets/{BootstrapSettingsForm-DuZUGUMa.js → BootstrapSettingsForm-B3GT6uPJ.js} +1 -1
- package/dist/assets/Build-BTUsmrrM.js +42 -0
- package/dist/assets/{Calendars-DmIcnCIg.js → Calendars-DDYn4l13.js} +1 -1
- package/dist/assets/{CameraGrids-CwedqQkg.js → CameraGrids-qpqZC5t2.js} +1 -1
- package/dist/assets/{Cluster-DEjJcxR0.js → Cluster-iexYCT-T.js} +1 -1
- package/dist/assets/CompositionBlockEditor-DoWUuuVU.js +2 -0
- package/dist/assets/{CompositionEditorPage-BGBF_er3.js → CompositionEditorPage-1mOxsHr1.js} +1 -1
- package/dist/assets/Data-Bmc_LdWT.js +2 -0
- package/dist/assets/DeviceDetail-CaR9_vaP.js +2 -0
- package/dist/assets/{Devices-DO_8zuMe.js → Devices-cloGD9mN.js} +1 -1
- package/dist/assets/EmbedDevicePage-CtHmlMdr.js +1 -0
- package/dist/assets/{EmbedPlayerPage-DwWdm7ic.js → EmbedPlayerPage-Dr3YkDLm.js} +1 -1
- package/dist/assets/History-CYFxRRfn.js +1 -0
- package/dist/assets/Identity--P0G6BeZ.js +1 -0
- package/dist/assets/InstancesTable-DzXq0KhN.js +1 -0
- package/dist/assets/IntegrationDetail-OxP7BiGa.js +1 -0
- package/dist/assets/{Integrations-D_AN5A6m.js → Integrations-Cst-XAIT.js} +2 -2
- package/dist/assets/Integrations-DluTw5RP.js +1 -0
- package/dist/assets/Library-CjUhjReu.js +1 -0
- package/dist/assets/Locations-DdJw8HMZ.js +3 -0
- package/dist/assets/{Logs-D-mkm6R8.js → Logs-Uah8Afby.js} +1 -1
- package/dist/assets/{MaskShapeCanvas-Dz6X3A2K.js → MaskShapeCanvas-BqbVP9jy.js} +1 -1
- package/dist/assets/{MotionZonesSettings-CqGBfTay.js → MotionZonesSettings-DeP_-aoj.js} +1 -1
- package/dist/assets/MyAccess-DQ8L1zTz.js +2 -0
- package/dist/assets/{Network-DK9UgXcV.js → Network-CSfdAb6k.js} +1 -1
- package/dist/assets/NodeAddonsSettingsPanel-yMTxSmdM.js +2 -0
- package/dist/assets/Notifications-B2ruXR0L.js +1 -0
- package/dist/assets/{Pipeline-XbV_d-Cc.js → Pipeline-CAr7WnYA.js} +1 -1
- package/dist/assets/{PrivacyMaskSettings-Cd3-8Ff_.js → PrivacyMaskSettings-CZgjmB7K.js} +1 -1
- package/dist/assets/Recordings-B_FS13Ra.js +1 -0
- package/dist/assets/{SceneMonitorEditor-DN3ztRlH.js → SceneMonitorEditor-BmU4cvFJ.js} +1 -1
- package/dist/assets/SessionsList-DPP_lbji.js +2 -0
- package/dist/assets/{Showroom-C09TlvPE.js → Showroom-BuPyPF5x.js} +1 -1
- package/dist/assets/{StorageLocationsTable-CcY-iBd8.js → StorageLocationsTable-DhYIiDTs.js} +1 -1
- package/dist/assets/System-BRV3ievU.js +1 -0
- package/dist/assets/{Terminal-4k8JkVD1.js → Terminal-CRdevH7E.js} +4 -4
- package/dist/assets/{TrainingProviders-CQf16LM_.js → TrainingProviders-BKDrgumZ.js} +1 -1
- package/dist/assets/{Viewer-BJE_fWej.js → Viewer-Blkif2i1.js} +1 -1
- package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-b2xk_SDh.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-BgPKN8th.js} +1 -1
- package/dist/assets/{action-draft-Bu87ThNt.js → action-draft-D3UKrkg1.js} +1 -1
- package/dist/assets/{ai-page.helpers-BJXRZxAg.js → ai-page.helpers-Cs7gtuUF.js} +1 -1
- package/dist/assets/{assignment-candidates-C-vp0GeV.js → assignment-candidates-71b6bP3H.js} +1 -1
- package/dist/assets/{authed-media-Di9Z7PlD.js → authed-media-BTcTA0r5.js} +1 -1
- package/dist/assets/{board-model-D8_8lFgX.js → board-model-Cv7JHlPG.js} +1 -1
- package/dist/assets/client-DoiIBqwj.js +1119 -0
- package/dist/assets/{command-vocab-RptErntq.js → command-vocab-BYX4pA4b.js} +1 -1
- package/dist/assets/device-detail-YAshysgo.js +1 -0
- package/dist/assets/{device-integration-icon-C75O9UaZ.js → device-integration-icon-cMqHVojY.js} +1 -1
- package/dist/assets/device-picker-model-DgO7fQTu.js +1 -0
- package/dist/assets/dist-Ch3pRNws.js +1119 -0
- package/dist/assets/{dist-BzRlGhlN.js → dist-Rh3LAX-C.js} +1 -1
- package/dist/assets/{format-CropjPL0.js → format-D_mC3UFE.js} +1 -1
- package/dist/assets/{hostInit-37sk2duA.js → hostInit-DR4fqqt2.js} +1 -1
- package/dist/assets/i18n-DSVGwH5e.js +1 -0
- package/dist/assets/{icons-B41RlJxa.js → icons-UZl_ZY4u.js} +1 -1
- package/dist/assets/{index-Bp_VBVht.js → index-CDmW9_IB.js} +3 -3
- package/dist/assets/index-Dttw3zAD.css +2 -0
- package/dist/assets/{linked-devices-model-C6UXmrf_.js → linked-devices-model-DAzu0LiE.js} +1 -1
- package/dist/assets/{mf-entry-bootstrap-0-39d82738.js → mf-entry-bootstrap-0-42762aa1.js} +2 -2
- package/dist/assets/mount-DgO7fQTu.js +1 -0
- package/dist/assets/{notification-rule-status-26Ti2nxE.js → notification-rule-status-DSkmsdJn.js} +1 -1
- package/dist/assets/{player-overlays-BOFRnllQ.js → player-overlays-PZJgLYRd.js} +1 -1
- package/dist/assets/remoteEntry-C6vwi9T8.js +1 -0
- package/dist/assets/src-B2MctxJR.js +275 -0
- package/dist/assets/{sso-popup-aDTs6CN7.js → sso-popup-BzLYKIa5.js} +1 -1
- package/dist/assets/{step-inspector-model-CVpBquc0.js → step-inspector-model--8i49QAX.js} +1 -1
- package/dist/assets/{use-scenes-feed-Pp99Ah_h.js → use-scenes-feed-B9eD6PC_.js} +1 -1
- package/dist/assets/{use-stationary-objects-BJuPuMfn.js → use-stationary-objects-DLyqdOfN.js} +1 -1
- package/dist/assets/{useAdminDeviceRemoval-Dm7XHWnr.js → useAdminDeviceRemoval-D3VjY-ZC.js} +1 -1
- package/dist/assets/useEventInvalidation-DgO7fQTu.js +1 -0
- package/dist/assets/{useNodeUrlSelection-C24zfVkQ.js → useNodeUrlSelection-DVf4JpHA.js} +1 -1
- package/dist/assets/useTemplateSave-7WHIXQns.js +1 -0
- package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DTyHuLCz.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-BymeewDK.js} +2 -2
- package/dist/index.html +9 -9
- package/dist/server/addon.js +361 -178
- package/package.json +2 -2
- package/dist/assets/Addons-Bv5gLMtF.js +0 -5
- package/dist/assets/AdminSectionedPage-DChJZzFa.js +0 -1
- package/dist/assets/AiProfiles-C6yQgkJH.js +0 -3
- package/dist/assets/Build-fnudV1i4.js +0 -42
- package/dist/assets/CompositionBlockEditor-CDl_mxCE.js +0 -2
- package/dist/assets/Data-zDT0RKL1.js +0 -2
- package/dist/assets/DeviceDetail-BHCupF35.js +0 -2
- package/dist/assets/EmbedDevicePage-CsMjCBvF.js +0 -1
- package/dist/assets/History-CZb_UDFA.js +0 -1
- package/dist/assets/Identity-B3n3iCvU.js +0 -1
- package/dist/assets/InstancesTable-D8Us3F4Z.js +0 -1
- package/dist/assets/IntegrationDetail-sSYr3Fb0.js +0 -1
- package/dist/assets/Integrations-BfvgnoX4.js +0 -1
- package/dist/assets/Library-_e_sAc6d.js +0 -1
- package/dist/assets/Locations-DeB8hCXi.js +0 -3
- package/dist/assets/MyAccess-DeHDTQ-J.js +0 -2
- package/dist/assets/NodeAddonsSettingsPanel-Bf7oMHRP.js +0 -2
- package/dist/assets/Notifications-CRjWfxzP.js +0 -1
- package/dist/assets/Recordings-C-72KrtV.js +0 -1
- package/dist/assets/SessionsList-C0Rcbhvx.js +0 -2
- package/dist/assets/System-BgHKlc40.js +0 -1
- package/dist/assets/client-B5Dgc4a1.js +0 -1119
- package/dist/assets/device-detail-DvxCspBZ.js +0 -1
- package/dist/assets/device-picker-model-Bj0f3vXg.js +0 -1
- package/dist/assets/dist-ByTXC7_5.js +0 -1119
- package/dist/assets/i18n-CUhh5TVT.js +0 -1
- package/dist/assets/index-DinlcDxv.css +0 -2
- package/dist/assets/mount-Bj0f3vXg.js +0 -1
- package/dist/assets/remoteEntry-Dl1H5GB8.js +0 -1
- package/dist/assets/src-COXzZsML.js +0 -272
- package/dist/assets/useEventInvalidation-Bj0f3vXg.js +0 -1
- package/dist/assets/useTemplateSave-G6zfft72.js +0 -1
package/dist/server/addon.js
CHANGED
|
@@ -812,7 +812,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
812
812
|
return EventCategory;
|
|
813
813
|
}({});
|
|
814
814
|
//#endregion
|
|
815
|
-
//#region ../types/dist/composed-stable-id-
|
|
815
|
+
//#region ../types/dist/composed-stable-id-COP6zOXx.mjs
|
|
816
816
|
/**
|
|
817
817
|
import { errMsg } from '@camstack/types'
|
|
818
818
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -825,8 +825,6 @@ function errMsg(err) {
|
|
|
825
825
|
}
|
|
826
826
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
827
827
|
DeviceType["Camera"] = "camera";
|
|
828
|
-
/** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
|
|
829
|
-
DeviceType["Hub"] = "hub";
|
|
830
828
|
DeviceType["Light"] = "light";
|
|
831
829
|
DeviceType["Siren"] = "siren";
|
|
832
830
|
DeviceType["Switch"] = "switch";
|
|
@@ -5930,7 +5928,7 @@ var ZodIssueCode = {
|
|
|
5930
5928
|
var ZodFirstPartyTypeKind;
|
|
5931
5929
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5932
5930
|
//#endregion
|
|
5933
|
-
//#region ../types/dist/sleep-
|
|
5931
|
+
//#region ../types/dist/sleep-B5XPl2YP.mjs
|
|
5934
5932
|
/**
|
|
5935
5933
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5936
5934
|
* window to float samples (D455).
|
|
@@ -6586,7 +6584,8 @@ async function runAddonMigrations(host, migrations, logger, options = {}) {
|
|
|
6586
6584
|
try {
|
|
6587
6585
|
declaration = await host.declareOwner({
|
|
6588
6586
|
owner,
|
|
6589
|
-
metas: migrations.map((m) => m.meta)
|
|
6587
|
+
metas: migrations.map((m) => m.meta),
|
|
6588
|
+
...options.retired === void 0 ? {} : { retired: [...options.retired] }
|
|
6590
6589
|
});
|
|
6591
6590
|
} catch (err) {
|
|
6592
6591
|
log.error("the migration engine refused or could not take this addon catalogue — none ran", { meta: { error: errMsg(err) } });
|
|
@@ -7970,6 +7969,14 @@ var BaseAddon = class {
|
|
|
7970
7969
|
declareRegistrySwitch(spec) {
|
|
7971
7970
|
this.registrySwitchSpec = spec;
|
|
7972
7971
|
}
|
|
7972
|
+
/**
|
|
7973
|
+
* Ids this addon removed from its catalogue on purpose (`declareRetiredMigrations`): sent with
|
|
7974
|
+
* every declaration so the engine does not read their applied rows as a newer database.
|
|
7975
|
+
*/
|
|
7976
|
+
retiredMigrationIds = [];
|
|
7977
|
+
declareRetiredMigrations(ids) {
|
|
7978
|
+
this.retiredMigrationIds = ids;
|
|
7979
|
+
}
|
|
7973
7980
|
registrySwitchSpec = null;
|
|
7974
7981
|
registrySwitchBound() {
|
|
7975
7982
|
const spec = this.registrySwitchSpec;
|
|
@@ -7993,10 +8000,14 @@ var BaseAddon = class {
|
|
|
7993
8000
|
async runBound(declared, options) {
|
|
7994
8001
|
const added = this.registrySwitchBound();
|
|
7995
8002
|
const migrations = [...declared, ...added];
|
|
7996
|
-
const
|
|
8003
|
+
const widened = options?.only === void 0 || added.length === 0 ? options : {
|
|
7997
8004
|
...options,
|
|
7998
8005
|
only: [...options.only, ...added.map((m) => m.meta.id)]
|
|
7999
8006
|
};
|
|
8007
|
+
const phased = this.retiredMigrationIds.length === 0 ? widened ?? {} : {
|
|
8008
|
+
...widened,
|
|
8009
|
+
retired: this.retiredMigrationIds
|
|
8010
|
+
};
|
|
8000
8011
|
const api = this.ctx.api.migrations;
|
|
8001
8012
|
const report = await runAddonMigrations({
|
|
8002
8013
|
declareOwner: (input) => api.declareOwner.mutate(input),
|
|
@@ -20760,7 +20771,7 @@ Object.freeze({
|
|
|
20760
20771
|
}
|
|
20761
20772
|
});
|
|
20762
20773
|
//#endregion
|
|
20763
|
-
//#region ../types/dist/implemented-methods-
|
|
20774
|
+
//#region ../types/dist/implemented-methods-0xxMOekw.mjs
|
|
20764
20775
|
/**
|
|
20765
20776
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
20766
20777
|
*
|
|
@@ -46878,69 +46889,6 @@ var EventVocabularyEntrySchema = object({
|
|
|
46878
46889
|
kind: EventVocabularyKindSchema.optional(),
|
|
46879
46890
|
payload: array(EventVocabularyFieldSchema).optional()
|
|
46880
46891
|
});
|
|
46881
|
-
/**
|
|
46882
|
-
* The link an automation made FROM a template carries (#527): which template,
|
|
46883
|
-
* the values the operator filled in, and — when the template has since changed
|
|
46884
|
-
* so that those values no longer fit — the problems that say why.
|
|
46885
|
-
*
|
|
46886
|
-
* It lives inside the recipe (`AutomationRecipe.template`), so the one row in
|
|
46887
|
-
* `core_blocks` stays the one artefact: there is no second store of instances
|
|
46888
|
-
* to drift from the blocks, and deleting the automation deletes the link.
|
|
46889
|
-
* "Convert to a free automation" is dropping this field.
|
|
46890
|
-
*
|
|
46891
|
-
* This file depends on nothing in `recipe.ts`, so the recipe can embed it and
|
|
46892
|
-
* the template engine (`template/automation-template.ts`) can import both.
|
|
46893
|
-
*/
|
|
46894
|
-
/** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
|
|
46895
|
-
var TemplateEventValueSchema = object({
|
|
46896
|
-
eventIds: array(string().min(1)).min(1).max(64).optional(),
|
|
46897
|
-
sourceIds: array(string().min(1)).min(1).max(64).optional(),
|
|
46898
|
-
kinds: array(EventVocabularyKindSchema).min(1).optional()
|
|
46899
|
-
}).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
|
|
46900
|
-
/** An `action` input's value: a vocabulary action and its open args. */
|
|
46901
|
-
var TemplateActionValueSchema = object({
|
|
46902
|
-
actionId: string().min(1),
|
|
46903
|
-
args: record(string(), unknown()).optional()
|
|
46904
|
-
});
|
|
46905
|
-
/** The value of one non-group input. Which member is right is the input kind's to judge. */
|
|
46906
|
-
var TemplateScalarValueSchema = union([
|
|
46907
|
-
number$1(),
|
|
46908
|
-
string(),
|
|
46909
|
-
boolean(),
|
|
46910
|
-
array(number$1().int().nonnegative()),
|
|
46911
|
-
TemplateEventValueSchema,
|
|
46912
|
-
TemplateActionValueSchema
|
|
46913
|
-
]);
|
|
46914
|
-
var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateScalarValueSchema))]);
|
|
46915
|
-
/** Input key → value. */
|
|
46916
|
-
var TemplateInputValuesSchema = record(string(), TemplateInputValueSchema);
|
|
46917
|
-
var TemplateInstanceProblemSchema = object({
|
|
46918
|
-
code: _enum([
|
|
46919
|
-
"missing-input",
|
|
46920
|
-
"invalid-input",
|
|
46921
|
-
"invalid-recipe",
|
|
46922
|
-
"missing-template",
|
|
46923
|
-
"edited-by-hand"
|
|
46924
|
-
]),
|
|
46925
|
-
/** Dotted input address (`buttons.2.targets`); absent for a whole-recipe problem. */
|
|
46926
|
-
input: string().optional(),
|
|
46927
|
-
detail: string()
|
|
46928
|
-
});
|
|
46929
|
-
var AutomationTemplateLinkSchema = object({
|
|
46930
|
-
templateId: string().min(1),
|
|
46931
|
-
values: TemplateInputValuesSchema,
|
|
46932
|
-
/**
|
|
46933
|
-
* Fingerprint of the generated code with this literal blanked
|
|
46934
|
-
* (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
|
|
46935
|
-
* longer matches it was edited by hand, and is never regenerated over.
|
|
46936
|
-
*/
|
|
46937
|
-
codeHash: string().optional(),
|
|
46938
|
-
/**
|
|
46939
|
-
* Present when the last re-expansion refused these values. The automation
|
|
46940
|
-
* keeps running the body of its last good expansion; nothing is dropped.
|
|
46941
|
-
*/
|
|
46942
|
-
problems: array(TemplateInstanceProblemSchema).min(1).optional()
|
|
46943
|
-
});
|
|
46944
46892
|
var ExpressionBindingSourceSchema = union([
|
|
46945
46893
|
object({
|
|
46946
46894
|
kind: literal("field").optional(),
|
|
@@ -46976,6 +46924,58 @@ object({
|
|
|
46976
46924
|
path: ["expr"]
|
|
46977
46925
|
});
|
|
46978
46926
|
});
|
|
46927
|
+
Math.PI / 180;
|
|
46928
|
+
/**
|
|
46929
|
+
* WHEN something happens, as data (D983) — the one time vocabulary of the
|
|
46930
|
+
* scheduler and of an automation's schedule leaf. Three shapes, no cron:
|
|
46931
|
+
*
|
|
46932
|
+
* - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
|
|
46933
|
+
* - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
|
|
46934
|
+
* up to twelve hours, from the site's coordinates;
|
|
46935
|
+
* - `date` — one local date and time (`2026-12-24T18:00`), once.
|
|
46936
|
+
*
|
|
46937
|
+
* A site is a place and its IANA zone ({@link TimeSite}). Every function here
|
|
46938
|
+
* is pure: the zone arithmetic uses `Intl`, no date library.
|
|
46939
|
+
*
|
|
46940
|
+
* Wall-clock honesty across a DST change: a local time that does not exist
|
|
46941
|
+
* (02:30 on the spring-forward day) happens at the first minute that does
|
|
46942
|
+
* (03:00); one that happens twice (02:30 on the fall-back day) happens at its
|
|
46943
|
+
* FIRST occurrence.
|
|
46944
|
+
*/
|
|
46945
|
+
var SunEventSchema = _enum([
|
|
46946
|
+
"sunrise",
|
|
46947
|
+
"sunset",
|
|
46948
|
+
"dawn",
|
|
46949
|
+
"dusk"
|
|
46950
|
+
]);
|
|
46951
|
+
var TimeSpecSchema = discriminatedUnion("kind", [
|
|
46952
|
+
object({
|
|
46953
|
+
kind: literal("clock"),
|
|
46954
|
+
hh: number$1().int().min(0).max(23),
|
|
46955
|
+
mm: number$1().int().min(0).max(59)
|
|
46956
|
+
}),
|
|
46957
|
+
object({
|
|
46958
|
+
kind: literal("sun"),
|
|
46959
|
+
event: SunEventSchema,
|
|
46960
|
+
/** Minutes after the event (negative: before). */
|
|
46961
|
+
offsetMin: number$1().int().min(-720).max(720)
|
|
46962
|
+
}),
|
|
46963
|
+
object({
|
|
46964
|
+
kind: literal("date"),
|
|
46965
|
+
/** `YYYY-MM-DDTHH:mm`, site-local. */
|
|
46966
|
+
local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
|
|
46967
|
+
})
|
|
46968
|
+
]);
|
|
46969
|
+
/** A day of the week as a schedule names it. */
|
|
46970
|
+
var WeekdayKeySchema = _enum([
|
|
46971
|
+
"mon",
|
|
46972
|
+
"tue",
|
|
46973
|
+
"wed",
|
|
46974
|
+
"thu",
|
|
46975
|
+
"fri",
|
|
46976
|
+
"sat",
|
|
46977
|
+
"sun"
|
|
46978
|
+
]);
|
|
46979
46979
|
/**
|
|
46980
46980
|
* Identity envelope for a device's upstream-system metadata.
|
|
46981
46981
|
*
|
|
@@ -47233,58 +47233,6 @@ function macroOnly(macro) {
|
|
|
47233
47233
|
};
|
|
47234
47234
|
}
|
|
47235
47235
|
}
|
|
47236
|
-
Math.PI / 180;
|
|
47237
|
-
/**
|
|
47238
|
-
* WHEN something happens, as data (D983) — the one time vocabulary of the
|
|
47239
|
-
* scheduler and of an automation's schedule leaf. Three shapes, no cron:
|
|
47240
|
-
*
|
|
47241
|
-
* - `clock` — a wall-clock time every day (`07:30`), read in the site's zone;
|
|
47242
|
-
* - `sun` — a sun event (`sunrise`, `sunset`, `dawn`, `dusk`) plus or minus
|
|
47243
|
-
* up to twelve hours, from the site's coordinates;
|
|
47244
|
-
* - `date` — one local date and time (`2026-12-24T18:00`), once.
|
|
47245
|
-
*
|
|
47246
|
-
* A site is a place and its IANA zone ({@link TimeSite}). Every function here
|
|
47247
|
-
* is pure: the zone arithmetic uses `Intl`, no date library.
|
|
47248
|
-
*
|
|
47249
|
-
* Wall-clock honesty across a DST change: a local time that does not exist
|
|
47250
|
-
* (02:30 on the spring-forward day) happens at the first minute that does
|
|
47251
|
-
* (03:00); one that happens twice (02:30 on the fall-back day) happens at its
|
|
47252
|
-
* FIRST occurrence.
|
|
47253
|
-
*/
|
|
47254
|
-
var SunEventSchema = _enum([
|
|
47255
|
-
"sunrise",
|
|
47256
|
-
"sunset",
|
|
47257
|
-
"dawn",
|
|
47258
|
-
"dusk"
|
|
47259
|
-
]);
|
|
47260
|
-
var TimeSpecSchema = discriminatedUnion("kind", [
|
|
47261
|
-
object({
|
|
47262
|
-
kind: literal("clock"),
|
|
47263
|
-
hh: number$1().int().min(0).max(23),
|
|
47264
|
-
mm: number$1().int().min(0).max(59)
|
|
47265
|
-
}),
|
|
47266
|
-
object({
|
|
47267
|
-
kind: literal("sun"),
|
|
47268
|
-
event: SunEventSchema,
|
|
47269
|
-
/** Minutes after the event (negative: before). */
|
|
47270
|
-
offsetMin: number$1().int().min(-720).max(720)
|
|
47271
|
-
}),
|
|
47272
|
-
object({
|
|
47273
|
-
kind: literal("date"),
|
|
47274
|
-
/** `YYYY-MM-DDTHH:mm`, site-local. */
|
|
47275
|
-
local: string().regex(/^(\d{4}-\d{2}-\d{2})T([01]\d|2[0-3]):([0-5]\d)$/, "expected YYYY-MM-DDTHH:mm")
|
|
47276
|
-
})
|
|
47277
|
-
]);
|
|
47278
|
-
/** A day of the week as a schedule names it. */
|
|
47279
|
-
var WeekdayKeySchema = _enum([
|
|
47280
|
-
"mon",
|
|
47281
|
-
"tue",
|
|
47282
|
-
"wed",
|
|
47283
|
-
"thu",
|
|
47284
|
-
"fri",
|
|
47285
|
-
"sat",
|
|
47286
|
-
"sun"
|
|
47287
|
-
]);
|
|
47288
47236
|
/**
|
|
47289
47237
|
* Hold semantics — "for N seconds" on a leaf of the `when` tree (#498).
|
|
47290
47238
|
*
|
|
@@ -47541,24 +47489,33 @@ var StationaryPresentLeafSchema = object({
|
|
|
47541
47489
|
* (`kind: 'date'`) is refused: only a clock time or a sun event makes a window
|
|
47542
47490
|
* that repeats every day.
|
|
47543
47491
|
*/
|
|
47544
|
-
var
|
|
47545
|
-
kind: literal("time-is"),
|
|
47492
|
+
var timeIsWindowShape = {
|
|
47546
47493
|
between: object({
|
|
47547
47494
|
from: TimeSpecSchema,
|
|
47548
47495
|
to: TimeSpecSchema
|
|
47549
47496
|
}).optional(),
|
|
47550
47497
|
days: array(WeekdayKeySchema).min(1).max(7).optional()
|
|
47551
|
-
}
|
|
47552
|
-
|
|
47498
|
+
};
|
|
47499
|
+
function timeIsWindowProblems(window, ctx) {
|
|
47500
|
+
if (window.between === void 0 && window.days === void 0) ctx.addIssue({
|
|
47553
47501
|
code: "custom",
|
|
47554
47502
|
message: "a time-is leaf needs a between window, days, or both"
|
|
47555
47503
|
});
|
|
47556
|
-
for (const end of ["from", "to"]) if (
|
|
47504
|
+
for (const end of ["from", "to"]) if (window.between?.[end].kind === "date") ctx.addIssue({
|
|
47557
47505
|
code: "custom",
|
|
47558
47506
|
message: "a one-date time cannot bound a daily window: use a clock time or a sun event",
|
|
47559
47507
|
path: ["between", end]
|
|
47560
47508
|
});
|
|
47561
|
-
}
|
|
47509
|
+
}
|
|
47510
|
+
/**
|
|
47511
|
+
* What a `time-is` leaf holds beside its kind, judged by the leaf's own rules.
|
|
47512
|
+
* A template's time-window input stores exactly this.
|
|
47513
|
+
*/
|
|
47514
|
+
var TimeIsWindowSchema = object(timeIsWindowShape).superRefine(timeIsWindowProblems);
|
|
47515
|
+
var TimeIsLeafSchema = object({
|
|
47516
|
+
kind: literal("time-is"),
|
|
47517
|
+
...timeIsWindowShape
|
|
47518
|
+
}).superRefine(timeIsWindowProblems);
|
|
47562
47519
|
/**
|
|
47563
47520
|
* True for the run that one of the named event leaves started. It reads the
|
|
47564
47521
|
* run, not a device: in the tree it is judged against the leaf that fired, in
|
|
@@ -47766,6 +47723,79 @@ function validateWhenTree(when) {
|
|
|
47766
47723
|
return null;
|
|
47767
47724
|
}
|
|
47768
47725
|
/**
|
|
47726
|
+
* The link an automation made FROM a template carries (#527): which template,
|
|
47727
|
+
* the values the operator filled in, and — when the template has since changed
|
|
47728
|
+
* so that those values no longer fit — the problems that say why.
|
|
47729
|
+
*
|
|
47730
|
+
* It lives inside the recipe (`AutomationRecipe.template`), so the one row in
|
|
47731
|
+
* `core_blocks` stays the one artefact: there is no second store of instances
|
|
47732
|
+
* to drift from the blocks, and deleting the automation deletes the link.
|
|
47733
|
+
* "Convert to a free automation" is dropping this field.
|
|
47734
|
+
*
|
|
47735
|
+
* This file depends on nothing in `recipe.ts`, so the recipe can embed it and
|
|
47736
|
+
* the template engine (`template/automation-template.ts`) can import both.
|
|
47737
|
+
*/
|
|
47738
|
+
/** An `event` input's value: the same three narrowing lists a `device-fired` row takes. */
|
|
47739
|
+
var TemplateEventValueSchema = object({
|
|
47740
|
+
eventIds: array(string().min(1)).min(1).max(64).optional(),
|
|
47741
|
+
sourceIds: array(string().min(1)).min(1).max(64).optional(),
|
|
47742
|
+
kinds: array(EventVocabularyKindSchema).min(1).optional()
|
|
47743
|
+
}).refine((value) => value.eventIds !== void 0 || value.sourceIds !== void 0 || value.kinds !== void 0, { message: "an event names at least one event, part or kind" });
|
|
47744
|
+
/** An `action` input's value: a vocabulary action and its open args. */
|
|
47745
|
+
var TemplateActionValueSchema = object({
|
|
47746
|
+
actionId: string().min(1),
|
|
47747
|
+
args: record(string(), unknown()).optional()
|
|
47748
|
+
});
|
|
47749
|
+
/**
|
|
47750
|
+
* A `time-window` input's value: what a `time-is` leaf holds beside its kind.
|
|
47751
|
+
* "No limit" is the input left without a value, never an empty object.
|
|
47752
|
+
*/
|
|
47753
|
+
var TemplateTimeWindowValueSchema = TimeIsWindowSchema;
|
|
47754
|
+
var TemplateEntriesValueSchema = array(record(string(), unknown()));
|
|
47755
|
+
/** The value of one non-group input. Which member is right is the input kind's to judge. */
|
|
47756
|
+
var TemplateScalarValueSchema = union([
|
|
47757
|
+
number$1(),
|
|
47758
|
+
string(),
|
|
47759
|
+
boolean(),
|
|
47760
|
+
array(number$1().int().nonnegative()),
|
|
47761
|
+
TemplateEventValueSchema,
|
|
47762
|
+
TemplateActionValueSchema,
|
|
47763
|
+
TemplateTimeWindowValueSchema,
|
|
47764
|
+
TemplateEntriesValueSchema
|
|
47765
|
+
]);
|
|
47766
|
+
/** What a group row holds under one key: a value, or the rows of a group it nests. */
|
|
47767
|
+
var TemplateRowValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateScalarValueSchema))]);
|
|
47768
|
+
var TemplateInputValueSchema = union([TemplateScalarValueSchema, array(record(string(), TemplateRowValueSchema))]);
|
|
47769
|
+
/** Input key → value. */
|
|
47770
|
+
var TemplateInputValuesSchema = record(string(), TemplateInputValueSchema);
|
|
47771
|
+
var TemplateInstanceProblemSchema = object({
|
|
47772
|
+
code: _enum([
|
|
47773
|
+
"missing-input",
|
|
47774
|
+
"invalid-input",
|
|
47775
|
+
"invalid-recipe",
|
|
47776
|
+
"missing-template",
|
|
47777
|
+
"edited-by-hand"
|
|
47778
|
+
]),
|
|
47779
|
+
/** Dotted input address (`buttons.2.targets`, `buttons.0.commands.1.targets`); absent for a whole-recipe problem. */
|
|
47780
|
+
input: string().optional(),
|
|
47781
|
+
detail: string()
|
|
47782
|
+
});
|
|
47783
|
+
var AutomationTemplateLinkSchema = object({
|
|
47784
|
+
templateId: string().min(1),
|
|
47785
|
+
values: TemplateInputValuesSchema,
|
|
47786
|
+
/**
|
|
47787
|
+
* Fingerprint of the generated code with this literal blanked
|
|
47788
|
+
* (`instanceCodeHash`), stamped by `generateAutomationBlock`. Code that no
|
|
47789
|
+
* longer matches it was edited by hand, and is never regenerated over.
|
|
47790
|
+
*/
|
|
47791
|
+
codeHash: string().optional(),
|
|
47792
|
+
/**
|
|
47793
|
+
* Present when the last re-expansion refused these values. The automation
|
|
47794
|
+
* keeps running the body of its last good expansion; nothing is dropped.
|
|
47795
|
+
*/
|
|
47796
|
+
problems: array(TemplateInstanceProblemSchema).min(1).optional()
|
|
47797
|
+
});
|
|
47798
|
+
/**
|
|
47769
47799
|
* The recipe shape before the single `when` tree: a flat list of triggers
|
|
47770
47800
|
* (OR'd, each an instant) and an optional condition tree. Stored recipes —
|
|
47771
47801
|
* the `AUTOMATION_RECIPE` literal of every block saved so far, and whatever an
|
|
@@ -54708,7 +54738,7 @@ DeviceType.MediaPlayer, optionalMethod(deviceOnly, _void(), {
|
|
|
54708
54738
|
}]
|
|
54709
54739
|
}]
|
|
54710
54740
|
});
|
|
54711
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.
|
|
54741
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, 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.PetFeeder, DeviceType.MediaPlayer;
|
|
54712
54742
|
var NUMBER = {
|
|
54713
54743
|
kind: "fixed",
|
|
54714
54744
|
result: ["number"]
|
|
@@ -58560,7 +58590,7 @@ var TransitionsStatusSchema = object({
|
|
|
58560
58590
|
/** Refused rows since start, by reason. */
|
|
58561
58591
|
refused: record(string(), number$1())
|
|
58562
58592
|
});
|
|
58563
|
-
Object.values(DeviceType).filter((type) => type !== DeviceType.
|
|
58593
|
+
Object.values(DeviceType).filter((type) => type !== DeviceType.Container), method(object({
|
|
58564
58594
|
deviceId: number$1().int(),
|
|
58565
58595
|
capName: string().optional(),
|
|
58566
58596
|
actorKind: TransitionActorKindSchema.optional(),
|
|
@@ -61599,7 +61629,7 @@ var HeroSceneSchema = object({
|
|
|
61599
61629
|
/** 0..1: volume, cover position, cycle progress. */
|
|
61600
61630
|
level: number$1().min(0).max(1).nullable()
|
|
61601
61631
|
});
|
|
61602
|
-
DeviceType.Camera, DeviceType.
|
|
61632
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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.Dryer, DeviceType.Gateway;
|
|
61603
61633
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
61604
61634
|
var HeroRowIdSchema = _enum([
|
|
61605
61635
|
"progress",
|
|
@@ -65728,7 +65758,9 @@ method(object({}), object({ entries: array(MigrationLedgerEntrySchema) }), { aut
|
|
|
65728
65758
|
auth: "admin"
|
|
65729
65759
|
}), method(object({
|
|
65730
65760
|
owner: string().min(1),
|
|
65731
|
-
metas: array(MigrationMetaSchema)
|
|
65761
|
+
metas: array(MigrationMetaSchema),
|
|
65762
|
+
/** Ids the owner deliberately removed: an applied row of one is fine, never "newer". */
|
|
65763
|
+
retired: array(string().min(1)).optional()
|
|
65732
65764
|
}), object({
|
|
65733
65765
|
bootId: string(),
|
|
65734
65766
|
snapshot: _enum([
|
|
@@ -82825,31 +82857,57 @@ var TemplateSelectOptionSchema = object({
|
|
|
82825
82857
|
value: string().min(1),
|
|
82826
82858
|
label: string().min(1).max(80)
|
|
82827
82859
|
});
|
|
82860
|
+
var SelectInputSchema = object({
|
|
82861
|
+
kind: literal("select"),
|
|
82862
|
+
...inputBase,
|
|
82863
|
+
options: array(TemplateSelectOptionSchema).min(1).max(50),
|
|
82864
|
+
default: string().optional()
|
|
82865
|
+
});
|
|
82866
|
+
var BooleanInputSchema = object({
|
|
82867
|
+
kind: literal("boolean"),
|
|
82868
|
+
...inputBase,
|
|
82869
|
+
default: boolean().optional()
|
|
82870
|
+
});
|
|
82871
|
+
/** A limit on when the automation may run; only a `gate` binding reads it. */
|
|
82872
|
+
var TimeWindowInputSchema = object({
|
|
82873
|
+
kind: literal("time-window"),
|
|
82874
|
+
...inputBase
|
|
82875
|
+
});
|
|
82828
82876
|
var TemplateScalarInputSchema = discriminatedUnion("kind", [
|
|
82877
|
+
object({
|
|
82878
|
+
kind: literal("entries"),
|
|
82879
|
+
...inputBase,
|
|
82880
|
+
entry: _enum(["trigger", "step"]),
|
|
82881
|
+
allow: array(string().min(1)).min(1).max(10),
|
|
82882
|
+
maxItems: number$1().int().min(1).max(20).optional()
|
|
82883
|
+
}),
|
|
82829
82884
|
DeviceInputSchema,
|
|
82830
82885
|
EventInputSchema,
|
|
82831
82886
|
ActionInputSchema$1,
|
|
82832
82887
|
NumberInputSchema,
|
|
82833
82888
|
DurationInputSchema,
|
|
82834
82889
|
TextInputSchema,
|
|
82835
|
-
|
|
82836
|
-
|
|
82837
|
-
|
|
82838
|
-
options: array(TemplateSelectOptionSchema).min(1).max(50),
|
|
82839
|
-
default: string().optional()
|
|
82840
|
-
}),
|
|
82841
|
-
object({
|
|
82842
|
-
kind: literal("boolean"),
|
|
82843
|
-
...inputBase,
|
|
82844
|
-
default: boolean().optional()
|
|
82845
|
-
})
|
|
82890
|
+
SelectInputSchema,
|
|
82891
|
+
BooleanInputSchema,
|
|
82892
|
+
TimeWindowInputSchema
|
|
82846
82893
|
]);
|
|
82847
|
-
var
|
|
82894
|
+
var groupBase = {
|
|
82848
82895
|
kind: literal("group"),
|
|
82849
82896
|
...inputBase,
|
|
82850
|
-
|
|
82897
|
+
/** What one row is, in the singular and lower case ("button"): "Add button". */
|
|
82898
|
+
rowLabel: string().min(1).max(40).optional(),
|
|
82851
82899
|
minRows: number$1().int().min(0).max(20).optional(),
|
|
82852
82900
|
maxRows: number$1().int().min(1).max(20).optional()
|
|
82901
|
+
};
|
|
82902
|
+
/** A group inside a group row: its rows hold values only, never another group. */
|
|
82903
|
+
var NestedGroupInputSchema = object({
|
|
82904
|
+
...groupBase,
|
|
82905
|
+
inputs: array(TemplateScalarInputSchema).min(1).max(10)
|
|
82906
|
+
});
|
|
82907
|
+
var TemplateRowInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, NestedGroupInputSchema]);
|
|
82908
|
+
var GroupInputSchema = object({
|
|
82909
|
+
...groupBase,
|
|
82910
|
+
inputs: array(TemplateRowInputSchema).min(1).max(10)
|
|
82853
82911
|
});
|
|
82854
82912
|
var TemplateInputSchema = discriminatedUnion("kind", [...TemplateScalarInputSchema.options, GroupInputSchema]);
|
|
82855
82913
|
var TemplatePathSchema = array(union([string().min(1), number$1().int().nonnegative()])).max(24);
|
|
@@ -82860,41 +82918,154 @@ var TemplateValueBindingSchema = object({
|
|
|
82860
82918
|
/** A device value written as a step target (`{ kind: 'devices', ids }`). */
|
|
82861
82919
|
as: literal("target").optional()
|
|
82862
82920
|
});
|
|
82863
|
-
var
|
|
82921
|
+
var TemplateRowIdBindingSchema = object({
|
|
82864
82922
|
kind: literal("row-id"),
|
|
82865
82923
|
path: TemplatePathSchema
|
|
82866
|
-
})
|
|
82867
|
-
|
|
82868
|
-
|
|
82924
|
+
});
|
|
82925
|
+
/**
|
|
82926
|
+
* Appends an `entries` input's elements, verbatim, to the list at `path`. In a
|
|
82927
|
+
* row's bindings `input` is the row's own entries input and `path` is from the
|
|
82928
|
+
* row's item; at the top level, with `in`, it appends the `input` entries of
|
|
82929
|
+
* EVERY row of the group `in` (all buttons' triggers into one `when`), and
|
|
82930
|
+
* without `in` it appends a top-level entries input.
|
|
82931
|
+
*/
|
|
82932
|
+
var TemplateEntriesBindingSchema = object({
|
|
82933
|
+
kind: literal("entries"),
|
|
82869
82934
|
input: inputKey,
|
|
82870
|
-
/** The list in the body the rows are appended to. */
|
|
82871
82935
|
path: TemplatePathSchema,
|
|
82872
|
-
|
|
82873
|
-
|
|
82874
|
-
|
|
82875
|
-
|
|
82876
|
-
|
|
82877
|
-
|
|
82878
|
-
|
|
82879
|
-
|
|
82880
|
-
|
|
82936
|
+
in: inputKey.optional()
|
|
82937
|
+
});
|
|
82938
|
+
/** What fills the item of a row that holds values only. */
|
|
82939
|
+
var TemplateLeafRowBindingSchema = discriminatedUnion("kind", [TemplateValueBindingSchema, TemplateRowIdBindingSchema]);
|
|
82940
|
+
var TemplateRowItemBindingSchema = discriminatedUnion("kind", [
|
|
82941
|
+
TemplateValueBindingSchema,
|
|
82942
|
+
TemplateEntriesBindingSchema,
|
|
82943
|
+
TemplateRowIdBindingSchema,
|
|
82944
|
+
object({
|
|
82945
|
+
kind: literal("row-ids"),
|
|
82946
|
+
/** The nested group whose rows are named. */
|
|
82947
|
+
input: inputKey,
|
|
82948
|
+
path: TemplatePathSchema
|
|
82949
|
+
}),
|
|
82950
|
+
object({
|
|
82951
|
+
kind: literal("rows"),
|
|
82952
|
+
/** The nested group, declared by the parent row's group. */
|
|
82953
|
+
input: inputKey,
|
|
82954
|
+
/** The list the nested rows are appended to, from the parent row's item. */
|
|
82955
|
+
path: TemplatePathSchema,
|
|
82956
|
+
item: unknown(),
|
|
82957
|
+
bindings: array(TemplateLeafRowBindingSchema).max(40)
|
|
82958
|
+
})
|
|
82959
|
+
]);
|
|
82960
|
+
var TemplateBindingSchema = discriminatedUnion("kind", [
|
|
82961
|
+
TemplateValueBindingSchema,
|
|
82962
|
+
TemplateEntriesBindingSchema,
|
|
82963
|
+
object({
|
|
82964
|
+
kind: literal("rows"),
|
|
82965
|
+
input: inputKey,
|
|
82966
|
+
/**
|
|
82967
|
+
* A group the rows of `input` hold: the binding then appends one item per
|
|
82968
|
+
* NESTED row of every row, and its bindings read the nested row.
|
|
82969
|
+
*/
|
|
82970
|
+
nested: inputKey.optional(),
|
|
82971
|
+
/** The list in the body the rows are appended to. */
|
|
82972
|
+
path: TemplatePathSchema,
|
|
82973
|
+
/** The JSON copied once per row. */
|
|
82974
|
+
item: unknown(),
|
|
82975
|
+
bindings: array(TemplateRowItemBindingSchema).max(40)
|
|
82976
|
+
}),
|
|
82977
|
+
object({
|
|
82978
|
+
kind: literal("gate"),
|
|
82979
|
+
/** A top-level `time-window` input. */
|
|
82980
|
+
input: inputKey,
|
|
82981
|
+
path: TemplatePathSchema
|
|
82982
|
+
})
|
|
82983
|
+
]);
|
|
82984
|
+
/** Twice-declared keys and event / action inputs that read no device beside them. */
|
|
82985
|
+
function levelProblems(inputs, path, inRow = false) {
|
|
82986
|
+
const issues = [];
|
|
82987
|
+
const seen = /* @__PURE__ */ new Set();
|
|
82988
|
+
for (const input of inputs) {
|
|
82989
|
+
if (seen.has(input.key)) issues.push({
|
|
82881
82990
|
message: `input "${input.key}" is declared twice`,
|
|
82882
|
-
path
|
|
82991
|
+
path
|
|
82883
82992
|
});
|
|
82884
|
-
|
|
82885
|
-
|
|
82886
|
-
|
|
82887
|
-
|
|
82888
|
-
|
|
82889
|
-
|
|
82890
|
-
|
|
82891
|
-
|
|
82892
|
-
|
|
82893
|
-
|
|
82894
|
-
|
|
82993
|
+
seen.add(input.key);
|
|
82994
|
+
if (input.kind === "group") {
|
|
82995
|
+
issues.push(...levelProblems(input.inputs, path, true));
|
|
82996
|
+
continue;
|
|
82997
|
+
}
|
|
82998
|
+
if (input.kind === "time-window" && inRow) issues.push({
|
|
82999
|
+
message: `time window "${input.key}" limits the whole automation: it is not a row input`,
|
|
83000
|
+
path
|
|
83001
|
+
});
|
|
83002
|
+
if (input.kind !== "event" && input.kind !== "action") continue;
|
|
83003
|
+
if (input.deviceInput === void 0) continue;
|
|
83004
|
+
const device = inputs.find((sibling) => sibling.key === input.deviceInput);
|
|
83005
|
+
if (device === void 0 || device.kind !== "device") issues.push({
|
|
83006
|
+
message: `"${input.key}" reads the device input "${input.deviceInput}", which is not a device input beside it`,
|
|
83007
|
+
path
|
|
83008
|
+
});
|
|
83009
|
+
}
|
|
83010
|
+
return issues;
|
|
83011
|
+
}
|
|
83012
|
+
function nestedGroupOf(group, key) {
|
|
83013
|
+
const found = group.inputs.find((input) => input.key === key);
|
|
83014
|
+
return found !== void 0 && found.kind === "group" ? found : void 0;
|
|
83015
|
+
}
|
|
83016
|
+
function leafBindingProblems(bindings, owner) {
|
|
83017
|
+
const issues = [];
|
|
83018
|
+
for (const row of bindings) {
|
|
83019
|
+
if (row.kind === "row-id") continue;
|
|
83020
|
+
if (row.kind === "value") {
|
|
83021
|
+
const input = owner.inputs.find((i) => i.key === row.input);
|
|
83022
|
+
if (input === void 0) issues.push(`row binding names "${row.input}", which group "${owner.key}" does not declare`);
|
|
83023
|
+
else if (input.kind === "group") issues.push(`group "${input.key}" is bound with rows, not a value`);
|
|
83024
|
+
else if (input.kind === "entries") issues.push(`entries "${input.key}" are bound with entries, not a value`);
|
|
83025
|
+
continue;
|
|
83026
|
+
}
|
|
83027
|
+
const nested = owner.inputs.find((i) => i.key === row.input);
|
|
83028
|
+
if (row.kind === "entries") {
|
|
83029
|
+
if (nested === void 0 || nested.kind !== "entries") issues.push(`"${row.input}" is not an entries input inside "${owner.key}"`);
|
|
83030
|
+
continue;
|
|
83031
|
+
}
|
|
83032
|
+
if (row.kind === "row-ids") {
|
|
83033
|
+
if (nested === void 0 || nested.kind !== "group" && nested.kind !== "entries") issues.push(`"${row.input}" is not a group or entries input inside "${owner.key}"`);
|
|
83034
|
+
continue;
|
|
83035
|
+
}
|
|
83036
|
+
if (nested === void 0 || nested.kind !== "group") {
|
|
83037
|
+
issues.push(`"${row.input}" is not a group inside "${owner.key}"`);
|
|
83038
|
+
continue;
|
|
82895
83039
|
}
|
|
83040
|
+
issues.push(...leafBindingProblems(row.bindings, nested));
|
|
83041
|
+
}
|
|
83042
|
+
return issues;
|
|
83043
|
+
}
|
|
83044
|
+
function rowsBindingProblems(binding, group) {
|
|
83045
|
+
if (binding.nested === void 0) return leafBindingProblems(binding.bindings, group);
|
|
83046
|
+
const nested = nestedGroupOf(group, binding.nested);
|
|
83047
|
+
if (nested === void 0) return [`"${binding.nested}" is not a group inside "${group.key}"`];
|
|
83048
|
+
return leafBindingProblems(binding.bindings, nested);
|
|
83049
|
+
}
|
|
83050
|
+
function bindingProblems(payload, ctx) {
|
|
83051
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
83052
|
+
for (const input of payload.inputs) byKey.set(input.key, input);
|
|
83053
|
+
for (const issue of levelProblems(payload.inputs, ["inputs"])) ctx.addIssue({
|
|
83054
|
+
code: "custom",
|
|
83055
|
+
message: issue.message,
|
|
83056
|
+
path: [...issue.path]
|
|
82896
83057
|
});
|
|
82897
83058
|
payload.bindings.forEach((binding, index) => {
|
|
83059
|
+
if (binding.kind === "entries" && binding.in !== void 0) {
|
|
83060
|
+
const group = byKey.get(binding.in);
|
|
83061
|
+
const entries = group !== void 0 && group.kind === "group" ? group.inputs.find((i) => i.key === binding.input) : void 0;
|
|
83062
|
+
if (entries === void 0 || entries.kind !== "entries") ctx.addIssue({
|
|
83063
|
+
code: "custom",
|
|
83064
|
+
message: `"${binding.input}" is not an entries input inside the group "${binding.in}"`,
|
|
83065
|
+
path: ["bindings", index]
|
|
83066
|
+
});
|
|
83067
|
+
return;
|
|
83068
|
+
}
|
|
82898
83069
|
const input = byKey.get(binding.input);
|
|
82899
83070
|
if (input === void 0) {
|
|
82900
83071
|
ctx.addIssue({
|
|
@@ -82909,6 +83080,18 @@ function bindingProblems(payload, ctx) {
|
|
|
82909
83080
|
message: `group "${input.key}" is bound with rows, not a value`,
|
|
82910
83081
|
path: ["bindings", index]
|
|
82911
83082
|
});
|
|
83083
|
+
if (binding.kind === "entries" !== (input.kind === "entries") && binding.kind !== "rows") {
|
|
83084
|
+
if (binding.kind === "entries" || binding.kind === "value") ctx.addIssue({
|
|
83085
|
+
code: "custom",
|
|
83086
|
+
message: binding.kind === "entries" ? `entries bindings read an entries input: "${input.key}" is ${input.kind}` : `entries "${input.key}" are bound with entries, not a value`,
|
|
83087
|
+
path: ["bindings", index]
|
|
83088
|
+
});
|
|
83089
|
+
}
|
|
83090
|
+
if (binding.kind === "gate" !== (input.kind === "time-window")) ctx.addIssue({
|
|
83091
|
+
code: "custom",
|
|
83092
|
+
message: `a gate reads a time window and a time window is bound with a gate: "${input.key}" is ${input.kind}`,
|
|
83093
|
+
path: ["bindings", index]
|
|
83094
|
+
});
|
|
82912
83095
|
if (binding.kind === "rows") {
|
|
82913
83096
|
if (input.kind !== "group") {
|
|
82914
83097
|
ctx.addIssue({
|
|
@@ -82918,9 +83101,9 @@ function bindingProblems(payload, ctx) {
|
|
|
82918
83101
|
});
|
|
82919
83102
|
return;
|
|
82920
83103
|
}
|
|
82921
|
-
for (const
|
|
83104
|
+
for (const message of rowsBindingProblems(binding, input)) ctx.addIssue({
|
|
82922
83105
|
code: "custom",
|
|
82923
|
-
message
|
|
83106
|
+
message,
|
|
82924
83107
|
path: ["bindings", index]
|
|
82925
83108
|
});
|
|
82926
83109
|
}
|
|
@@ -85716,7 +85899,7 @@ var AccessoryKind = {
|
|
|
85716
85899
|
};
|
|
85717
85900
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
85718
85901
|
DeviceType.HeatPump;
|
|
85719
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.
|
|
85902
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.EnergySystem, DeviceType.Camera, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, 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.Dryer, DeviceType.Gateway;
|
|
85720
85903
|
new Set(Object.values(DeviceType));
|
|
85721
85904
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
85722
85905
|
function contribution(cap, schema, build) {
|
|
@@ -87761,7 +87944,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
|
|
|
87761
87944
|
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
87762
87945
|
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
87763
87946
|
];
|
|
87764
|
-
DeviceType.Camera, DeviceType.
|
|
87947
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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.Dryer, DeviceType.Gateway;
|
|
87765
87948
|
/**
|
|
87766
87949
|
* Who looks like what (D1023). One look per {@link DeviceType}, refined by a
|
|
87767
87950
|
* {@link DeviceRole} where the role changes how the device reads (a leak
|
|
@@ -88405,7 +88588,7 @@ lookOf({
|
|
|
88405
88588
|
standby: MUTED
|
|
88406
88589
|
});
|
|
88407
88590
|
DeviceType.Climate;
|
|
88408
|
-
DeviceType.Camera, DeviceType.
|
|
88591
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, 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.HeatPump, DeviceType.EnergySystem, 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.Dryer, DeviceType.Gateway;
|
|
88409
88592
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
88410
88593
|
Object.freeze({
|
|
88411
88594
|
"accessories.getStatus": {
|
|
@@ -98876,7 +99059,7 @@ function offered(received) {
|
|
|
98876
99059
|
};
|
|
98877
99060
|
}
|
|
98878
99061
|
offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
|
|
98879
|
-
DeviceType.Camera, DeviceType.
|
|
99062
|
+
DeviceType.Camera, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.HeatPump, DeviceType.EnergySystem, 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.Dryer, DeviceType.Gateway;
|
|
98880
99063
|
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.SwitchLight, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
98881
99064
|
new Set(Object.values(DeviceType));
|
|
98882
99065
|
new Set(Object.values(DeviceRole));
|
|
@@ -103406,7 +103589,7 @@ var AdminUIAddon = class extends BaseAddon {
|
|
|
103406
103589
|
capability: adminUiCapability,
|
|
103407
103590
|
provider: {
|
|
103408
103591
|
getStaticDir: async () => ({ staticDir: resolveAdminUiDistDir() }),
|
|
103409
|
-
getVersion: async () => ({ version: "1.2.
|
|
103592
|
+
getVersion: async () => ({ version: "1.2.667" })
|
|
103410
103593
|
}
|
|
103411
103594
|
}];
|
|
103412
103595
|
}
|