@camstack/types 1.2.591 → 1.2.592
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 +9 -0
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/device-state.cap.d.ts +4 -1
- package/dist/client.js +48 -0
- package/dist/client.mjs +48 -0
- package/dist/device/cap-vocabulary/command-catalog.d.ts +34 -1
- package/dist/device/cap-vocabulary/declaration.d.ts +21 -1
- package/dist/device/cap-vocabulary/hold-limits.d.ts +8 -0
- package/dist/device/cap-vocabulary/index.d.ts +3 -2
- package/dist/device/cap-vocabulary/types.d.ts +68 -0
- package/dist/device/command-hold.d.ts +54 -0
- package/dist/device/device-context.d.ts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +300 -10
- package/dist/index.mjs +293 -11
- package/dist/{sleep-BA_SIc0O.js → sleep-D2Ny6tvi.js} +409 -43
- package/dist/{sleep-BT1bLgPq.mjs → sleep-dgC2VKW4.mjs} +386 -44
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-D2Ny6tvi.js");
|
|
3
3
|
const require_event_category = require("./event-category-BKxXXxnV.js");
|
|
4
4
|
const require_composed_stable_id = require("./composed-stable-id-BdeYe5dD.js");
|
|
5
5
|
const require_implemented_methods = require("./implemented-methods-BarLh7tc.js");
|
|
@@ -37418,7 +37418,7 @@ ${hasTime ? ` /** Read the site into memory. A failed read keeps the previous v
|
|
|
37418
37418
|
` : ""} // ── the condition mirror (D49): memory only at fire time ──
|
|
37419
37419
|
async function refreshMirror(): Promise<void> {
|
|
37420
37420
|
const report = await mirror.refresh({
|
|
37421
|
-
fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
|
|
37421
|
+
fetchSlice: (deviceId, cap) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true }),
|
|
37422
37422
|
fetchStableIds: async () => {
|
|
37423
37423
|
const all = await ctx.api.deviceManager.listAll.query({})
|
|
37424
37424
|
return stableIdMapOf(all)
|
|
@@ -37432,7 +37432,7 @@ ${hasTime ? ` /** Read the site into memory. A failed read keeps the previous v
|
|
|
37432
37432
|
|
|
37433
37433
|
function mirrorFetchers() {
|
|
37434
37434
|
return {
|
|
37435
|
-
fetchSlice: (deviceId: number, cap: string) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap }),
|
|
37435
|
+
fetchSlice: (deviceId: number, cap: string) => ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true }),
|
|
37436
37436
|
fetchStableIds: async () => {
|
|
37437
37437
|
const all = await ctx.api.deviceManager.listAll.query({})
|
|
37438
37438
|
return stableIdMapOf(all)
|
|
@@ -37501,7 +37501,7 @@ ${hasTime ? ` // a time-is leaf changes sides at a boundary with no device ev
|
|
|
37501
37501
|
cap: string,
|
|
37502
37502
|
): Promise<{ readonly ok: true; readonly slice: unknown } | { readonly ok: false }> {
|
|
37503
37503
|
try {
|
|
37504
|
-
const slice = await ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap })
|
|
37504
|
+
const slice = await ctx.api.deviceState.getCapSlice.query({ deviceId, capName: cap, confirmed: true })
|
|
37505
37505
|
return { ok: true, slice }
|
|
37506
37506
|
} catch (err: unknown) {
|
|
37507
37507
|
ctx.logger.debug('device state read failed — the leaf keeps what it knew', {
|
|
@@ -37888,8 +37888,10 @@ ${hasTime ? " await refreshSite()\n" : ""} await refreshMirror()
|
|
|
37888
37888
|
const deviceId = data['deviceId']
|
|
37889
37889
|
const capName = data['capName']
|
|
37890
37890
|
if (typeof deviceId === 'number' && typeof capName === 'string') {
|
|
37891
|
-
|
|
37892
|
-
|
|
37891
|
+
// what the device reported: a held command is never a condition (D1061)
|
|
37892
|
+
const slice = data['confirmed'] ?? data['slice']
|
|
37893
|
+
mirror.apply(deviceId, capName, slice)
|
|
37894
|
+
guardMirror.apply(deviceId, capName, slice)
|
|
37893
37895
|
feedHolds()
|
|
37894
37896
|
evaluateStateTree()
|
|
37895
37897
|
}
|
|
@@ -41689,6 +41691,14 @@ var alarmPanelCapability = {
|
|
|
41689
41691
|
field: "state",
|
|
41690
41692
|
value: "disarmed"
|
|
41691
41693
|
},
|
|
41694
|
+
hold: { effects: [{
|
|
41695
|
+
field: "state",
|
|
41696
|
+
value: "disarming",
|
|
41697
|
+
when: {
|
|
41698
|
+
field: "state",
|
|
41699
|
+
notIn: ["disarmed"]
|
|
41700
|
+
}
|
|
41701
|
+
}] },
|
|
41692
41702
|
openArgs: [{
|
|
41693
41703
|
key: "code",
|
|
41694
41704
|
label: require_sleep.t("PIN code", "Codice PIN"),
|
|
@@ -41719,6 +41729,14 @@ var alarmPanelCapability = {
|
|
|
41719
41729
|
field: "state",
|
|
41720
41730
|
value: "armed_home"
|
|
41721
41731
|
},
|
|
41732
|
+
hold: { effects: [{
|
|
41733
|
+
field: "state",
|
|
41734
|
+
value: "arming",
|
|
41735
|
+
when: {
|
|
41736
|
+
field: "state",
|
|
41737
|
+
notIn: ["armed_home"]
|
|
41738
|
+
}
|
|
41739
|
+
}] },
|
|
41722
41740
|
args: { mode: "home" },
|
|
41723
41741
|
openArgs: [{
|
|
41724
41742
|
key: "code",
|
|
@@ -41739,6 +41757,14 @@ var alarmPanelCapability = {
|
|
|
41739
41757
|
field: "state",
|
|
41740
41758
|
value: "armed_away"
|
|
41741
41759
|
},
|
|
41760
|
+
hold: { effects: [{
|
|
41761
|
+
field: "state",
|
|
41762
|
+
value: "arming",
|
|
41763
|
+
when: {
|
|
41764
|
+
field: "state",
|
|
41765
|
+
notIn: ["armed_away"]
|
|
41766
|
+
}
|
|
41767
|
+
}] },
|
|
41742
41768
|
args: { mode: "away" },
|
|
41743
41769
|
openArgs: [{
|
|
41744
41770
|
key: "code",
|
|
@@ -41759,6 +41785,14 @@ var alarmPanelCapability = {
|
|
|
41759
41785
|
field: "state",
|
|
41760
41786
|
value: "armed_night"
|
|
41761
41787
|
},
|
|
41788
|
+
hold: { effects: [{
|
|
41789
|
+
field: "state",
|
|
41790
|
+
value: "arming",
|
|
41791
|
+
when: {
|
|
41792
|
+
field: "state",
|
|
41793
|
+
notIn: ["armed_night"]
|
|
41794
|
+
}
|
|
41795
|
+
}] },
|
|
41762
41796
|
args: { mode: "night" },
|
|
41763
41797
|
openArgs: [{
|
|
41764
41798
|
key: "code",
|
|
@@ -41779,6 +41813,14 @@ var alarmPanelCapability = {
|
|
|
41779
41813
|
field: "state",
|
|
41780
41814
|
value: "armed_vacation"
|
|
41781
41815
|
},
|
|
41816
|
+
hold: { effects: [{
|
|
41817
|
+
field: "state",
|
|
41818
|
+
value: "arming",
|
|
41819
|
+
when: {
|
|
41820
|
+
field: "state",
|
|
41821
|
+
notIn: ["armed_vacation"]
|
|
41822
|
+
}
|
|
41823
|
+
}] },
|
|
41782
41824
|
args: { mode: "vacation" },
|
|
41783
41825
|
openArgs: [{
|
|
41784
41826
|
key: "code",
|
|
@@ -41799,6 +41841,14 @@ var alarmPanelCapability = {
|
|
|
41799
41841
|
field: "state",
|
|
41800
41842
|
value: "armed_custom_bypass"
|
|
41801
41843
|
},
|
|
41844
|
+
hold: { effects: [{
|
|
41845
|
+
field: "state",
|
|
41846
|
+
value: "arming",
|
|
41847
|
+
when: {
|
|
41848
|
+
field: "state",
|
|
41849
|
+
notIn: ["armed_custom_bypass"]
|
|
41850
|
+
}
|
|
41851
|
+
}] },
|
|
41802
41852
|
args: { mode: "custom_bypass" },
|
|
41803
41853
|
openArgs: [{
|
|
41804
41854
|
key: "code",
|
|
@@ -42689,6 +42739,10 @@ var automationControlCapability = {
|
|
|
42689
42739
|
auth: "admin",
|
|
42690
42740
|
actions: [{
|
|
42691
42741
|
id: "haAutomation.enable",
|
|
42742
|
+
effect: {
|
|
42743
|
+
field: "enabled",
|
|
42744
|
+
value: true
|
|
42745
|
+
},
|
|
42692
42746
|
label: require_sleep.t("Enable automation", "Abilita l’automazione"),
|
|
42693
42747
|
phrase: require_sleep.t("Enable {device}", "Abilita {device}"),
|
|
42694
42748
|
icon: "toggle-right"
|
|
@@ -42699,6 +42753,10 @@ var automationControlCapability = {
|
|
|
42699
42753
|
auth: "admin",
|
|
42700
42754
|
actions: [{
|
|
42701
42755
|
id: "haAutomation.disable",
|
|
42756
|
+
effect: {
|
|
42757
|
+
field: "enabled",
|
|
42758
|
+
value: false
|
|
42759
|
+
},
|
|
42702
42760
|
label: require_sleep.t("Disable automation", "Disabilita l’automazione"),
|
|
42703
42761
|
phrase: require_sleep.t("Disable {device}", "Disabilita {device}"),
|
|
42704
42762
|
icon: "toggle-left"
|
|
@@ -46231,6 +46289,14 @@ var climateControlCapability = {
|
|
|
46231
46289
|
label: require_sleep.t("Set temperature range", "Imposta l’intervallo di temperatura"),
|
|
46232
46290
|
phrase: require_sleep.t("Keep {device} between {targetLow} and {targetHigh}", "Mantieni {device} tra {targetLow} e {targetHigh}"),
|
|
46233
46291
|
icon: "thermometer",
|
|
46292
|
+
effect: {
|
|
46293
|
+
field: "targetLow",
|
|
46294
|
+
fromArg: "targetLow"
|
|
46295
|
+
},
|
|
46296
|
+
sideEffects: [{
|
|
46297
|
+
field: "targetHigh",
|
|
46298
|
+
fromArg: "targetHigh"
|
|
46299
|
+
}],
|
|
46234
46300
|
openArgs: [{
|
|
46235
46301
|
key: "targetLow",
|
|
46236
46302
|
label: require_sleep.t("Lowest", "Minima"),
|
|
@@ -46289,6 +46355,10 @@ var climateControlCapability = {
|
|
|
46289
46355
|
label: require_sleep.t("Set fan mode", "Imposta la ventilazione"),
|
|
46290
46356
|
phrase: require_sleep.t("Set the fan of {device} to {fanMode}", "Imposta la ventilazione di {device} su {fanMode}"),
|
|
46291
46357
|
icon: "fan",
|
|
46358
|
+
effect: {
|
|
46359
|
+
field: "fanMode",
|
|
46360
|
+
fromArg: "fanMode"
|
|
46361
|
+
},
|
|
46292
46362
|
openArgs: [{
|
|
46293
46363
|
key: "fanMode",
|
|
46294
46364
|
label: require_sleep.t("Fan mode", "Ventilazione"),
|
|
@@ -46311,6 +46381,10 @@ var climateControlCapability = {
|
|
|
46311
46381
|
label: require_sleep.t("Set preset", "Imposta il preset"),
|
|
46312
46382
|
phrase: require_sleep.t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
|
|
46313
46383
|
icon: "list",
|
|
46384
|
+
effect: {
|
|
46385
|
+
field: "preset",
|
|
46386
|
+
fromArg: "preset"
|
|
46387
|
+
},
|
|
46314
46388
|
openArgs: [{
|
|
46315
46389
|
key: "preset",
|
|
46316
46390
|
label: require_sleep.t("Preset", "Preset"),
|
|
@@ -48627,6 +48701,10 @@ var mediaPlayerCapability = {
|
|
|
48627
48701
|
auth: "protected",
|
|
48628
48702
|
actions: [{
|
|
48629
48703
|
id: "media.play",
|
|
48704
|
+
effect: {
|
|
48705
|
+
field: "state",
|
|
48706
|
+
value: "playing"
|
|
48707
|
+
},
|
|
48630
48708
|
label: require_sleep.t("Play", "Riproduci"),
|
|
48631
48709
|
phrase: require_sleep.t("Play on {device}", "Avvia la riproduzione su {device}"),
|
|
48632
48710
|
icon: "play"
|
|
@@ -48637,6 +48715,10 @@ var mediaPlayerCapability = {
|
|
|
48637
48715
|
auth: "protected",
|
|
48638
48716
|
actions: [{
|
|
48639
48717
|
id: "media.pause",
|
|
48718
|
+
effect: {
|
|
48719
|
+
field: "state",
|
|
48720
|
+
value: "paused"
|
|
48721
|
+
},
|
|
48640
48722
|
label: require_sleep.t("Pause media", "Metti in pausa"),
|
|
48641
48723
|
phrase: require_sleep.t("Pause {device}", "Metti in pausa {device}"),
|
|
48642
48724
|
icon: "pause"
|
|
@@ -48680,6 +48762,10 @@ var mediaPlayerCapability = {
|
|
|
48680
48762
|
auth: "protected",
|
|
48681
48763
|
actions: [{
|
|
48682
48764
|
id: "media.volume",
|
|
48765
|
+
effect: {
|
|
48766
|
+
field: "volumeLevel",
|
|
48767
|
+
fromArg: "volumeLevel"
|
|
48768
|
+
},
|
|
48683
48769
|
label: require_sleep.t("Set volume", "Imposta il volume"),
|
|
48684
48770
|
phrase: require_sleep.t("Set the volume of {device} to {volumeLevel}", "Imposta il volume di {device} al {volumeLevel}"),
|
|
48685
48771
|
icon: "volume-2",
|
|
@@ -48704,12 +48790,20 @@ var mediaPlayerCapability = {
|
|
|
48704
48790
|
auth: "protected",
|
|
48705
48791
|
actions: [{
|
|
48706
48792
|
id: "media.mute",
|
|
48793
|
+
effect: {
|
|
48794
|
+
field: "isMuted",
|
|
48795
|
+
value: true
|
|
48796
|
+
},
|
|
48707
48797
|
label: require_sleep.t("Mute", "Silenzia"),
|
|
48708
48798
|
phrase: require_sleep.t("Mute {device}", "Silenzia {device}"),
|
|
48709
48799
|
icon: "volume-x",
|
|
48710
48800
|
args: { muted: true }
|
|
48711
48801
|
}, {
|
|
48712
48802
|
id: "media.unmute",
|
|
48803
|
+
effect: {
|
|
48804
|
+
field: "isMuted",
|
|
48805
|
+
value: false
|
|
48806
|
+
},
|
|
48713
48807
|
label: require_sleep.t("Unmute", "Riattiva l’audio"),
|
|
48714
48808
|
phrase: require_sleep.t("Unmute {device}", "Riattiva l’audio di {device}"),
|
|
48715
48809
|
icon: "volume-2",
|
|
@@ -48724,12 +48818,20 @@ var mediaPlayerCapability = {
|
|
|
48724
48818
|
auth: "protected",
|
|
48725
48819
|
actions: [{
|
|
48726
48820
|
id: "media.shuffleOn",
|
|
48821
|
+
effect: {
|
|
48822
|
+
field: "shuffle",
|
|
48823
|
+
value: true
|
|
48824
|
+
},
|
|
48727
48825
|
label: require_sleep.t("Shuffle on", "Riproduzione casuale attiva"),
|
|
48728
48826
|
phrase: require_sleep.t("Turn on shuffle on {device}", "Attiva la riproduzione casuale su {device}"),
|
|
48729
48827
|
icon: "shuffle",
|
|
48730
48828
|
args: { shuffle: true }
|
|
48731
48829
|
}, {
|
|
48732
48830
|
id: "media.shuffleOff",
|
|
48831
|
+
effect: {
|
|
48832
|
+
field: "shuffle",
|
|
48833
|
+
value: false
|
|
48834
|
+
},
|
|
48733
48835
|
label: require_sleep.t("Shuffle off", "Riproduzione casuale spenta"),
|
|
48734
48836
|
phrase: require_sleep.t("Turn off shuffle on {device}", "Disattiva la riproduzione casuale su {device}"),
|
|
48735
48837
|
icon: "shuffle",
|
|
@@ -48744,6 +48846,10 @@ var mediaPlayerCapability = {
|
|
|
48744
48846
|
auth: "protected",
|
|
48745
48847
|
actions: [{
|
|
48746
48848
|
id: "media.repeat",
|
|
48849
|
+
effect: {
|
|
48850
|
+
field: "repeat",
|
|
48851
|
+
fromArg: "repeat"
|
|
48852
|
+
},
|
|
48747
48853
|
label: require_sleep.t("Set repeat", "Imposta la ripetizione"),
|
|
48748
48854
|
phrase: require_sleep.t("Set repeat on {device} to {repeat}", "Imposta la ripetizione di {device} su {repeat}"),
|
|
48749
48855
|
icon: "repeat",
|
|
@@ -48778,6 +48884,10 @@ var mediaPlayerCapability = {
|
|
|
48778
48884
|
auth: "protected",
|
|
48779
48885
|
actions: [{
|
|
48780
48886
|
id: "media.source",
|
|
48887
|
+
effect: {
|
|
48888
|
+
field: "source",
|
|
48889
|
+
fromArg: "source"
|
|
48890
|
+
},
|
|
48781
48891
|
label: require_sleep.t("Select source", "Scegli la sorgente"),
|
|
48782
48892
|
phrase: require_sleep.t("Switch {device} to {source}", "Passa {device} alla sorgente {source}"),
|
|
48783
48893
|
icon: "cast",
|
|
@@ -59950,7 +60060,9 @@ var deviceStateCapability = {
|
|
|
59950
60060
|
*/
|
|
59951
60061
|
getCapSlice: require_sleep.method(zod.z.object({
|
|
59952
60062
|
deviceId: zod.z.number(),
|
|
59953
|
-
capName: zod.z.string()
|
|
60063
|
+
capName: zod.z.string(),
|
|
60064
|
+
/** The slice the device CONFIRMED, without a held command (D1061) — history and automations. */
|
|
60065
|
+
confirmed: zod.z.boolean().optional()
|
|
59954
60066
|
}), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
|
|
59955
60067
|
/**
|
|
59956
60068
|
* Whole-system snapshot — every device's full state in one
|
|
@@ -59959,7 +60071,9 @@ var deviceStateCapability = {
|
|
|
59959
60071
|
* `sm.getDeviceById(id).state.<cap>.value` is sync. Empty inner
|
|
59960
60072
|
* record for devices that haven't emitted any slice yet.
|
|
59961
60073
|
*/
|
|
59962
|
-
getAllSnapshots: require_sleep.method(zod.z.object({
|
|
60074
|
+
getAllSnapshots: require_sleep.method(zod.z.object({
|
|
60075
|
+
/** The slices the devices CONFIRMED, without held commands (D1061). */
|
|
60076
|
+
confirmed: zod.z.boolean().optional() }), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.record(zod.z.string(), zod.z.unknown())))),
|
|
59963
60077
|
/**
|
|
59964
60078
|
* Canonical cross-layer WRITE for one cap-keyed slice. Used by
|
|
59965
60079
|
* everyone who needs to publish runtime state for a device:
|
|
@@ -63041,7 +63155,15 @@ var fanControlCapability = {
|
|
|
63041
63155
|
field: "speed",
|
|
63042
63156
|
value: 100
|
|
63043
63157
|
},
|
|
63044
|
-
args: { speed: 100 }
|
|
63158
|
+
args: { speed: 100 },
|
|
63159
|
+
sideEffects: [{
|
|
63160
|
+
field: "preset",
|
|
63161
|
+
value: "",
|
|
63162
|
+
when: {
|
|
63163
|
+
field: "preset",
|
|
63164
|
+
notIn: [""]
|
|
63165
|
+
}
|
|
63166
|
+
}]
|
|
63045
63167
|
},
|
|
63046
63168
|
{
|
|
63047
63169
|
id: "fan.speed",
|
|
@@ -63052,6 +63174,14 @@ var fanControlCapability = {
|
|
|
63052
63174
|
field: "speed",
|
|
63053
63175
|
fromArg: "speed"
|
|
63054
63176
|
},
|
|
63177
|
+
sideEffects: [{
|
|
63178
|
+
field: "preset",
|
|
63179
|
+
value: "",
|
|
63180
|
+
when: {
|
|
63181
|
+
field: "preset",
|
|
63182
|
+
notIn: [""]
|
|
63183
|
+
}
|
|
63184
|
+
}],
|
|
63055
63185
|
openArgs: [{
|
|
63056
63186
|
key: "speed",
|
|
63057
63187
|
label: require_sleep.t("Speed", "Velocità"),
|
|
@@ -63077,6 +63207,10 @@ var fanControlCapability = {
|
|
|
63077
63207
|
label: require_sleep.t("Set preset", "Imposta il preset"),
|
|
63078
63208
|
phrase: require_sleep.t("Set {device} to preset {preset}", "Imposta {device} sul preset {preset}"),
|
|
63079
63209
|
icon: "list",
|
|
63210
|
+
effect: {
|
|
63211
|
+
field: "preset",
|
|
63212
|
+
fromArg: "preset"
|
|
63213
|
+
},
|
|
63080
63214
|
openArgs: [{
|
|
63081
63215
|
key: "preset",
|
|
63082
63216
|
label: require_sleep.t("Preset", "Preset"),
|
|
@@ -70031,6 +70165,14 @@ var lockControlCapability = {
|
|
|
70031
70165
|
field: "state",
|
|
70032
70166
|
value: "locked"
|
|
70033
70167
|
},
|
|
70168
|
+
hold: { effects: [{
|
|
70169
|
+
field: "state",
|
|
70170
|
+
value: "locking",
|
|
70171
|
+
when: {
|
|
70172
|
+
field: "state",
|
|
70173
|
+
notIn: ["locked"]
|
|
70174
|
+
}
|
|
70175
|
+
}] },
|
|
70034
70176
|
openArgs: [{
|
|
70035
70177
|
key: "code",
|
|
70036
70178
|
label: require_sleep.t("PIN code", "Codice PIN"),
|
|
@@ -70064,6 +70206,14 @@ var lockControlCapability = {
|
|
|
70064
70206
|
field: "state",
|
|
70065
70207
|
value: "unlocked"
|
|
70066
70208
|
},
|
|
70209
|
+
hold: { effects: [{
|
|
70210
|
+
field: "state",
|
|
70211
|
+
value: "unlocking",
|
|
70212
|
+
when: {
|
|
70213
|
+
field: "state",
|
|
70214
|
+
notIn: ["unlocked"]
|
|
70215
|
+
}
|
|
70216
|
+
}] },
|
|
70067
70217
|
openArgs: [{
|
|
70068
70218
|
key: "code",
|
|
70069
70219
|
label: require_sleep.t("PIN code", "Codice PIN"),
|
|
@@ -85508,6 +85658,16 @@ var osdManagerCapability = {
|
|
|
85508
85658
|
vocabulary: { notOperatorFacing: require_sleep.NOT_A_DEVICE.PIPELINE }
|
|
85509
85659
|
};
|
|
85510
85660
|
//#endregion
|
|
85661
|
+
//#region src/device/cap-vocabulary/hold-limits.ts
|
|
85662
|
+
/**
|
|
85663
|
+
* Hold limits a cap's vocabulary may declare on an action (D1061).
|
|
85664
|
+
*
|
|
85665
|
+
* A one-shot command (feed, run a script) has no lasting state to confirm; it
|
|
85666
|
+
* holds its in-progress flag just long enough that a second tap, before the
|
|
85667
|
+
* device reports, is seen as "already running" and refused.
|
|
85668
|
+
*/
|
|
85669
|
+
var ONE_SHOT_HOLD_MS = 1e4;
|
|
85670
|
+
//#endregion
|
|
85511
85671
|
//#region src/capabilities/pet-feeder.cap.ts
|
|
85512
85672
|
/**
|
|
85513
85673
|
* PetKit pet-feeder cap. Models the control + telemetry surface of a
|
|
@@ -85659,6 +85819,13 @@ var petFeederCapability = {
|
|
|
85659
85819
|
label: require_sleep.t("Feed", "Dai da mangiare"),
|
|
85660
85820
|
phrase: require_sleep.t("Dispense {grams} from {device}", "Eroga {grams} da {device}"),
|
|
85661
85821
|
icon: "paw-print",
|
|
85822
|
+
hold: {
|
|
85823
|
+
effects: [{
|
|
85824
|
+
field: "feeding",
|
|
85825
|
+
value: true
|
|
85826
|
+
}],
|
|
85827
|
+
holdMs: ONE_SHOT_HOLD_MS
|
|
85828
|
+
},
|
|
85662
85829
|
openArgs: [{
|
|
85663
85830
|
key: "grams",
|
|
85664
85831
|
label: require_sleep.t("Grams", "Grammi"),
|
|
@@ -85677,6 +85844,13 @@ var petFeederCapability = {
|
|
|
85677
85844
|
label: require_sleep.t("Feed from both hoppers", "Eroga da entrambi i serbatoi"),
|
|
85678
85845
|
phrase: require_sleep.t("Dispense {hopper1} and {hopper2} from {device}", "Eroga {hopper1} e {hopper2} da {device}"),
|
|
85679
85846
|
icon: "paw-print",
|
|
85847
|
+
hold: {
|
|
85848
|
+
effects: [{
|
|
85849
|
+
field: "feeding",
|
|
85850
|
+
value: true
|
|
85851
|
+
}],
|
|
85852
|
+
holdMs: ONE_SHOT_HOLD_MS
|
|
85853
|
+
},
|
|
85680
85854
|
openArgs: [{
|
|
85681
85855
|
key: "hopper1",
|
|
85682
85856
|
label: require_sleep.t("Hopper 1", "Serbatoio 1"),
|
|
@@ -85782,12 +85956,20 @@ var petFeederCapability = {
|
|
|
85782
85956
|
auth: "protected",
|
|
85783
85957
|
actions: [{
|
|
85784
85958
|
id: "petFeeder.childLockOn",
|
|
85959
|
+
effect: {
|
|
85960
|
+
field: "childLock",
|
|
85961
|
+
value: true
|
|
85962
|
+
},
|
|
85785
85963
|
label: require_sleep.t("Child lock on", "Blocco bambini attivo"),
|
|
85786
85964
|
phrase: require_sleep.t("Turn on the child lock of {device}", "Attiva il blocco bambini di {device}"),
|
|
85787
85965
|
icon: "lock",
|
|
85788
85966
|
args: { on: true }
|
|
85789
85967
|
}, {
|
|
85790
85968
|
id: "petFeeder.childLockOff",
|
|
85969
|
+
effect: {
|
|
85970
|
+
field: "childLock",
|
|
85971
|
+
value: false
|
|
85972
|
+
},
|
|
85791
85973
|
label: require_sleep.t("Child lock off", "Blocco bambini spento"),
|
|
85792
85974
|
phrase: require_sleep.t("Turn off the child lock of {device}", "Disattiva il blocco bambini di {device}"),
|
|
85793
85975
|
icon: "lock-open",
|
|
@@ -85803,12 +85985,20 @@ var petFeederCapability = {
|
|
|
85803
85985
|
auth: "protected",
|
|
85804
85986
|
actions: [{
|
|
85805
85987
|
id: "petFeeder.lightOn",
|
|
85988
|
+
effect: {
|
|
85989
|
+
field: "indicatorLight",
|
|
85990
|
+
value: true
|
|
85991
|
+
},
|
|
85806
85992
|
label: require_sleep.t("Indicator light on", "Spia accesa"),
|
|
85807
85993
|
phrase: require_sleep.t("Turn on the indicator light of {device}", "Accendi la spia di {device}"),
|
|
85808
85994
|
icon: "lightbulb",
|
|
85809
85995
|
args: { on: true }
|
|
85810
85996
|
}, {
|
|
85811
85997
|
id: "petFeeder.lightOff",
|
|
85998
|
+
effect: {
|
|
85999
|
+
field: "indicatorLight",
|
|
86000
|
+
value: false
|
|
86001
|
+
},
|
|
85812
86002
|
label: require_sleep.t("Indicator light off", "Spia spenta"),
|
|
85813
86003
|
phrase: require_sleep.t("Turn off the indicator light of {device}", "Spegni la spia di {device}"),
|
|
85814
86004
|
icon: "lightbulb-off",
|
|
@@ -85824,12 +86014,20 @@ var petFeederCapability = {
|
|
|
85824
86014
|
auth: "protected",
|
|
85825
86015
|
actions: [{
|
|
85826
86016
|
id: "petFeeder.feedSoundOn",
|
|
86017
|
+
effect: {
|
|
86018
|
+
field: "feedSound",
|
|
86019
|
+
value: true
|
|
86020
|
+
},
|
|
85827
86021
|
label: require_sleep.t("Feeding sound on", "Suono di erogazione attivo"),
|
|
85828
86022
|
phrase: require_sleep.t("Turn on the feeding sound of {device}", "Attiva il suono di erogazione di {device}"),
|
|
85829
86023
|
icon: "volume-2",
|
|
85830
86024
|
args: { on: true }
|
|
85831
86025
|
}, {
|
|
85832
86026
|
id: "petFeeder.feedSoundOff",
|
|
86027
|
+
effect: {
|
|
86028
|
+
field: "feedSound",
|
|
86029
|
+
value: false
|
|
86030
|
+
},
|
|
85833
86031
|
label: require_sleep.t("Feeding sound off", "Suono di erogazione spento"),
|
|
85834
86032
|
phrase: require_sleep.t("Turn off the feeding sound of {device}", "Disattiva il suono di erogazione di {device}"),
|
|
85835
86033
|
icon: "volume-x",
|
|
@@ -85845,6 +86043,10 @@ var petFeederCapability = {
|
|
|
85845
86043
|
auth: "protected",
|
|
85846
86044
|
actions: [{
|
|
85847
86045
|
id: "petFeeder.volume",
|
|
86046
|
+
effect: {
|
|
86047
|
+
field: "volume",
|
|
86048
|
+
fromArg: "level"
|
|
86049
|
+
},
|
|
85848
86050
|
label: require_sleep.t("Set volume", "Imposta il volume"),
|
|
85849
86051
|
phrase: require_sleep.t("Set the volume of {device} to {level}", "Imposta il volume di {device} a {level}"),
|
|
85850
86052
|
icon: "volume-2",
|
|
@@ -86013,12 +86215,20 @@ setPump: require_sleep.method(zod.z.object({
|
|
|
86013
86215
|
auth: "protected",
|
|
86014
86216
|
actions: [{
|
|
86015
86217
|
id: "petFountain.pumpOn",
|
|
86218
|
+
effect: {
|
|
86219
|
+
field: "pumpRunning",
|
|
86220
|
+
value: true
|
|
86221
|
+
},
|
|
86016
86222
|
label: require_sleep.t("Pump on", "Pompa accesa"),
|
|
86017
86223
|
phrase: require_sleep.t("Start the pump of {device}", "Avvia la pompa di {device}"),
|
|
86018
86224
|
icon: "play",
|
|
86019
86225
|
args: { on: true }
|
|
86020
86226
|
}, {
|
|
86021
86227
|
id: "petFountain.pumpOff",
|
|
86228
|
+
effect: {
|
|
86229
|
+
field: "pumpRunning",
|
|
86230
|
+
value: false
|
|
86231
|
+
},
|
|
86022
86232
|
label: require_sleep.t("Pump off", "Pompa spenta"),
|
|
86023
86233
|
phrase: require_sleep.t("Stop the pump of {device}", "Ferma la pompa di {device}"),
|
|
86024
86234
|
icon: "square",
|
|
@@ -90319,12 +90529,20 @@ var pumpCycleCapability = {
|
|
|
90319
90529
|
auth: "protected",
|
|
90320
90530
|
actions: [{
|
|
90321
90531
|
id: "pumpCycle.on",
|
|
90532
|
+
effect: {
|
|
90533
|
+
field: "enabled",
|
|
90534
|
+
value: true
|
|
90535
|
+
},
|
|
90322
90536
|
label: require_sleep.t("Pump cycle on", "Ciclo pompa attivo"),
|
|
90323
90537
|
phrase: require_sleep.t("Run the pump of {device} on its on/off cycle", "Fai lavorare la pompa di {device} a ciclo acceso/spento"),
|
|
90324
90538
|
icon: "timer",
|
|
90325
90539
|
args: { on: true }
|
|
90326
90540
|
}, {
|
|
90327
90541
|
id: "pumpCycle.off",
|
|
90542
|
+
effect: {
|
|
90543
|
+
field: "enabled",
|
|
90544
|
+
value: false
|
|
90545
|
+
},
|
|
90328
90546
|
label: require_sleep.t("Pump cycle off", "Ciclo pompa spento"),
|
|
90329
90547
|
phrase: require_sleep.t("Run the pump of {device} continuously", "Fai lavorare la pompa di {device} in continuo"),
|
|
90330
90548
|
icon: "timer-off",
|
|
@@ -90343,6 +90561,11 @@ var pumpCycleCapability = {
|
|
|
90343
90561
|
label: require_sleep.t("Set pump run time", "Imposta il tempo di lavoro della pompa"),
|
|
90344
90562
|
phrase: require_sleep.t("Set the pump of {device} to run {minutes} minutes per cycle", "Imposta la pompa di {device} a lavorare {minutes} minuti per ciclo"),
|
|
90345
90563
|
icon: "timer",
|
|
90564
|
+
effect: {
|
|
90565
|
+
field: "onTime",
|
|
90566
|
+
fromArg: "minutes",
|
|
90567
|
+
scale: 60
|
|
90568
|
+
},
|
|
90346
90569
|
openArgs: [{
|
|
90347
90570
|
key: "minutes",
|
|
90348
90571
|
label: require_sleep.t("Minutes", "Minuti"),
|
|
@@ -90367,6 +90590,11 @@ var pumpCycleCapability = {
|
|
|
90367
90590
|
label: require_sleep.t("Set pump rest time", "Imposta il tempo di riposo della pompa"),
|
|
90368
90591
|
phrase: require_sleep.t("Set the pump of {device} to rest {minutes} minutes per cycle", "Imposta la pompa di {device} a riposare {minutes} minuti per ciclo"),
|
|
90369
90592
|
icon: "timer-off",
|
|
90593
|
+
effect: {
|
|
90594
|
+
field: "offTime",
|
|
90595
|
+
fromArg: "minutes",
|
|
90596
|
+
scale: 60
|
|
90597
|
+
},
|
|
90370
90598
|
openArgs: [{
|
|
90371
90599
|
key: "minutes",
|
|
90372
90600
|
label: require_sleep.t("Minutes", "Minuti"),
|
|
@@ -95330,7 +95558,14 @@ var scriptRunnerCapability = {
|
|
|
95330
95558
|
id: "script.run",
|
|
95331
95559
|
label: require_sleep.t("Run script", "Esegui lo script"),
|
|
95332
95560
|
phrase: require_sleep.t("Run {device}", "Esegui {device}"),
|
|
95333
|
-
icon: "scroll-text"
|
|
95561
|
+
icon: "scroll-text",
|
|
95562
|
+
hold: {
|
|
95563
|
+
effects: [{
|
|
95564
|
+
field: "isRunning",
|
|
95565
|
+
value: true
|
|
95566
|
+
}],
|
|
95567
|
+
holdMs: ONE_SHOT_HOLD_MS
|
|
95568
|
+
}
|
|
95334
95569
|
}]
|
|
95335
95570
|
}),
|
|
95336
95571
|
/** Cancel a running script. Provider rejects when the script
|
|
@@ -95340,6 +95575,10 @@ var scriptRunnerCapability = {
|
|
|
95340
95575
|
auth: "admin",
|
|
95341
95576
|
actions: [{
|
|
95342
95577
|
id: "script.stop",
|
|
95578
|
+
effect: {
|
|
95579
|
+
field: "isRunning",
|
|
95580
|
+
value: false
|
|
95581
|
+
},
|
|
95343
95582
|
label: require_sleep.t("Stop script", "Ferma lo script"),
|
|
95344
95583
|
phrase: require_sleep.t("Stop {device}", "Ferma {device}"),
|
|
95345
95584
|
icon: "square"
|
|
@@ -97892,6 +98131,10 @@ var switchCapability = {
|
|
|
97892
98131
|
auth: "protected",
|
|
97893
98132
|
actions: [{
|
|
97894
98133
|
id: "switch.toggle",
|
|
98134
|
+
sideEffects: [{
|
|
98135
|
+
field: "on",
|
|
98136
|
+
negate: true
|
|
98137
|
+
}],
|
|
97895
98138
|
label: require_sleep.t("Toggle", "Commuta"),
|
|
97896
98139
|
phrase: require_sleep.t("Toggle {device}", "Commuta {device}"),
|
|
97897
98140
|
icon: "toggle-right",
|
|
@@ -150793,6 +151036,45 @@ function searchRank(rawQuery, fields) {
|
|
|
150793
151036
|
return matchRank(label, keywords, (fields.identifiers ?? []).map(normalizeSearchText).filter((identifier) => identifier.length > 0), query) ?? fuzzyMatchRank(label, query) ?? bestFuzzy(keywords, query);
|
|
150794
151037
|
}
|
|
150795
151038
|
//#endregion
|
|
151039
|
+
//#region src/device/command-hold.ts
|
|
151040
|
+
/**
|
|
151041
|
+
* How long a command is held when nothing says otherwise. Equal to the
|
|
151042
|
+
* transition correlator's match window (D1022), so a hold that reverts and a
|
|
151043
|
+
* command recorded `unconfirmed` are the same event.
|
|
151044
|
+
*/
|
|
151045
|
+
var DEFAULT_COMMAND_HOLD_MS = 3e4;
|
|
151046
|
+
/** The longest hold a provider may ask for: a value the device never confirms is not shown for long. */
|
|
151047
|
+
var MAX_COMMAND_HOLD_MS = 12e4;
|
|
151048
|
+
function clampHoldMs(ms) {
|
|
151049
|
+
if (ms === void 0 || !Number.isFinite(ms)) return DEFAULT_COMMAND_HOLD_MS;
|
|
151050
|
+
return Math.min(MAX_COMMAND_HOLD_MS, Math.max(1, Math.round(ms)));
|
|
151051
|
+
}
|
|
151052
|
+
function resolveList(list, args, current, shown, into) {
|
|
151053
|
+
for (const entry of list) {
|
|
151054
|
+
if (!require_sleep.effectConditionHolds(entry.when, current)) continue;
|
|
151055
|
+
const resolved = require_sleep.resolveSideEffect(entry, args, shown);
|
|
151056
|
+
if (resolved !== null && !into.some((e) => e.field === resolved.field)) into.push(resolved);
|
|
151057
|
+
}
|
|
151058
|
+
}
|
|
151059
|
+
/**
|
|
151060
|
+
* What to hold for `cap.method(args)` given the cap's slice when it arrived
|
|
151061
|
+
* (`current`, as the device reported it; `shown`, with the held values over
|
|
151062
|
+
* it — what a `negate` flips) and the provider's option for the method.
|
|
151063
|
+
* `null` = hold nothing (`never`, or a command that leads to no state).
|
|
151064
|
+
*/
|
|
151065
|
+
function resolveCommandHold(cap, method, args, current, option, shown = current) {
|
|
151066
|
+
if (option?.hold === "never") return null;
|
|
151067
|
+
const effects = [];
|
|
151068
|
+
if (option?.effects !== void 0) resolveList(option.effects, args, current, shown, effects);
|
|
151069
|
+
else effects.push(...require_sleep.commandEffects(cap, method, args, current, shown));
|
|
151070
|
+
if (option?.extraEffects !== void 0) resolveList(option.extraEffects, args, current, shown, effects);
|
|
151071
|
+
if (effects.length === 0) return null;
|
|
151072
|
+
return {
|
|
151073
|
+
effects,
|
|
151074
|
+
holdMs: clampHoldMs(option?.holdMs ?? require_sleep.commandHoldMs(cap, method, args))
|
|
151075
|
+
};
|
|
151076
|
+
}
|
|
151077
|
+
//#endregion
|
|
150796
151078
|
exports.ACCESSORY_LABEL = ACCESSORY_LABEL;
|
|
150797
151079
|
exports.ACCESS_ROLES = ACCESS_ROLES;
|
|
150798
151080
|
exports.ACTION_RUN_MAX_MS = ACTION_RUN_MAX_MS;
|
|
@@ -151328,6 +151610,7 @@ exports.DEFAULT_CAMERA_SENSOR_MODE = DEFAULT_CAMERA_SENSOR_MODE;
|
|
|
151328
151610
|
exports.DEFAULT_CATALOG_LANG = DEFAULT_CATALOG_LANG;
|
|
151329
151611
|
exports.DEFAULT_CLUSTER_STEP_MODELS = DEFAULT_CLUSTER_STEP_MODELS;
|
|
151330
151612
|
exports.DEFAULT_CLUSTER_STEP_SETTINGS = DEFAULT_CLUSTER_STEP_SETTINGS;
|
|
151613
|
+
exports.DEFAULT_COMMAND_HOLD_MS = DEFAULT_COMMAND_HOLD_MS;
|
|
151331
151614
|
exports.DEFAULT_CORE_BLOCK_ENTRY = DEFAULT_CORE_BLOCK_ENTRY;
|
|
151332
151615
|
exports.DEFAULT_DECODER_HWACCEL_CONFIG = DEFAULT_DECODER_HWACCEL_CONFIG;
|
|
151333
151616
|
exports.DEFAULT_DETAIL_CROP_CONVENTION = DEFAULT_DETAIL_CROP_CONVENTION;
|
|
@@ -152076,6 +152359,7 @@ exports.MAX_BIRTH_LATENCY_PROXY_MS = MAX_BIRTH_LATENCY_PROXY_MS;
|
|
|
152076
152359
|
exports.MAX_CAMERA_SENSORS = MAX_CAMERA_SENSORS;
|
|
152077
152360
|
exports.MAX_CLIP_EVENT_IDS = MAX_CLIP_EVENT_IDS;
|
|
152078
152361
|
exports.MAX_CLIP_LABELS = MAX_CLIP_LABELS;
|
|
152362
|
+
exports.MAX_COMMAND_HOLD_MS = MAX_COMMAND_HOLD_MS;
|
|
152079
152363
|
exports.MAX_COMPONENT_BUTTONS = MAX_COMPONENT_BUTTONS;
|
|
152080
152364
|
exports.MAX_COMPOSITION_CODE_LENGTH = require_implemented_methods.MAX_COMPOSITION_CODE_LENGTH;
|
|
152081
152365
|
exports.MAX_COMPOSITION_FEATURES = require_implemented_methods.MAX_COMPOSITION_FEATURES;
|
|
@@ -152516,6 +152800,7 @@ exports.NumericSensorStatusSchema = NumericSensorStatusSchema;
|
|
|
152516
152800
|
exports.OAUTH_LANDING_PATH = OAUTH_LANDING_PATH;
|
|
152517
152801
|
exports.OAUTH_LANDING_REASONS = OAUTH_LANDING_REASONS;
|
|
152518
152802
|
exports.OBJECT_DETECTION_STEP_ID = OBJECT_DETECTION_STEP_ID;
|
|
152803
|
+
exports.ONE_SHOT_HOLD_MS = ONE_SHOT_HOLD_MS;
|
|
152519
152804
|
exports.OPERATOR_WRITTEN_STALE_MS = OPERATOR_WRITTEN_STALE_MS;
|
|
152520
152805
|
exports.OPS_LOG_DEFAULT_LIMIT = OPS_LOG_DEFAULT_LIMIT;
|
|
152521
152806
|
exports.OPS_LOG_RING_DEFAULT_MAX = OPS_LOG_RING_DEFAULT_MAX;
|
|
@@ -153729,6 +154014,8 @@ exports.collectZodSecretPaths = require_sleep.collectZodSecretPaths;
|
|
|
153729
154014
|
exports.colorCapability = colorCapability;
|
|
153730
154015
|
exports.colorForKind = colorForKind;
|
|
153731
154016
|
exports.commandEffect = require_sleep.commandEffect;
|
|
154017
|
+
exports.commandEffects = require_sleep.commandEffects;
|
|
154018
|
+
exports.commandHoldMs = require_sleep.commandHoldMs;
|
|
153732
154019
|
exports.commandMethodProblems = commandMethodProblems;
|
|
153733
154020
|
exports.commandOrigin = require_sleep.commandOrigin;
|
|
153734
154021
|
exports.commandStepMeta = commandStepMeta;
|
|
@@ -153935,6 +154222,7 @@ exports.dominantClipLabels = dominantClipLabels;
|
|
|
153935
154222
|
exports.doorbellCapability = doorbellCapability;
|
|
153936
154223
|
exports.droppedConditionsForKind = droppedConditionsForKind;
|
|
153937
154224
|
exports.edgetpuDelegateDevice = edgetpuDelegateDevice;
|
|
154225
|
+
exports.effectConditionHolds = require_sleep.effectConditionHolds;
|
|
153938
154226
|
exports.effectiveStepSettings = effectiveStepSettings;
|
|
153939
154227
|
exports.egressTranscodeSharingKey = egressTranscodeSharingKey;
|
|
153940
154228
|
exports.egressTransportFromRequest = egressTransportFromRequest;
|
|
@@ -154670,6 +154958,7 @@ exports.resolveBucketMs = resolveBucketMs;
|
|
|
154670
154958
|
exports.resolveCapMount = require_sleep.resolveCapMount;
|
|
154671
154959
|
exports.resolveClipSearchMinScore = resolveClipSearchMinScore;
|
|
154672
154960
|
exports.resolveClusterStepModelId = resolveClusterStepModelId;
|
|
154961
|
+
exports.resolveCommandHold = resolveCommandHold;
|
|
154673
154962
|
exports.resolveContainerPrimaryChild = resolveContainerPrimaryChild;
|
|
154674
154963
|
exports.resolveCoreBlockEntry = resolveCoreBlockEntry;
|
|
154675
154964
|
exports.resolveCoreBlockFiles = resolveCoreBlockFiles;
|
|
@@ -154711,6 +155000,7 @@ exports.resolveSecretMarkers = require_sleep.resolveSecretMarkers;
|
|
|
154711
155000
|
exports.resolveSecretViewsIn = require_sleep.resolveSecretViewsIn;
|
|
154712
155001
|
exports.resolveSelectStep = resolveSelectStep;
|
|
154713
155002
|
exports.resolveServerName = resolveServerName;
|
|
155003
|
+
exports.resolveSideEffect = require_sleep.resolveSideEffect;
|
|
154714
155004
|
exports.resolveSirenPlays = resolveSirenPlays;
|
|
154715
155005
|
exports.resolveSirenSeconds = resolveSirenSeconds;
|
|
154716
155006
|
exports.resolveStepArgs = resolveStepArgs;
|