@camstack/addon-provider-homeassistant 1.2.644 → 1.2.645
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 +6 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{ha-broker-source-tDtT7Zi-.js → ha-broker-source-DAoZm6wm.js} +412 -154
- package/dist/{ha-broker-source-DmHRCdW2.mjs → ha-broker-source-DLhSaXYb.mjs} +412 -154
- package/dist/ha-export/ha-export.addon.js +5 -1
- package/dist/ha-export/ha-export.addon.mjs +5 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("node:crypto");
|
|
2
|
-
//#region ../types/dist/event-category-
|
|
2
|
+
//#region ../types/dist/event-category-BmPm98n0.mjs
|
|
3
3
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4
4
|
EventCategory["SystemBoot"] = "system.boot";
|
|
5
5
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -483,6 +483,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
483
483
|
EventCategory["RunningStarted"] = "running.started";
|
|
484
484
|
/** Mirrors `runningStateCapability.events.onFinished`. */
|
|
485
485
|
EventCategory["RunningFinished"] = "running.finished";
|
|
486
|
+
/** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
|
|
487
|
+
EventCategory["DeviceRunOpened"] = "device-run.opened";
|
|
488
|
+
/** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
|
|
489
|
+
EventCategory["DeviceRunClosed"] = "device-run.closed";
|
|
486
490
|
/**
|
|
487
491
|
* Cap event fired by every device that registers the `event-emitter`
|
|
488
492
|
* capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
|
|
@@ -5964,7 +5968,7 @@ var ZodIssueCode = {
|
|
|
5964
5968
|
var ZodFirstPartyTypeKind;
|
|
5965
5969
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
5966
5970
|
//#endregion
|
|
5967
|
-
//#region ../types/dist/sleep-
|
|
5971
|
+
//#region ../types/dist/sleep-BKzhQTSm.mjs
|
|
5968
5972
|
/**
|
|
5969
5973
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
5970
5974
|
* window to float samples (D455).
|
|
@@ -9705,6 +9709,7 @@ var CAP_NAMES = Object.freeze([
|
|
|
9705
9709
|
"device-ops",
|
|
9706
9710
|
"device-provider",
|
|
9707
9711
|
"device-removal-hook",
|
|
9712
|
+
"device-runs",
|
|
9708
9713
|
"device-state",
|
|
9709
9714
|
"device-status",
|
|
9710
9715
|
"dishwasher",
|
|
@@ -11649,7 +11654,7 @@ object({
|
|
|
11649
11654
|
params: record(string(), union([string(), number()])).optional()
|
|
11650
11655
|
});
|
|
11651
11656
|
//#endregion
|
|
11652
|
-
//#region ../types/dist/composition-
|
|
11657
|
+
//#region ../types/dist/composition-BiKWlUCc.mjs
|
|
11653
11658
|
/**
|
|
11654
11659
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
11655
11660
|
*
|
|
@@ -12582,7 +12587,15 @@ var HelperSpecSchema = discriminatedUnion("kind", [
|
|
|
12582
12587
|
thresholdWatts: number().positive(),
|
|
12583
12588
|
startDwellMs: number().int().nonnegative(),
|
|
12584
12589
|
stopDwellMs: number().int().nonnegative(),
|
|
12585
|
-
member: HelperMemberSchema
|
|
12590
|
+
member: HelperMemberSchema,
|
|
12591
|
+
/**
|
|
12592
|
+
* The plug that powers the appliance (`switch.on`). Optional: when set, the
|
|
12593
|
+
* composition carries a `power-source` feature, so the hub can cut and restore
|
|
12594
|
+
* that plug (power-source link of a NEW-target composition).
|
|
12595
|
+
*/
|
|
12596
|
+
powerSwitch: HelperMemberSchema.optional(),
|
|
12597
|
+
/** How long a forced restart keeps the plug off; the cap's default when unset. */
|
|
12598
|
+
offSeconds: number().optional()
|
|
12586
12599
|
}),
|
|
12587
12600
|
object({
|
|
12588
12601
|
kind: literal("statistic"),
|
|
@@ -14124,7 +14137,13 @@ var MigrationLedgerEntrySchema = object({
|
|
|
14124
14137
|
/** Why it is `blocked` or `held` (`dependency-failed`, `snapshot-refused`, …). */
|
|
14125
14138
|
reason: string().nullable(),
|
|
14126
14139
|
nodeId: string().nullable(),
|
|
14127
|
-
bootId: string().nullable()
|
|
14140
|
+
bootId: string().nullable(),
|
|
14141
|
+
/**
|
|
14142
|
+
* The catalogued meta of this id (description, body kind, store, `dependsOn`…),
|
|
14143
|
+
* joined by the engine from the catalogues it knows this boot. Absent when no
|
|
14144
|
+
* catalogue lists the id (a newer database).
|
|
14145
|
+
*/
|
|
14146
|
+
meta: MigrationMetaSchema.optional()
|
|
14128
14147
|
});
|
|
14129
14148
|
/** A catalogued migration that is not applied, with where it stands. */
|
|
14130
14149
|
var MigrationPendingEntrySchema = object({
|
|
@@ -19931,6 +19950,14 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
19931
19950
|
}
|
|
19932
19951
|
} }
|
|
19933
19952
|
},
|
|
19953
|
+
"device-runs": {
|
|
19954
|
+
scope: "device",
|
|
19955
|
+
noun: t("Runs", "Esecuzioni"),
|
|
19956
|
+
events: {
|
|
19957
|
+
onRunOpened: { notOperatorFacing: "the durable record of a run that the running-state start flip already announces" },
|
|
19958
|
+
onRunClosed: { notOperatorFacing: "the durable record of a run that the running-state finish flip already announces" }
|
|
19959
|
+
}
|
|
19960
|
+
},
|
|
19934
19961
|
update: {
|
|
19935
19962
|
scope: "device",
|
|
19936
19963
|
noun: t("Firmware update", "Aggiornamento firmware"),
|
|
@@ -46835,6 +46862,117 @@ function actuator(input) {
|
|
|
46835
46862
|
};
|
|
46836
46863
|
}
|
|
46837
46864
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
46865
|
+
var PowerSourceRefusalReasonSchema = _enum([
|
|
46866
|
+
"no-power-source",
|
|
46867
|
+
"switch-missing",
|
|
46868
|
+
"switch-offline",
|
|
46869
|
+
"switch-unknown",
|
|
46870
|
+
"restart-in-progress",
|
|
46871
|
+
"switch-call-failed"
|
|
46872
|
+
]);
|
|
46873
|
+
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
46874
|
+
accepted: literal(false),
|
|
46875
|
+
reason: PowerSourceRefusalReasonSchema,
|
|
46876
|
+
/** One line for the operator, naming the switch. */
|
|
46877
|
+
message: string()
|
|
46878
|
+
})]);
|
|
46879
|
+
var PowerSourceInfoSchema = object({
|
|
46880
|
+
/** False when the device has no power source linked; the rest is then empty. */
|
|
46881
|
+
linked: boolean(),
|
|
46882
|
+
switchDeviceId: number().nullable(),
|
|
46883
|
+
switchName: string().nullable(),
|
|
46884
|
+
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
46885
|
+
switchOn: boolean().nullable(),
|
|
46886
|
+
switchOnline: boolean().nullable(),
|
|
46887
|
+
restartInProgress: boolean(),
|
|
46888
|
+
offSeconds: number().int()
|
|
46889
|
+
});
|
|
46890
|
+
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
46891
|
+
var PowerSourceStateSchema = object({
|
|
46892
|
+
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
46893
|
+
switchOn: boolean().nullable(),
|
|
46894
|
+
offSeconds: number().int(),
|
|
46895
|
+
lastFetchedAt: number()
|
|
46896
|
+
});
|
|
46897
|
+
var POWER_SOURCE_DEVICE_TYPES = [
|
|
46898
|
+
DeviceType.Gateway,
|
|
46899
|
+
DeviceType.Hub,
|
|
46900
|
+
DeviceType.Camera,
|
|
46901
|
+
DeviceType.Sensor,
|
|
46902
|
+
DeviceType.MediaPlayer,
|
|
46903
|
+
DeviceType.Vacuum,
|
|
46904
|
+
DeviceType.Generic,
|
|
46905
|
+
DeviceType.Washer,
|
|
46906
|
+
DeviceType.Dryer,
|
|
46907
|
+
DeviceType.Dishwasher,
|
|
46908
|
+
DeviceType.PetFountain,
|
|
46909
|
+
DeviceType.Fan,
|
|
46910
|
+
DeviceType.Humidifier,
|
|
46911
|
+
DeviceType.Climate,
|
|
46912
|
+
DeviceType.WaterHeater
|
|
46913
|
+
];
|
|
46914
|
+
var powerSourceCustomize = {
|
|
46915
|
+
version: 1,
|
|
46916
|
+
targets: [{
|
|
46917
|
+
id: "switch",
|
|
46918
|
+
cardinality: "scalar",
|
|
46919
|
+
vocabulary: {
|
|
46920
|
+
cap: "power-source",
|
|
46921
|
+
stateField: "switchOn"
|
|
46922
|
+
},
|
|
46923
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
46924
|
+
apply: "add",
|
|
46925
|
+
path: "switchOn",
|
|
46926
|
+
sources: [{
|
|
46927
|
+
kind: "switch",
|
|
46928
|
+
transforms: [{ kind: "identity" }]
|
|
46929
|
+
}],
|
|
46930
|
+
companions: [{
|
|
46931
|
+
kind: "constant",
|
|
46932
|
+
path: "offSeconds",
|
|
46933
|
+
value: 10,
|
|
46934
|
+
when: "add"
|
|
46935
|
+
}, {
|
|
46936
|
+
kind: "clock",
|
|
46937
|
+
path: "lastFetchedAt",
|
|
46938
|
+
when: "always"
|
|
46939
|
+
}],
|
|
46940
|
+
sourceReport: { status: "assignment-status" }
|
|
46941
|
+
}]
|
|
46942
|
+
};
|
|
46943
|
+
var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
|
|
46944
|
+
var powerSourceCapability = {
|
|
46945
|
+
name: "power-source",
|
|
46946
|
+
scope: "device",
|
|
46947
|
+
mode: "singleton",
|
|
46948
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
46949
|
+
methods: {
|
|
46950
|
+
getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }),
|
|
46951
|
+
powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46952
|
+
kind: "mutation",
|
|
46953
|
+
auth: "admin"
|
|
46954
|
+
}),
|
|
46955
|
+
powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46956
|
+
kind: "mutation",
|
|
46957
|
+
auth: "admin"
|
|
46958
|
+
}),
|
|
46959
|
+
forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
46960
|
+
kind: "mutation",
|
|
46961
|
+
auth: "admin"
|
|
46962
|
+
})
|
|
46963
|
+
},
|
|
46964
|
+
runtimeState: PowerSourceStateSchema,
|
|
46965
|
+
customize: powerSourceCustomize,
|
|
46966
|
+
/**
|
|
46967
|
+
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
46968
|
+
* its next report; a restored value would outlive the reading it names.
|
|
46969
|
+
*
|
|
46970
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
46971
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
46972
|
+
*/
|
|
46973
|
+
durability: "session",
|
|
46974
|
+
history: "none"
|
|
46975
|
+
};
|
|
46838
46976
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
46839
46977
|
DeviceType.Camera;
|
|
46840
46978
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
@@ -48260,6 +48398,101 @@ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly())
|
|
|
48260
48398
|
kind: "mutation",
|
|
48261
48399
|
auth: "admin"
|
|
48262
48400
|
});
|
|
48401
|
+
/**
|
|
48402
|
+
* device-runs - the durable record of ONE run of a device: a washing cycle, a
|
|
48403
|
+
* dishwasher cycle, later a mow or a clean (D992).
|
|
48404
|
+
*
|
|
48405
|
+
* A run is a DOCUMENT (opened at one instant, closed at another, carrying what
|
|
48406
|
+
* was measured over it), never a sample - device-history keeps the numbers over
|
|
48407
|
+
* time and its `device-runs` provider keeps these documents beside them, because
|
|
48408
|
+
* the energy of a run is a question about device-history's own series. The
|
|
48409
|
+
* record is written from the `running-state` flip on `DeviceStateChanged`; it
|
|
48410
|
+
* survives a restart (the open row is on disk) and a missed flip (boot compares
|
|
48411
|
+
* the open rows against the live snapshots).
|
|
48412
|
+
*
|
|
48413
|
+
* Every measurement is `number | null` and `null` means "could not be
|
|
48414
|
+
* measured", never `0` (D393). A run closed by the boot reconcile because the
|
|
48415
|
+
* device stopped while nobody was watching has `outcome: 'unknown'`.
|
|
48416
|
+
*/
|
|
48417
|
+
var DeviceRunKindSchema = _enum([
|
|
48418
|
+
"appliance",
|
|
48419
|
+
"mower",
|
|
48420
|
+
"vacuum"
|
|
48421
|
+
]);
|
|
48422
|
+
var DeviceRunStateSchema = _enum(["open", "closed"]);
|
|
48423
|
+
var DeviceRunOutcomeSchema = _enum([
|
|
48424
|
+
"completed",
|
|
48425
|
+
"aborted",
|
|
48426
|
+
"error",
|
|
48427
|
+
"unknown"
|
|
48428
|
+
]);
|
|
48429
|
+
/** What opened or closed the run. `reconcile` is the boot comparison against live state. */
|
|
48430
|
+
var DeviceRunSourceSchema = _enum([
|
|
48431
|
+
"running-state",
|
|
48432
|
+
"activity",
|
|
48433
|
+
"reconcile"
|
|
48434
|
+
]);
|
|
48435
|
+
/** How the energy of a run was obtained; `null` when it could not be. */
|
|
48436
|
+
var DeviceRunEnergyMethodSchema = _enum(["counter-delta", "history-integral"]);
|
|
48437
|
+
var DeviceRunPhaseSchema = object({
|
|
48438
|
+
phase: string(),
|
|
48439
|
+
at: number()
|
|
48440
|
+
});
|
|
48441
|
+
/** The kind-specific block; a later phase adds a branch, nothing else changes. */
|
|
48442
|
+
var DeviceRunDetailSchema = discriminatedUnion("kind", [object({
|
|
48443
|
+
kind: literal("appliance"),
|
|
48444
|
+
/** kWh used over the run. */
|
|
48445
|
+
energyKwh: number().nullable().meta(readingMeta("energy")),
|
|
48446
|
+
energyMethod: DeviceRunEnergyMethodSchema.nullable(),
|
|
48447
|
+
/** Highest power seen while the run was open. */
|
|
48448
|
+
peakW: number().nullable().meta(readingMeta("power")),
|
|
48449
|
+
/** Time-weighted mean power while the run was open. */
|
|
48450
|
+
avgW: number().nullable().meta(readingMeta("power")),
|
|
48451
|
+
/** The program the appliance said it ran when the run opened. */
|
|
48452
|
+
program: string().nullable(),
|
|
48453
|
+
remainingAtStartSec: number().nullable().meta(readingMeta("duration")),
|
|
48454
|
+
/** The last phase the device reported before the run closed. */
|
|
48455
|
+
finalPhase: string().nullable(),
|
|
48456
|
+
/**
|
|
48457
|
+
* The meter's energy counter when the run opened; `null` when the meter had
|
|
48458
|
+
* not said (or the run was opened late, by the boot reconcile). It lives in
|
|
48459
|
+
* the row so a run that outlives a restart still ends with `end - start`.
|
|
48460
|
+
*/
|
|
48461
|
+
energyStartKwh: number().nullable().meta(readingMeta("energy")),
|
|
48462
|
+
/** Milliseconds of power readings behind `avgW` - the weight a restart resumes the mean with. */
|
|
48463
|
+
powerObservedMs: number()
|
|
48464
|
+
})]);
|
|
48465
|
+
var DeviceRunSchema = object({
|
|
48466
|
+
/** `${deviceId}:${startedAt}`. */
|
|
48467
|
+
runId: string(),
|
|
48468
|
+
deviceId: number().int(),
|
|
48469
|
+
kind: DeviceRunKindSchema,
|
|
48470
|
+
state: DeviceRunStateSchema,
|
|
48471
|
+
startedAt: number(),
|
|
48472
|
+
endedAt: number().nullable(),
|
|
48473
|
+
durationMs: number().nullable(),
|
|
48474
|
+
outcome: DeviceRunOutcomeSchema.nullable(),
|
|
48475
|
+
startSource: DeviceRunSourceSchema,
|
|
48476
|
+
endSource: DeviceRunSourceSchema.nullable(),
|
|
48477
|
+
/** Where the device's running bit came from (`running-state.source`); `null` when it did not say. */
|
|
48478
|
+
runningSource: _enum(["native", "assigned"]).nullable(),
|
|
48479
|
+
phases: array(DeviceRunPhaseSchema),
|
|
48480
|
+
detail: DeviceRunDetailSchema
|
|
48481
|
+
});
|
|
48482
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, method(object({
|
|
48483
|
+
deviceId: number().int(),
|
|
48484
|
+
outcome: DeviceRunOutcomeSchema.optional(),
|
|
48485
|
+
atFrom: number().optional(),
|
|
48486
|
+
atTo: number().optional(),
|
|
48487
|
+
limit: number().int().positive().max(200).default(50),
|
|
48488
|
+
cursor: string().optional()
|
|
48489
|
+
}), object({
|
|
48490
|
+
runs: array(DeviceRunSchema).readonly(),
|
|
48491
|
+
nextCursor: string().nullable()
|
|
48492
|
+
})), method(object({
|
|
48493
|
+
deviceId: number().int(),
|
|
48494
|
+
runId: string()
|
|
48495
|
+
}), DeviceRunSchema.nullable()), method(object({ deviceId: number().int() }), DeviceRunSchema.nullable());
|
|
48263
48496
|
var DeviceCaStatusSchema = discriminatedUnion("state", [
|
|
48264
48497
|
object({ state: literal("absent") }),
|
|
48265
48498
|
object({
|
|
@@ -48395,8 +48628,8 @@ method(object({}), object({
|
|
|
48395
48628
|
});
|
|
48396
48629
|
var KeychainKeySourceSchema = object({
|
|
48397
48630
|
kind: _enum([
|
|
48398
|
-
"
|
|
48399
|
-
"previous-
|
|
48631
|
+
"mounted-file",
|
|
48632
|
+
"previous-mounted-file",
|
|
48400
48633
|
"platform",
|
|
48401
48634
|
"default-file"
|
|
48402
48635
|
]),
|
|
@@ -52955,7 +53188,8 @@ var PALETTE_ENTRY_IDS = [
|
|
|
52955
53188
|
"switch",
|
|
52956
53189
|
"siren",
|
|
52957
53190
|
"button",
|
|
52958
|
-
"doorbell"
|
|
53191
|
+
"doorbell",
|
|
53192
|
+
"appliance-cycle"
|
|
52959
53193
|
];
|
|
52960
53194
|
var AUDIO_ENTRY_ID = "audio";
|
|
52961
53195
|
/** Six rungs, quiet → loud. The opaque end is the entry's hex. */
|
|
@@ -53026,7 +53260,8 @@ var CAMSTACK_HEX = {
|
|
|
53026
53260
|
switch: "#7a812a",
|
|
53027
53261
|
siren: "#ac5d7f",
|
|
53028
53262
|
button: "#b276cd",
|
|
53029
|
-
doorbell: "#0087ab"
|
|
53263
|
+
doorbell: "#0087ab",
|
|
53264
|
+
"appliance-cycle": "#2a8c8c"
|
|
53030
53265
|
};
|
|
53031
53266
|
var CAMSTACK_FALLBACK = [
|
|
53032
53267
|
"#b34dc7",
|
|
@@ -53091,7 +53326,8 @@ var HIGH_CONTRAST_HEX = {
|
|
|
53091
53326
|
switch: "#d05259",
|
|
53092
53327
|
siren: "#cd67b3",
|
|
53093
53328
|
button: "#c9746a",
|
|
53094
|
-
doorbell: "#338eeb"
|
|
53329
|
+
doorbell: "#338eeb",
|
|
53330
|
+
"appliance-cycle": "#00848a"
|
|
53095
53331
|
};
|
|
53096
53332
|
var HIGH_CONTRAST_FALLBACK = [
|
|
53097
53333
|
"#817f3b",
|
|
@@ -53156,7 +53392,8 @@ var OKABE_ITO_HEX = {
|
|
|
53156
53392
|
switch: "#ad2c4e",
|
|
53157
53393
|
siren: "#348e08",
|
|
53158
53394
|
button: "#d27303",
|
|
53159
|
-
doorbell: "#55770f"
|
|
53395
|
+
doorbell: "#55770f",
|
|
53396
|
+
"appliance-cycle": "#00737d"
|
|
53160
53397
|
};
|
|
53161
53398
|
var OKABE_ITO_FALLBACK = [
|
|
53162
53399
|
"#9a3784",
|
|
@@ -53365,6 +53602,7 @@ sub("switch", "control", "control", "switch", "Switch");
|
|
|
53365
53602
|
sub("siren", "control", "control", "siren", "Siren");
|
|
53366
53603
|
sub("button", "control", "control", "button", "Button");
|
|
53367
53604
|
sub("doorbell", "control", "control", "doorbell", "Doorbell");
|
|
53605
|
+
sub("appliance-cycle", "control", "control", "switch", "Appliance cycle");
|
|
53368
53606
|
for (const l of AUDIO_MACRO_LABELS) {
|
|
53369
53607
|
const kind = `audio-${l.id}`;
|
|
53370
53608
|
if (entries.has(kind)) continue;
|
|
@@ -62012,7 +62250,8 @@ var CAP_TO_KIND = {
|
|
|
62012
62250
|
cover: "cover",
|
|
62013
62251
|
switch: "switch",
|
|
62014
62252
|
button: "button",
|
|
62015
|
-
doorbell: "doorbell"
|
|
62253
|
+
doorbell: "doorbell",
|
|
62254
|
+
"running-state": "appliance-cycle"
|
|
62016
62255
|
};
|
|
62017
62256
|
function buildDescriptor(capName, kind) {
|
|
62018
62257
|
const t = EVENT_TAXONOMY[kind];
|
|
@@ -65214,10 +65453,7 @@ method(object({ nodeId: string().optional() }).optional(), array(AddonListItemSc
|
|
|
65214
65453
|
}), InstallPackageResultSchema, {
|
|
65215
65454
|
kind: "mutation",
|
|
65216
65455
|
auth: "admin"
|
|
65217
|
-
}), method(object({
|
|
65218
|
-
kind: "mutation",
|
|
65219
|
-
auth: "admin"
|
|
65220
|
-
}), method(_void(), boolean()), method(_void(), array(unknown()).readonly()), method(object({
|
|
65456
|
+
}), method(object({
|
|
65221
65457
|
packageName: string().min(1),
|
|
65222
65458
|
nodeId: string().optional(),
|
|
65223
65459
|
everywhere: boolean().optional()
|
|
@@ -66478,19 +66714,19 @@ var RemoteSetConfigResultSchema = discriminatedUnion("status", [object({ status:
|
|
|
66478
66714
|
reason: _enum(["unknown-template", "not-a-media-player"]),
|
|
66479
66715
|
detail: string()
|
|
66480
66716
|
})]);
|
|
66481
|
-
var deviceInput
|
|
66717
|
+
var deviceInput = object({ deviceId: number().int().nonnegative() });
|
|
66482
66718
|
DeviceType.MediaPlayer;
|
|
66483
|
-
method(deviceInput
|
|
66719
|
+
method(deviceInput, RemoteConfigSchema, { auth: "admin" }), method(deviceInput.extend({ config: RemoteConfigSchema }), RemoteSetConfigResultSchema, {
|
|
66484
66720
|
kind: "mutation",
|
|
66485
66721
|
auth: "admin"
|
|
66486
|
-
}), method(deviceInput
|
|
66722
|
+
}), method(deviceInput, RemoteCommandListSchema, { auth: "protected" }), method(deviceInput.extend({
|
|
66487
66723
|
role: RemoteRoleSchema,
|
|
66488
66724
|
/** Sends in a row (volume steps). */
|
|
66489
66725
|
repeat: number().int().min(1).max(50).default(1)
|
|
66490
66726
|
}), RemoteSendResultSchema, {
|
|
66491
66727
|
kind: "mutation",
|
|
66492
66728
|
auth: "protected"
|
|
66493
|
-
}), method(deviceInput
|
|
66729
|
+
}), method(deviceInput.extend({
|
|
66494
66730
|
command: RemoteMediaCommandSchema,
|
|
66495
66731
|
muted: boolean().optional(),
|
|
66496
66732
|
source: string().optional(),
|
|
@@ -70853,117 +71089,6 @@ var lockControlCapability = {
|
|
|
70853
71089
|
* whether persisting is worth a SQLite commit. */
|
|
70854
71090
|
volatileStateFields: ["lastChangedAt"]
|
|
70855
71091
|
};
|
|
70856
|
-
var PowerSourceRefusalReasonSchema = _enum([
|
|
70857
|
-
"no-power-source",
|
|
70858
|
-
"switch-missing",
|
|
70859
|
-
"switch-offline",
|
|
70860
|
-
"switch-unknown",
|
|
70861
|
-
"restart-in-progress",
|
|
70862
|
-
"switch-call-failed"
|
|
70863
|
-
]);
|
|
70864
|
-
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
70865
|
-
accepted: literal(false),
|
|
70866
|
-
reason: PowerSourceRefusalReasonSchema,
|
|
70867
|
-
/** One line for the operator, naming the switch. */
|
|
70868
|
-
message: string()
|
|
70869
|
-
})]);
|
|
70870
|
-
var PowerSourceInfoSchema = object({
|
|
70871
|
-
/** False when the device has no power source linked; the rest is then empty. */
|
|
70872
|
-
linked: boolean(),
|
|
70873
|
-
switchDeviceId: number().nullable(),
|
|
70874
|
-
switchName: string().nullable(),
|
|
70875
|
-
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
70876
|
-
switchOn: boolean().nullable(),
|
|
70877
|
-
switchOnline: boolean().nullable(),
|
|
70878
|
-
restartInProgress: boolean(),
|
|
70879
|
-
offSeconds: number().int()
|
|
70880
|
-
});
|
|
70881
|
-
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
70882
|
-
var PowerSourceStateSchema = object({
|
|
70883
|
-
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
70884
|
-
switchOn: boolean().nullable(),
|
|
70885
|
-
offSeconds: number().int(),
|
|
70886
|
-
lastFetchedAt: number()
|
|
70887
|
-
});
|
|
70888
|
-
var POWER_SOURCE_DEVICE_TYPES = [
|
|
70889
|
-
DeviceType.Gateway,
|
|
70890
|
-
DeviceType.Hub,
|
|
70891
|
-
DeviceType.Camera,
|
|
70892
|
-
DeviceType.Sensor,
|
|
70893
|
-
DeviceType.MediaPlayer,
|
|
70894
|
-
DeviceType.Vacuum,
|
|
70895
|
-
DeviceType.Generic,
|
|
70896
|
-
DeviceType.Washer,
|
|
70897
|
-
DeviceType.Dryer,
|
|
70898
|
-
DeviceType.Dishwasher,
|
|
70899
|
-
DeviceType.PetFountain,
|
|
70900
|
-
DeviceType.Fan,
|
|
70901
|
-
DeviceType.Humidifier,
|
|
70902
|
-
DeviceType.Climate,
|
|
70903
|
-
DeviceType.WaterHeater
|
|
70904
|
-
];
|
|
70905
|
-
var powerSourceCustomize = {
|
|
70906
|
-
version: 1,
|
|
70907
|
-
targets: [{
|
|
70908
|
-
id: "switch",
|
|
70909
|
-
cardinality: "scalar",
|
|
70910
|
-
vocabulary: {
|
|
70911
|
-
cap: "power-source",
|
|
70912
|
-
stateField: "switchOn"
|
|
70913
|
-
},
|
|
70914
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
70915
|
-
apply: "add",
|
|
70916
|
-
path: "switchOn",
|
|
70917
|
-
sources: [{
|
|
70918
|
-
kind: "switch",
|
|
70919
|
-
transforms: [{ kind: "identity" }]
|
|
70920
|
-
}],
|
|
70921
|
-
companions: [{
|
|
70922
|
-
kind: "constant",
|
|
70923
|
-
path: "offSeconds",
|
|
70924
|
-
value: 10,
|
|
70925
|
-
when: "add"
|
|
70926
|
-
}, {
|
|
70927
|
-
kind: "clock",
|
|
70928
|
-
path: "lastFetchedAt",
|
|
70929
|
-
when: "always"
|
|
70930
|
-
}],
|
|
70931
|
-
sourceReport: { status: "assignment-status" }
|
|
70932
|
-
}]
|
|
70933
|
-
};
|
|
70934
|
-
var deviceInput = object({ deviceId: number().int().nonnegative() });
|
|
70935
|
-
var powerSourceCapability = {
|
|
70936
|
-
name: "power-source",
|
|
70937
|
-
scope: "device",
|
|
70938
|
-
mode: "singleton",
|
|
70939
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
70940
|
-
methods: {
|
|
70941
|
-
getStatus: systemMethod(deviceInput, PowerSourceInfoSchema, { auth: "admin" }),
|
|
70942
|
-
powerOn: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70943
|
-
kind: "mutation",
|
|
70944
|
-
auth: "admin"
|
|
70945
|
-
}),
|
|
70946
|
-
powerOff: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70947
|
-
kind: "mutation",
|
|
70948
|
-
auth: "admin"
|
|
70949
|
-
}),
|
|
70950
|
-
forceRestart: systemMethod(deviceInput, PowerSourceActionResultSchema, {
|
|
70951
|
-
kind: "mutation",
|
|
70952
|
-
auth: "admin"
|
|
70953
|
-
})
|
|
70954
|
-
},
|
|
70955
|
-
runtimeState: PowerSourceStateSchema,
|
|
70956
|
-
customize: powerSourceCustomize,
|
|
70957
|
-
/**
|
|
70958
|
-
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
70959
|
-
* its next report; a restored value would outlive the reading it names.
|
|
70960
|
-
*
|
|
70961
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
70962
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
70963
|
-
*/
|
|
70964
|
-
durability: "session",
|
|
70965
|
-
history: "none"
|
|
70966
|
-
};
|
|
70967
71092
|
/**
|
|
70968
71093
|
* A monotonic total between resets (D944). Energy uses `power-meter.energy`
|
|
70969
71094
|
* so dashboards keep one series; every other instantaneous reading lands here.
|
|
@@ -74513,6 +74638,10 @@ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
|
|
|
74513
74638
|
/** Generic Customize target for the running boolean (D936). */
|
|
74514
74639
|
var runningCustomize = {
|
|
74515
74640
|
version: 1,
|
|
74641
|
+
overridable: [{
|
|
74642
|
+
path: "running",
|
|
74643
|
+
by: "running"
|
|
74644
|
+
}],
|
|
74516
74645
|
targets: [{
|
|
74517
74646
|
id: "running",
|
|
74518
74647
|
cardinality: "scalar",
|
|
@@ -74570,7 +74699,7 @@ var runningCustomize = {
|
|
|
74570
74699
|
kind: "constant",
|
|
74571
74700
|
path: "phase",
|
|
74572
74701
|
value: null,
|
|
74573
|
-
when: "
|
|
74702
|
+
when: "add"
|
|
74574
74703
|
},
|
|
74575
74704
|
{
|
|
74576
74705
|
kind: "clock",
|
|
@@ -77854,7 +77983,7 @@ var ExternalIdentityKeySchema = object({
|
|
|
77854
77983
|
provider: string().min(1),
|
|
77855
77984
|
subject: string().min(1)
|
|
77856
77985
|
});
|
|
77857
|
-
method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
|
|
77986
|
+
method(_void(), array(UserSummarySchema), { auth: "admin" }), method(_void(), object({ defaultPasswordInUse: boolean() }), { auth: "admin" }), method(CreateUserInputSchema, UserSummarySchema, {
|
|
77858
77987
|
kind: "mutation",
|
|
77859
77988
|
auth: "admin",
|
|
77860
77989
|
access: "create"
|
|
@@ -81230,13 +81359,6 @@ Object.freeze({
|
|
|
81230
81359
|
access: "view",
|
|
81231
81360
|
role: "admin"
|
|
81232
81361
|
},
|
|
81233
|
-
"addons.installFromWorkspace": {
|
|
81234
|
-
capName: "addons",
|
|
81235
|
-
capScope: "system",
|
|
81236
|
-
addonId: null,
|
|
81237
|
-
access: "create",
|
|
81238
|
-
role: "admin"
|
|
81239
|
-
},
|
|
81240
81362
|
"addons.installPackage": {
|
|
81241
81363
|
capName: "addons",
|
|
81242
81364
|
capScope: "system",
|
|
@@ -81244,13 +81366,6 @@ Object.freeze({
|
|
|
81244
81366
|
access: "create",
|
|
81245
81367
|
role: "admin"
|
|
81246
81368
|
},
|
|
81247
|
-
"addons.isWorkspaceAvailable": {
|
|
81248
|
-
capName: "addons",
|
|
81249
|
-
capScope: "system",
|
|
81250
|
-
addonId: null,
|
|
81251
|
-
access: "view",
|
|
81252
|
-
role: "admin"
|
|
81253
|
-
},
|
|
81254
81369
|
"addons.list": {
|
|
81255
81370
|
capName: "addons",
|
|
81256
81371
|
capScope: "system",
|
|
@@ -81300,13 +81415,6 @@ Object.freeze({
|
|
|
81300
81415
|
access: "view",
|
|
81301
81416
|
role: "admin"
|
|
81302
81417
|
},
|
|
81303
|
-
"addons.listWorkspacePackages": {
|
|
81304
|
-
capName: "addons",
|
|
81305
|
-
capScope: "system",
|
|
81306
|
-
addonId: null,
|
|
81307
|
-
access: "view",
|
|
81308
|
-
role: "admin"
|
|
81309
|
-
},
|
|
81310
81418
|
"addons.onAddonLogs": {
|
|
81311
81419
|
capName: "addons",
|
|
81312
81420
|
capScope: "system",
|
|
@@ -83974,6 +84082,27 @@ Object.freeze({
|
|
|
83974
84082
|
access: "create",
|
|
83975
84083
|
role: "admin"
|
|
83976
84084
|
},
|
|
84085
|
+
"deviceRuns.getCurrentRun": {
|
|
84086
|
+
capName: "device-runs",
|
|
84087
|
+
capScope: "device",
|
|
84088
|
+
addonId: null,
|
|
84089
|
+
access: "view",
|
|
84090
|
+
role: "viewer"
|
|
84091
|
+
},
|
|
84092
|
+
"deviceRuns.getRun": {
|
|
84093
|
+
capName: "device-runs",
|
|
84094
|
+
capScope: "device",
|
|
84095
|
+
addonId: null,
|
|
84096
|
+
access: "view",
|
|
84097
|
+
role: "viewer"
|
|
84098
|
+
},
|
|
84099
|
+
"deviceRuns.listRuns": {
|
|
84100
|
+
capName: "device-runs",
|
|
84101
|
+
capScope: "device",
|
|
84102
|
+
addonId: null,
|
|
84103
|
+
access: "view",
|
|
84104
|
+
role: "viewer"
|
|
84105
|
+
},
|
|
83977
84106
|
"deviceState.claimFields": {
|
|
83978
84107
|
capName: "device-state",
|
|
83979
84108
|
capScope: "system",
|
|
@@ -90687,6 +90816,13 @@ Object.freeze({
|
|
|
90687
90816
|
access: "view",
|
|
90688
90817
|
role: "admin"
|
|
90689
90818
|
},
|
|
90819
|
+
"userManagement.getAdminBootstrapStatus": {
|
|
90820
|
+
capName: "user-management",
|
|
90821
|
+
capScope: "system",
|
|
90822
|
+
addonId: null,
|
|
90823
|
+
access: "view",
|
|
90824
|
+
role: "admin"
|
|
90825
|
+
},
|
|
90690
90826
|
"userManagement.getTotpStatus": {
|
|
90691
90827
|
capName: "user-management",
|
|
90692
90828
|
capScope: "system",
|
|
@@ -92183,6 +92319,21 @@ Object.freeze({
|
|
|
92183
92319
|
form: "single",
|
|
92184
92320
|
optional: false
|
|
92185
92321
|
}],
|
|
92322
|
+
"deviceRuns.getCurrentRun": [{
|
|
92323
|
+
name: "deviceId",
|
|
92324
|
+
form: "single",
|
|
92325
|
+
optional: false
|
|
92326
|
+
}],
|
|
92327
|
+
"deviceRuns.getRun": [{
|
|
92328
|
+
name: "deviceId",
|
|
92329
|
+
form: "single",
|
|
92330
|
+
optional: false
|
|
92331
|
+
}],
|
|
92332
|
+
"deviceRuns.listRuns": [{
|
|
92333
|
+
name: "deviceId",
|
|
92334
|
+
form: "single",
|
|
92335
|
+
optional: false
|
|
92336
|
+
}],
|
|
92186
92337
|
"deviceState.claimFields": [{
|
|
92187
92338
|
name: "deviceId",
|
|
92188
92339
|
form: "single",
|
|
@@ -94929,13 +95080,114 @@ NC_AUDIO_DEFAULTS.hitPercent, NC_AUDIO_DEFAULTS.samplingSeconds;
|
|
|
94929
95080
|
*
|
|
94930
95081
|
* Pure, RN-safe: the viewer imports the support rule from here.
|
|
94931
95082
|
*/
|
|
95083
|
+
/**
|
|
95084
|
+
* Control caps that still have a raise and a clear an operator names: an
|
|
95085
|
+
* appliance cycle raises when it STARTS and clears when it FINISHES. Kept out
|
|
95086
|
+
* of `SOURCE_CAP_ACTIVE_FIELD` on purpose — that table also makes a device a
|
|
95087
|
+
* camera-sensor / recorder-trigger source, and a dishwasher is neither.
|
|
95088
|
+
*/
|
|
95089
|
+
var CYCLE_RAISED_FIELD_BY_CAP = { "running-state": "running" };
|
|
94932
95090
|
/** Event kind → the boolean field of its cap slice that means "raised". */
|
|
94933
95091
|
var NC_SENSOR_RAISED_FIELD_BY_KIND = Object.freeze(Object.fromEntries(Object.entries(EVENT_KIND_BY_CAP).flatMap(([capName, descriptor]) => {
|
|
95092
|
+
const cycleField = CYCLE_RAISED_FIELD_BY_CAP[capName];
|
|
95093
|
+
if (cycleField !== void 0) return [[descriptor.kind, cycleField]];
|
|
94934
95094
|
const field = SOURCE_CAP_ACTIVE_FIELD[capName];
|
|
94935
95095
|
if (field === void 0 || descriptor.category !== "sensor") return [];
|
|
94936
95096
|
return [[descriptor.kind, field]];
|
|
94937
95097
|
})));
|
|
94938
95098
|
Object.freeze(Object.keys(NC_SENSOR_RAISED_FIELD_BY_KIND));
|
|
95099
|
+
Object.freeze({
|
|
95100
|
+
contact: {
|
|
95101
|
+
starts: {
|
|
95102
|
+
en: "opened",
|
|
95103
|
+
it: "si apre"
|
|
95104
|
+
},
|
|
95105
|
+
finishes: {
|
|
95106
|
+
en: "closed",
|
|
95107
|
+
it: "si chiude"
|
|
95108
|
+
}
|
|
95109
|
+
},
|
|
95110
|
+
"motion-sensor": {
|
|
95111
|
+
starts: {
|
|
95112
|
+
en: "motion detected",
|
|
95113
|
+
it: "movimento rilevato"
|
|
95114
|
+
},
|
|
95115
|
+
finishes: {
|
|
95116
|
+
en: "motion stopped",
|
|
95117
|
+
it: "movimento terminato"
|
|
95118
|
+
}
|
|
95119
|
+
},
|
|
95120
|
+
smoke: {
|
|
95121
|
+
starts: {
|
|
95122
|
+
en: "smoke detected",
|
|
95123
|
+
it: "fumo rilevato"
|
|
95124
|
+
},
|
|
95125
|
+
finishes: {
|
|
95126
|
+
en: "smoke gone",
|
|
95127
|
+
it: "fumo scomparso"
|
|
95128
|
+
}
|
|
95129
|
+
},
|
|
95130
|
+
flood: {
|
|
95131
|
+
starts: {
|
|
95132
|
+
en: "water detected",
|
|
95133
|
+
it: "acqua rilevata"
|
|
95134
|
+
},
|
|
95135
|
+
finishes: {
|
|
95136
|
+
en: "dry again",
|
|
95137
|
+
it: "di nuovo asciutto"
|
|
95138
|
+
}
|
|
95139
|
+
},
|
|
95140
|
+
gas: {
|
|
95141
|
+
starts: {
|
|
95142
|
+
en: "gas detected",
|
|
95143
|
+
it: "gas rilevato"
|
|
95144
|
+
},
|
|
95145
|
+
finishes: {
|
|
95146
|
+
en: "gas gone",
|
|
95147
|
+
it: "gas scomparso"
|
|
95148
|
+
}
|
|
95149
|
+
},
|
|
95150
|
+
"carbon-monoxide": {
|
|
95151
|
+
starts: {
|
|
95152
|
+
en: "carbon monoxide detected",
|
|
95153
|
+
it: "monossido rilevato"
|
|
95154
|
+
},
|
|
95155
|
+
finishes: {
|
|
95156
|
+
en: "carbon monoxide gone",
|
|
95157
|
+
it: "monossido scomparso"
|
|
95158
|
+
}
|
|
95159
|
+
},
|
|
95160
|
+
vibration: {
|
|
95161
|
+
starts: {
|
|
95162
|
+
en: "vibration detected",
|
|
95163
|
+
it: "vibrazione rilevata"
|
|
95164
|
+
},
|
|
95165
|
+
finishes: {
|
|
95166
|
+
en: "vibration stopped",
|
|
95167
|
+
it: "vibrazione terminata"
|
|
95168
|
+
}
|
|
95169
|
+
},
|
|
95170
|
+
tamper: {
|
|
95171
|
+
starts: {
|
|
95172
|
+
en: "tampered with",
|
|
95173
|
+
it: "manomesso"
|
|
95174
|
+
},
|
|
95175
|
+
finishes: {
|
|
95176
|
+
en: "tamper cleared",
|
|
95177
|
+
it: "manomissione rientrata"
|
|
95178
|
+
}
|
|
95179
|
+
},
|
|
95180
|
+
"appliance-cycle": {
|
|
95181
|
+
starts: {
|
|
95182
|
+
en: "the cycle started",
|
|
95183
|
+
it: "il ciclo parte"
|
|
95184
|
+
},
|
|
95185
|
+
finishes: {
|
|
95186
|
+
en: "the cycle finished",
|
|
95187
|
+
it: "il ciclo è terminato"
|
|
95188
|
+
}
|
|
95189
|
+
}
|
|
95190
|
+
});
|
|
94939
95191
|
object({
|
|
94940
95192
|
phase: _enum(["raised", "resolved"]),
|
|
94941
95193
|
episodeId: string().min(1),
|
|
@@ -95142,6 +95394,10 @@ var STATE_SUMMARY_VARS = [
|
|
|
95142
95394
|
[...RULE_TEXT],
|
|
95143
95395
|
[...RULE_TEXT],
|
|
95144
95396
|
[...RULE_TEXT],
|
|
95397
|
+
[...RULE_TEXT],
|
|
95398
|
+
[...RULE_TEXT],
|
|
95399
|
+
[...RULE_TEXT],
|
|
95400
|
+
[...RULE_TEXT],
|
|
95145
95401
|
[...RULE_BODY_ONLY],
|
|
95146
95402
|
[...RULE_TEXT],
|
|
95147
95403
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
@@ -95159,6 +95415,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
95159
95415
|
[...RULE_TEXT],
|
|
95160
95416
|
[...RULE_TEXT],
|
|
95161
95417
|
[...RULE_TEXT],
|
|
95418
|
+
[...RULE_TEXT],
|
|
95162
95419
|
([...RULE_TEXT], [...DEVICE_ATTENTION, ...ALERT_EPISODE]),
|
|
95163
95420
|
[...RULE_TEXT],
|
|
95164
95421
|
[...RULE_TEXT],
|
|
@@ -95403,6 +95660,7 @@ new Set([
|
|
|
95403
95660
|
"siren",
|
|
95404
95661
|
"button",
|
|
95405
95662
|
"doorbell",
|
|
95663
|
+
"appliance-cycle",
|
|
95406
95664
|
"audio-speech",
|
|
95407
95665
|
"audio-scream",
|
|
95408
95666
|
"audio-crying",
|