@camstack/addon-training 0.1.108 → 0.1.109
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/{MotionZonesSettings-9m904uxm.mjs → MotionZonesSettings-BFubqBUi.mjs} +2 -2
- package/dist/{PrivacyMaskSettings-DDk1oMby.mjs → PrivacyMaskSettings-sNWgI2Ak.mjs} +2 -2
- package/dist/{SceneMonitorEditor-Dsq9Dzqm.mjs → SceneMonitorEditor-CyQQi49c.mjs} +2 -2
- package/dist/_stub.js +1398 -1364
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-Bz804aB6.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_training_page-CoE4OqSm.mjs} +3 -3
- package/dist/{_virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CjEDvlSM.mjs → _virtual_mf___mfe_internal__addon_training_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-L5NIyvFm.mjs} +2 -2
- package/dist/{dist-B8XLeyRL.js → dist-BkNG49yZ.js} +518 -61
- package/dist/{dist-BycZdx08.mjs → dist-DW0wmCpB.mjs} +518 -61
- package/dist/{hostInit-CcF5kCoS.mjs → hostInit-C5xfMSma.mjs} +2 -2
- package/dist/index.js +1 -1
- package/dist/orchestrator/training.addon.js +1 -1
- package/dist/orchestrator/training.addon.mjs +1 -1
- package/dist/{player-overlays-eJNV-UU-.mjs → player-overlays-DPQZJVmM.mjs} +1 -1
- package/dist/providers/modal/training-modal.addon.js +1 -1
- package/dist/providers/modal/training-modal.addon.mjs +1 -1
- package/dist/remoteEntry.js +1 -1
- package/dist/{responsive-DlCVUok5.mjs → responsive-Dq7_CDVT.mjs} +1 -1
- package/dist/{scene-monitor-copy-D3BXN-0E.mjs → scene-monitor-copy-B6AKXb0r.mjs} +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-9YL8IM8w.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_training_page__remoteEntry_js-CLjAuQ-T.mjs} +1 -1
- package/package.json +1 -1
|
@@ -15852,6 +15852,478 @@ object({
|
|
|
15852
15852
|
path: ["expr"]
|
|
15853
15853
|
});
|
|
15854
15854
|
});
|
|
15855
|
+
/**
|
|
15856
|
+
* Identity envelope for a device's upstream-system metadata.
|
|
15857
|
+
*
|
|
15858
|
+
* Two jobs:
|
|
15859
|
+
*
|
|
15860
|
+
* 1. **Dispatch key.** `id` is the natural identifier the SOURCE system
|
|
15861
|
+
* uses to address this device (HA `entity_id`, Reolink MAC, ONVIF
|
|
15862
|
+
* WS-Discovery endpoint UUID, …). Provider code keeps a
|
|
15863
|
+
* `Map<sourceInfo.id, IDevice>` to route inbound push events in O(1)
|
|
15864
|
+
* without round-tripping through `stableId` / `id` mappings.
|
|
15865
|
+
*
|
|
15866
|
+
* 2. **Stability bridge.** `uniqueId` is the *immutable* upstream id when
|
|
15867
|
+
* one exists (HA `entity.unique_id`, Reolink MAC again — same as `id`
|
|
15868
|
+
* for vendors where MAC is the natural key). For systems where the
|
|
15869
|
+
* live dispatch key can be renamed (HA `entity_id` can be edited),
|
|
15870
|
+
* providers detect renames by matching `uniqueId` and patch `id`
|
|
15871
|
+
* in-place so dispatch keeps working.
|
|
15872
|
+
*
|
|
15873
|
+
* **Display unit and precision are NOT stored here.** They are a read-time
|
|
15874
|
+
* preference (D944). A polymorphic reading stores its `quantity` here once,
|
|
15875
|
+
* at adopt, and a date/time value stores `dateTimeShape` the same way —
|
|
15876
|
+
* neither is repeated on each sample. The `device_class` tag is an
|
|
15877
|
+
* HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
|
|
15878
|
+
* to derive the CamStack `DeviceRole`; it is never stored after that point.
|
|
15879
|
+
*
|
|
15880
|
+
* The `raw` escape hatch carries provider-specific attributes that don't
|
|
15881
|
+
* fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
|
|
15882
|
+
* details, …). Providers control what lands here.
|
|
15883
|
+
*/
|
|
15884
|
+
var SourceInfoSchema = object({
|
|
15885
|
+
/** Live dispatch key — mutable when the source system allows rename. */
|
|
15886
|
+
id: string(),
|
|
15887
|
+
/** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
|
|
15888
|
+
system: string(),
|
|
15889
|
+
/** Immutable upstream identifier when available (HA `unique_id`, … ).
|
|
15890
|
+
* Used to detect rename when `id` changes. */
|
|
15891
|
+
uniqueId: string().optional(),
|
|
15892
|
+
/** Quantity of a polymorphic reading, written once at adopt (D944). */
|
|
15893
|
+
quantity: ReadingQuantitySchema.optional(),
|
|
15894
|
+
/** Date / time / datetime shape of a string reading, written once at adopt. */
|
|
15895
|
+
dateTimeShape: _enum([
|
|
15896
|
+
"date",
|
|
15897
|
+
"time",
|
|
15898
|
+
"datetime"
|
|
15899
|
+
]).optional(),
|
|
15900
|
+
/** Provider-specific extras that don't fit the structured slots.
|
|
15901
|
+
* Whitelist what goes here per provider — do NOT dump entire HA
|
|
15902
|
+
* attribute blobs (would explode the meta JSON column). */
|
|
15903
|
+
raw: record(string(), unknown()).optional()
|
|
15904
|
+
});
|
|
15905
|
+
/**
|
|
15906
|
+
* Frozen unit → spec table. `•` in the doc marks each dimension's canonical
|
|
15907
|
+
* unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
|
|
15908
|
+
* `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
|
|
15909
|
+
* decimals). K derives from `°C = K − 273.15`.
|
|
15910
|
+
*/
|
|
15911
|
+
var UNIT_TABLE = {
|
|
15912
|
+
"°C": {
|
|
15913
|
+
dimension: "temperature",
|
|
15914
|
+
factor: 1,
|
|
15915
|
+
offset: 0
|
|
15916
|
+
},
|
|
15917
|
+
"°F": {
|
|
15918
|
+
dimension: "temperature",
|
|
15919
|
+
factor: 5 / 9,
|
|
15920
|
+
offset: -160 / 9
|
|
15921
|
+
},
|
|
15922
|
+
K: {
|
|
15923
|
+
dimension: "temperature",
|
|
15924
|
+
factor: 1,
|
|
15925
|
+
offset: -273.15
|
|
15926
|
+
},
|
|
15927
|
+
hPa: {
|
|
15928
|
+
dimension: "pressure",
|
|
15929
|
+
factor: 1,
|
|
15930
|
+
offset: 0
|
|
15931
|
+
},
|
|
15932
|
+
kPa: {
|
|
15933
|
+
dimension: "pressure",
|
|
15934
|
+
factor: 10,
|
|
15935
|
+
offset: 0
|
|
15936
|
+
},
|
|
15937
|
+
Pa: {
|
|
15938
|
+
dimension: "pressure",
|
|
15939
|
+
factor: .01,
|
|
15940
|
+
offset: 0
|
|
15941
|
+
},
|
|
15942
|
+
mbar: {
|
|
15943
|
+
dimension: "pressure",
|
|
15944
|
+
factor: 1,
|
|
15945
|
+
offset: 0
|
|
15946
|
+
},
|
|
15947
|
+
bar: {
|
|
15948
|
+
dimension: "pressure",
|
|
15949
|
+
factor: 1e3,
|
|
15950
|
+
offset: 0
|
|
15951
|
+
},
|
|
15952
|
+
inHg: {
|
|
15953
|
+
dimension: "pressure",
|
|
15954
|
+
factor: 33.8639,
|
|
15955
|
+
offset: 0
|
|
15956
|
+
},
|
|
15957
|
+
mmHg: {
|
|
15958
|
+
dimension: "pressure",
|
|
15959
|
+
factor: 1.33322,
|
|
15960
|
+
offset: 0
|
|
15961
|
+
},
|
|
15962
|
+
psi: {
|
|
15963
|
+
dimension: "pressure",
|
|
15964
|
+
factor: 68.9476,
|
|
15965
|
+
offset: 0
|
|
15966
|
+
},
|
|
15967
|
+
"m/s": {
|
|
15968
|
+
dimension: "speed",
|
|
15969
|
+
factor: 1,
|
|
15970
|
+
offset: 0
|
|
15971
|
+
},
|
|
15972
|
+
"km/h": {
|
|
15973
|
+
dimension: "speed",
|
|
15974
|
+
factor: 1 / 3.6,
|
|
15975
|
+
offset: 0
|
|
15976
|
+
},
|
|
15977
|
+
mph: {
|
|
15978
|
+
dimension: "speed",
|
|
15979
|
+
factor: .44704,
|
|
15980
|
+
offset: 0
|
|
15981
|
+
},
|
|
15982
|
+
kn: {
|
|
15983
|
+
dimension: "speed",
|
|
15984
|
+
factor: .514444,
|
|
15985
|
+
offset: 0
|
|
15986
|
+
},
|
|
15987
|
+
"mm/h": {
|
|
15988
|
+
dimension: "precipitation-rate",
|
|
15989
|
+
factor: 1,
|
|
15990
|
+
offset: 0
|
|
15991
|
+
},
|
|
15992
|
+
"in/h": {
|
|
15993
|
+
dimension: "precipitation-rate",
|
|
15994
|
+
factor: 25.4,
|
|
15995
|
+
offset: 0
|
|
15996
|
+
},
|
|
15997
|
+
m: {
|
|
15998
|
+
dimension: "length",
|
|
15999
|
+
factor: 1,
|
|
16000
|
+
offset: 0
|
|
16001
|
+
},
|
|
16002
|
+
mm: {
|
|
16003
|
+
dimension: "length",
|
|
16004
|
+
factor: .001,
|
|
16005
|
+
offset: 0
|
|
16006
|
+
},
|
|
16007
|
+
cm: {
|
|
16008
|
+
dimension: "length",
|
|
16009
|
+
factor: .01,
|
|
16010
|
+
offset: 0
|
|
16011
|
+
},
|
|
16012
|
+
km: {
|
|
16013
|
+
dimension: "length",
|
|
16014
|
+
factor: 1e3,
|
|
16015
|
+
offset: 0
|
|
16016
|
+
},
|
|
16017
|
+
in: {
|
|
16018
|
+
dimension: "length",
|
|
16019
|
+
factor: .0254,
|
|
16020
|
+
offset: 0
|
|
16021
|
+
},
|
|
16022
|
+
ft: {
|
|
16023
|
+
dimension: "length",
|
|
16024
|
+
factor: .3048,
|
|
16025
|
+
offset: 0
|
|
16026
|
+
},
|
|
16027
|
+
mi: {
|
|
16028
|
+
dimension: "length",
|
|
16029
|
+
factor: 1609.344,
|
|
16030
|
+
offset: 0
|
|
16031
|
+
},
|
|
16032
|
+
"m²": {
|
|
16033
|
+
dimension: "area",
|
|
16034
|
+
factor: 1,
|
|
16035
|
+
offset: 0
|
|
16036
|
+
},
|
|
16037
|
+
lx: {
|
|
16038
|
+
dimension: "illuminance",
|
|
16039
|
+
factor: 1,
|
|
16040
|
+
offset: 0
|
|
16041
|
+
},
|
|
16042
|
+
"W/m²": {
|
|
16043
|
+
dimension: "irradiance",
|
|
16044
|
+
factor: 1,
|
|
16045
|
+
offset: 0
|
|
16046
|
+
},
|
|
16047
|
+
W: {
|
|
16048
|
+
dimension: "power",
|
|
16049
|
+
factor: 1,
|
|
16050
|
+
offset: 0
|
|
16051
|
+
},
|
|
16052
|
+
kW: {
|
|
16053
|
+
dimension: "power",
|
|
16054
|
+
factor: 1e3,
|
|
16055
|
+
offset: 0
|
|
16056
|
+
},
|
|
16057
|
+
VA: {
|
|
16058
|
+
dimension: "apparent-power",
|
|
16059
|
+
factor: 1,
|
|
16060
|
+
offset: 0
|
|
16061
|
+
},
|
|
16062
|
+
Wh: {
|
|
16063
|
+
dimension: "energy",
|
|
16064
|
+
factor: 1,
|
|
16065
|
+
offset: 0
|
|
16066
|
+
},
|
|
16067
|
+
kWh: {
|
|
16068
|
+
dimension: "energy",
|
|
16069
|
+
factor: 1e3,
|
|
16070
|
+
offset: 0
|
|
16071
|
+
},
|
|
16072
|
+
MWh: {
|
|
16073
|
+
dimension: "energy",
|
|
16074
|
+
factor: 1e6,
|
|
16075
|
+
offset: 0
|
|
16076
|
+
},
|
|
16077
|
+
V: {
|
|
16078
|
+
dimension: "voltage",
|
|
16079
|
+
factor: 1,
|
|
16080
|
+
offset: 0
|
|
16081
|
+
},
|
|
16082
|
+
mV: {
|
|
16083
|
+
dimension: "voltage",
|
|
16084
|
+
factor: .001,
|
|
16085
|
+
offset: 0
|
|
16086
|
+
},
|
|
16087
|
+
A: {
|
|
16088
|
+
dimension: "current",
|
|
16089
|
+
factor: 1,
|
|
16090
|
+
offset: 0
|
|
16091
|
+
},
|
|
16092
|
+
mA: {
|
|
16093
|
+
dimension: "current",
|
|
16094
|
+
factor: .001,
|
|
16095
|
+
offset: 0
|
|
16096
|
+
},
|
|
16097
|
+
ppm: {
|
|
16098
|
+
dimension: "concentration-volume",
|
|
16099
|
+
factor: 1,
|
|
16100
|
+
offset: 0
|
|
16101
|
+
},
|
|
16102
|
+
ppb: {
|
|
16103
|
+
dimension: "concentration-volume",
|
|
16104
|
+
factor: .001,
|
|
16105
|
+
offset: 0
|
|
16106
|
+
},
|
|
16107
|
+
"µg/m³": {
|
|
16108
|
+
dimension: "concentration-mass",
|
|
16109
|
+
factor: 1,
|
|
16110
|
+
offset: 0
|
|
16111
|
+
},
|
|
16112
|
+
"mg/m³": {
|
|
16113
|
+
dimension: "concentration-mass",
|
|
16114
|
+
factor: 1e3,
|
|
16115
|
+
offset: 0
|
|
16116
|
+
},
|
|
16117
|
+
kg: {
|
|
16118
|
+
dimension: "mass",
|
|
16119
|
+
factor: 1,
|
|
16120
|
+
offset: 0
|
|
16121
|
+
},
|
|
16122
|
+
g: {
|
|
16123
|
+
dimension: "mass",
|
|
16124
|
+
factor: .001,
|
|
16125
|
+
offset: 0
|
|
16126
|
+
},
|
|
16127
|
+
lb: {
|
|
16128
|
+
dimension: "mass",
|
|
16129
|
+
factor: .453592,
|
|
16130
|
+
offset: 0
|
|
16131
|
+
},
|
|
16132
|
+
oz: {
|
|
16133
|
+
dimension: "mass",
|
|
16134
|
+
factor: .0283495,
|
|
16135
|
+
offset: 0
|
|
16136
|
+
},
|
|
16137
|
+
"%": {
|
|
16138
|
+
dimension: "percentage",
|
|
16139
|
+
factor: 1,
|
|
16140
|
+
offset: 0
|
|
16141
|
+
},
|
|
16142
|
+
L: {
|
|
16143
|
+
dimension: "volume",
|
|
16144
|
+
factor: 1,
|
|
16145
|
+
offset: 0
|
|
16146
|
+
},
|
|
16147
|
+
mL: {
|
|
16148
|
+
dimension: "volume",
|
|
16149
|
+
factor: .001,
|
|
16150
|
+
offset: 0
|
|
16151
|
+
},
|
|
16152
|
+
gal: {
|
|
16153
|
+
dimension: "volume",
|
|
16154
|
+
factor: 3.785411784,
|
|
16155
|
+
offset: 0
|
|
16156
|
+
},
|
|
16157
|
+
s: {
|
|
16158
|
+
dimension: "duration",
|
|
16159
|
+
factor: 1,
|
|
16160
|
+
offset: 0
|
|
16161
|
+
},
|
|
16162
|
+
ms: {
|
|
16163
|
+
dimension: "duration",
|
|
16164
|
+
factor: .001,
|
|
16165
|
+
offset: 0
|
|
16166
|
+
},
|
|
16167
|
+
min: {
|
|
16168
|
+
dimension: "duration",
|
|
16169
|
+
factor: 60,
|
|
16170
|
+
offset: 0
|
|
16171
|
+
},
|
|
16172
|
+
h: {
|
|
16173
|
+
dimension: "duration",
|
|
16174
|
+
factor: 3600,
|
|
16175
|
+
offset: 0
|
|
16176
|
+
},
|
|
16177
|
+
d: {
|
|
16178
|
+
dimension: "duration",
|
|
16179
|
+
factor: 86400,
|
|
16180
|
+
offset: 0
|
|
16181
|
+
},
|
|
16182
|
+
B: {
|
|
16183
|
+
dimension: "information",
|
|
16184
|
+
factor: 1,
|
|
16185
|
+
offset: 0
|
|
16186
|
+
},
|
|
16187
|
+
KiB: {
|
|
16188
|
+
dimension: "information",
|
|
16189
|
+
factor: 1024,
|
|
16190
|
+
offset: 0
|
|
16191
|
+
},
|
|
16192
|
+
MiB: {
|
|
16193
|
+
dimension: "information",
|
|
16194
|
+
factor: 1024 ** 2,
|
|
16195
|
+
offset: 0
|
|
16196
|
+
},
|
|
16197
|
+
GiB: {
|
|
16198
|
+
dimension: "information",
|
|
16199
|
+
factor: 1024 ** 3,
|
|
16200
|
+
offset: 0
|
|
16201
|
+
},
|
|
16202
|
+
TiB: {
|
|
16203
|
+
dimension: "information",
|
|
16204
|
+
factor: 1024 ** 4,
|
|
16205
|
+
offset: 0
|
|
16206
|
+
},
|
|
16207
|
+
kB: {
|
|
16208
|
+
dimension: "information",
|
|
16209
|
+
factor: 1e3,
|
|
16210
|
+
offset: 0
|
|
16211
|
+
},
|
|
16212
|
+
MB: {
|
|
16213
|
+
dimension: "information",
|
|
16214
|
+
factor: 1e6,
|
|
16215
|
+
offset: 0
|
|
16216
|
+
},
|
|
16217
|
+
GB: {
|
|
16218
|
+
dimension: "information",
|
|
16219
|
+
factor: 1e9,
|
|
16220
|
+
offset: 0
|
|
16221
|
+
},
|
|
16222
|
+
"°": {
|
|
16223
|
+
dimension: "angle",
|
|
16224
|
+
factor: 1,
|
|
16225
|
+
offset: 0
|
|
16226
|
+
},
|
|
16227
|
+
dBFS: {
|
|
16228
|
+
dimension: "sound-level",
|
|
16229
|
+
factor: 1,
|
|
16230
|
+
offset: 0
|
|
16231
|
+
},
|
|
16232
|
+
dBm: {
|
|
16233
|
+
dimension: "signal-level",
|
|
16234
|
+
factor: 1,
|
|
16235
|
+
offset: 0
|
|
16236
|
+
},
|
|
16237
|
+
mired: {
|
|
16238
|
+
dimension: "colour-temperature",
|
|
16239
|
+
factor: 1,
|
|
16240
|
+
offset: 0
|
|
16241
|
+
},
|
|
16242
|
+
kbps: {
|
|
16243
|
+
dimension: "bitrate",
|
|
16244
|
+
factor: 1,
|
|
16245
|
+
offset: 0
|
|
16246
|
+
},
|
|
16247
|
+
Mbps: {
|
|
16248
|
+
dimension: "bitrate",
|
|
16249
|
+
factor: 1e3,
|
|
16250
|
+
offset: 0
|
|
16251
|
+
},
|
|
16252
|
+
fps: {
|
|
16253
|
+
dimension: "rate",
|
|
16254
|
+
factor: 1,
|
|
16255
|
+
offset: 0
|
|
16256
|
+
}
|
|
16257
|
+
};
|
|
16258
|
+
/** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
|
|
16259
|
+
function specFor(unit) {
|
|
16260
|
+
return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
|
|
16261
|
+
}
|
|
16262
|
+
/** Value in `spec`'s unit → its dimension's canonical unit. */
|
|
16263
|
+
function toCanonical(value, spec) {
|
|
16264
|
+
return value * spec.factor + spec.offset;
|
|
16265
|
+
}
|
|
16266
|
+
/** Canonical-unit value → the unit described by `spec`. */
|
|
16267
|
+
function fromCanonical(canonical, spec) {
|
|
16268
|
+
return (canonical - spec.offset) / spec.factor;
|
|
16269
|
+
}
|
|
16270
|
+
/**
|
|
16271
|
+
* Graceful variant for the render path: returns the converted value, or
|
|
16272
|
+
* `undefined` when the conversion is refused (unknown unit / cross-dimension).
|
|
16273
|
+
* Never throws — a render caller falls back to the raw value + source unit.
|
|
16274
|
+
*/
|
|
16275
|
+
function tryConvertUnit(value, from, to) {
|
|
16276
|
+
if (from === to) return value;
|
|
16277
|
+
const fromSpec = specFor(from);
|
|
16278
|
+
if (!fromSpec) return void 0;
|
|
16279
|
+
const toSpec = specFor(to);
|
|
16280
|
+
if (!toSpec) return void 0;
|
|
16281
|
+
if (fromSpec.dimension !== toSpec.dimension) return void 0;
|
|
16282
|
+
return fromCanonical(toCanonical(value, fromSpec), toSpec);
|
|
16283
|
+
}
|
|
16284
|
+
/**
|
|
16285
|
+
* A number a person types for a physical quantity — the input side of the
|
|
16286
|
+
* value + unit contract (D972).
|
|
16287
|
+
*
|
|
16288
|
+
* Readings are stored in the base unit of their quantity (D944); a cap method
|
|
16289
|
+
* param is stored in the unit its input schema DECLARES (`paramMeta`). The
|
|
16290
|
+
* wire pair {@link QuantityValue} says "this number is expressed in this
|
|
16291
|
+
* unit"; {@link convertQuantityInput} brings it to the stored unit and refuses,
|
|
16292
|
+
* with a typed {@link QuantityUnitError}, a unit that cannot be that quantity.
|
|
16293
|
+
*/
|
|
16294
|
+
/** A unit that cannot be applied to the number it was given with. */
|
|
16295
|
+
var QuantityUnitError = class extends Error {
|
|
16296
|
+
code;
|
|
16297
|
+
constructor(code, message) {
|
|
16298
|
+
super(`[${code}] ${message}`);
|
|
16299
|
+
this.name = "QuantityUnitError";
|
|
16300
|
+
this.code = code;
|
|
16301
|
+
}
|
|
16302
|
+
};
|
|
16303
|
+
/** The wire pair: `value` is expressed in `unit`. */
|
|
16304
|
+
var QuantityValueSchema = object({
|
|
16305
|
+
value: number(),
|
|
16306
|
+
unit: string().min(1)
|
|
16307
|
+
});
|
|
16308
|
+
/**
|
|
16309
|
+
* Zod `.meta()` bag for a cap METHOD param that is a physical quantity — the
|
|
16310
|
+
* input-side twin of `readingMeta`. The value is carried in `unit` (a gram
|
|
16311
|
+
* portion stays in grams); the unit must belong to the quantity, checked once
|
|
16312
|
+
* when the cap is declared.
|
|
16313
|
+
*/
|
|
16314
|
+
function paramMeta(declared) {
|
|
16315
|
+
const base = baseUnitOf(declared.quantity);
|
|
16316
|
+
if (base === void 0) throw new QuantityUnitError("unknown-unit", `quantity "${declared.quantity}" has no unit`);
|
|
16317
|
+
if (tryConvertUnit(1, declared.unit, base) === void 0) throw new QuantityUnitError("cross-dimension", `"${declared.unit}" is not a unit of ${declared.quantity}`);
|
|
16318
|
+
return {
|
|
16319
|
+
quantity: declared.quantity,
|
|
16320
|
+
unit: declared.unit
|
|
16321
|
+
};
|
|
16322
|
+
}
|
|
16323
|
+
object({
|
|
16324
|
+
quantity: ReadingQuantitySchema,
|
|
16325
|
+
unit: string().min(1)
|
|
16326
|
+
});
|
|
15855
16327
|
/** How a leaf compares a device field to a value. Derived from the field's
|
|
15856
16328
|
* `kind` in `deviceManager.getWireableFields`, never hand-maintained. */
|
|
15857
16329
|
var AutomationConditionOperatorSchema = _enum([
|
|
@@ -15874,8 +16346,10 @@ var AutomationConditionLeafSchema = object({
|
|
|
15874
16346
|
string(),
|
|
15875
16347
|
number(),
|
|
15876
16348
|
boolean(),
|
|
15877
|
-
array(union([string(), number()]))
|
|
15878
|
-
|
|
16349
|
+
array(union([string(), number()])),
|
|
16350
|
+
QuantityValueSchema
|
|
16351
|
+
]),
|
|
16352
|
+
unit: string().min(1).optional()
|
|
15879
16353
|
});
|
|
15880
16354
|
var AutomationConditionStationaryPresentSchema = object({
|
|
15881
16355
|
kind: literal("stationary-present"),
|
|
@@ -16028,7 +16502,13 @@ var AutomationCapStepSchema = object({
|
|
|
16028
16502
|
/** Values may carry `{{vars.x}}` slots, or be exactly `{ $var: 'name' }`, which
|
|
16029
16503
|
* SUBSTITUTE and do not evaluate (§3.2.3). Anything beyond substitution is
|
|
16030
16504
|
* the expression leaf. */
|
|
16031
|
-
args: record(string(), unknown()).optional()
|
|
16505
|
+
args: record(string(), unknown()).optional(),
|
|
16506
|
+
/**
|
|
16507
|
+
* The unit the person picked per arg (display only). `args` always hold the
|
|
16508
|
+
* value in the unit the method's input DECLARES (`paramMeta`); on a write an
|
|
16509
|
+
* arg may be a {@link QuantityValue}, which the save boundary converts.
|
|
16510
|
+
*/
|
|
16511
|
+
argUnits: record(string(), string().min(1)).optional()
|
|
16032
16512
|
});
|
|
16033
16513
|
/**
|
|
16034
16514
|
* The steps an internal Action may contain: cap and wait, and nothing that can
|
|
@@ -16408,6 +16888,16 @@ object({
|
|
|
16408
16888
|
lastRunAt: number().nullable(),
|
|
16409
16889
|
lastError: string().nullable()
|
|
16410
16890
|
});
|
|
16891
|
+
/** A bare number accepted as a base unit — the save succeeded, say so. */
|
|
16892
|
+
var UnitWarningSchema = object({
|
|
16893
|
+
/** Where in the saved record, e.g. `conditions.children.0` or `steps.2.args.grams`. */
|
|
16894
|
+
path: string(),
|
|
16895
|
+
deviceId: number().int().optional(),
|
|
16896
|
+
field: string(),
|
|
16897
|
+
value: number(),
|
|
16898
|
+
assumedUnit: string(),
|
|
16899
|
+
message: string()
|
|
16900
|
+
});
|
|
16411
16901
|
/**
|
|
16412
16902
|
* notification-output — canonical, capability-gated notification delivery.
|
|
16413
16903
|
*
|
|
@@ -21752,56 +22242,6 @@ var DeviceAdminLinkSchema = object({
|
|
|
21752
22242
|
});
|
|
21753
22243
|
method(object({ deviceId: number().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" });
|
|
21754
22244
|
/**
|
|
21755
|
-
* Identity envelope for a device's upstream-system metadata.
|
|
21756
|
-
*
|
|
21757
|
-
* Two jobs:
|
|
21758
|
-
*
|
|
21759
|
-
* 1. **Dispatch key.** `id` is the natural identifier the SOURCE system
|
|
21760
|
-
* uses to address this device (HA `entity_id`, Reolink MAC, ONVIF
|
|
21761
|
-
* WS-Discovery endpoint UUID, …). Provider code keeps a
|
|
21762
|
-
* `Map<sourceInfo.id, IDevice>` to route inbound push events in O(1)
|
|
21763
|
-
* without round-tripping through `stableId` / `id` mappings.
|
|
21764
|
-
*
|
|
21765
|
-
* 2. **Stability bridge.** `uniqueId` is the *immutable* upstream id when
|
|
21766
|
-
* one exists (HA `entity.unique_id`, Reolink MAC again — same as `id`
|
|
21767
|
-
* for vendors where MAC is the natural key). For systems where the
|
|
21768
|
-
* live dispatch key can be renamed (HA `entity_id` can be edited),
|
|
21769
|
-
* providers detect renames by matching `uniqueId` and patch `id`
|
|
21770
|
-
* in-place so dispatch keeps working.
|
|
21771
|
-
*
|
|
21772
|
-
* **Display unit and precision are NOT stored here.** They are a read-time
|
|
21773
|
-
* preference (D944). A polymorphic reading stores its `quantity` here once,
|
|
21774
|
-
* at adopt, and a date/time value stores `dateTimeShape` the same way —
|
|
21775
|
-
* neither is repeated on each sample. The `device_class` tag is an
|
|
21776
|
-
* HA-specific input consumed at the discovery boundary (`ha-domain-mapping`)
|
|
21777
|
-
* to derive the CamStack `DeviceRole`; it is never stored after that point.
|
|
21778
|
-
*
|
|
21779
|
-
* The `raw` escape hatch carries provider-specific attributes that don't
|
|
21780
|
-
* fit the structured slots (HA `attributes` whitelist, Reolink `deviceCache`
|
|
21781
|
-
* details, …). Providers control what lands here.
|
|
21782
|
-
*/
|
|
21783
|
-
var SourceInfoSchema = object({
|
|
21784
|
-
/** Live dispatch key — mutable when the source system allows rename. */
|
|
21785
|
-
id: string(),
|
|
21786
|
-
/** Source system tag — e.g. 'homeassistant' | 'reolink' | 'onvif'. */
|
|
21787
|
-
system: string(),
|
|
21788
|
-
/** Immutable upstream identifier when available (HA `unique_id`, … ).
|
|
21789
|
-
* Used to detect rename when `id` changes. */
|
|
21790
|
-
uniqueId: string().optional(),
|
|
21791
|
-
/** Quantity of a polymorphic reading, written once at adopt (D944). */
|
|
21792
|
-
quantity: ReadingQuantitySchema.optional(),
|
|
21793
|
-
/** Date / time / datetime shape of a string reading, written once at adopt. */
|
|
21794
|
-
dateTimeShape: _enum([
|
|
21795
|
-
"date",
|
|
21796
|
-
"time",
|
|
21797
|
-
"datetime"
|
|
21798
|
-
]).optional(),
|
|
21799
|
-
/** Provider-specific extras that don't fit the structured slots.
|
|
21800
|
-
* Whitelist what goes here per provider — do NOT dump entire HA
|
|
21801
|
-
* attribute blobs (would explode the meta JSON column). */
|
|
21802
|
-
raw: record(string(), unknown()).optional()
|
|
21803
|
-
});
|
|
21804
|
-
/**
|
|
21805
22245
|
* device-discovery — device-scoped capability for parents that host /
|
|
21806
22246
|
* enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
|
|
21807
22247
|
* integrations). The parent advertises a list of discoverable children,
|
|
@@ -57808,13 +58248,19 @@ method(object({}), array(ActionEntrySchema), { auth: "admin" }), method(object({
|
|
|
57808
58248
|
}), method(ActionIdInput, _void(), {
|
|
57809
58249
|
kind: "mutation",
|
|
57810
58250
|
auth: "admin"
|
|
57811
|
-
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({
|
|
58251
|
+
}), method(ActionIdInput, object({ traces: array(AutomationRunTraceSchema) }), { auth: "admin" }), method(object({ action: ActionInputSchema }), object({
|
|
58252
|
+
action: ActionEntrySchema,
|
|
58253
|
+
warnings: array(UnitWarningSchema).optional()
|
|
58254
|
+
}), {
|
|
57812
58255
|
kind: "mutation",
|
|
57813
58256
|
auth: "admin"
|
|
57814
58257
|
}), method(object({
|
|
57815
58258
|
actionId: string().min(1),
|
|
57816
58259
|
action: ActionInputSchema.partial()
|
|
57817
|
-
}), object({
|
|
58260
|
+
}), object({
|
|
58261
|
+
action: ActionEntrySchema,
|
|
58262
|
+
warnings: array(UnitWarningSchema).optional()
|
|
58263
|
+
}), {
|
|
57818
58264
|
kind: "mutation",
|
|
57819
58265
|
auth: "admin"
|
|
57820
58266
|
}), method(ActionIdInput, _void(), {
|
|
@@ -62461,6 +62907,14 @@ var PetFeederDeviceStatusSchema = _enum([
|
|
|
62461
62907
|
"on_batteries"
|
|
62462
62908
|
]);
|
|
62463
62909
|
var gramsPortion = number().int().min(4).max(200);
|
|
62910
|
+
/** A portion REQUESTED of the feeder is a mass the method takes in GRAMS (the
|
|
62911
|
+
* hardware's own unit). The bounds are grams; a caller entering another unit
|
|
62912
|
+
* converts to grams first (`paramMeta`, D972). The STATUS fields above stay
|
|
62913
|
+
* plain grams — they are not readings in the kilogram base. */
|
|
62914
|
+
var gramsParam = gramsPortion.meta(paramMeta({
|
|
62915
|
+
quantity: "mass",
|
|
62916
|
+
unit: "g"
|
|
62917
|
+
}));
|
|
62464
62918
|
object({
|
|
62465
62919
|
/** Food in the TANK (hopper), as the feeder's own sensor reports it
|
|
62466
62920
|
* (`state.food`). A coarse level code, not grams — `0` is empty. The
|
|
@@ -62535,9 +62989,9 @@ object({
|
|
|
62535
62989
|
});
|
|
62536
62990
|
DeviceType.PetFeeder, method(object({
|
|
62537
62991
|
deviceId: number().int().nonnegative(),
|
|
62538
|
-
grams:
|
|
62539
|
-
hopper1:
|
|
62540
|
-
hopper2:
|
|
62992
|
+
grams: gramsParam.optional(),
|
|
62993
|
+
hopper1: gramsParam.optional(),
|
|
62994
|
+
hopper2: gramsParam.optional()
|
|
62541
62995
|
}), _void(), {
|
|
62542
62996
|
kind: "mutation",
|
|
62543
62997
|
auth: "protected"
|
|
@@ -79238,7 +79692,8 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
79238
79692
|
min: 4,
|
|
79239
79693
|
max: 200,
|
|
79240
79694
|
step: 1,
|
|
79241
|
-
unit: "g"
|
|
79695
|
+
unit: "g",
|
|
79696
|
+
quantity: "mass"
|
|
79242
79697
|
},
|
|
79243
79698
|
optional: true
|
|
79244
79699
|
}]
|
|
@@ -79257,7 +79712,8 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
79257
79712
|
min: 4,
|
|
79258
79713
|
max: 200,
|
|
79259
79714
|
step: 1,
|
|
79260
|
-
unit: "g"
|
|
79715
|
+
unit: "g",
|
|
79716
|
+
quantity: "mass"
|
|
79261
79717
|
},
|
|
79262
79718
|
optional: true
|
|
79263
79719
|
}, {
|
|
@@ -79268,7 +79724,8 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
79268
79724
|
min: 4,
|
|
79269
79725
|
max: 200,
|
|
79270
79726
|
step: 1,
|
|
79271
|
-
unit: "g"
|
|
79727
|
+
unit: "g",
|
|
79728
|
+
quantity: "mass"
|
|
79272
79729
|
},
|
|
79273
79730
|
optional: true
|
|
79274
79731
|
}]
|
|
@@ -36,7 +36,7 @@ async function r() {
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"@camstack/types": {
|
|
39
|
-
version: "1.2.
|
|
39
|
+
version: "1.2.447",
|
|
40
40
|
scope: "default",
|
|
41
41
|
shareConfig: {
|
|
42
42
|
singleton: !0,
|
|
@@ -81,7 +81,7 @@ async function r() {
|
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
"@camstack/ui-library": {
|
|
84
|
-
version: "1.2.
|
|
84
|
+
version: "1.2.353",
|
|
85
85
|
scope: "default",
|
|
86
86
|
shareConfig: {
|
|
87
87
|
singleton: !0,
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./dist-
|
|
2
|
+
require("./dist-BkNG49yZ.js");
|
|
3
3
|
const require_orchestrator_training_addon = require("./orchestrator/training.addon.js");
|
|
4
4
|
const require_providers_modal_training_modal_addon = require("./providers/modal/training-modal.addon.js");
|
|
5
5
|
//#region src/providers/fake/fake-provider.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("../dist-
|
|
2
|
+
const require_dist = require("../dist-BkNG49yZ.js");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_dist.__toESM(node_path);
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as parseTrainingEventLine, c as BaseAddon, d as addonPagesSourceCapability, i as TrainingResultSchema, l as RECORD_MAX_DATA_BYTES, m as defineRecordKinds, n as TrainingJobSchema, o as trainingCapability, r as TrainingJobSpecSchema, t as TRAINING_JOB_SCHEMA } from "../dist-
|
|
1
|
+
import { a as parseTrainingEventLine, c as BaseAddon, d as addonPagesSourceCapability, i as TrainingResultSchema, l as RECORD_MAX_DATA_BYTES, m as defineRecordKinds, n as TrainingJobSchema, o as trainingCapability, r as TrainingJobSpecSchema, t as TRAINING_JOB_SCHEMA } from "../dist-DW0wmCpB.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { createReadStream } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { d as e, u as t, w as n, y as r } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react__loadShare__.js-CEvdvp1T.mjs";
|
|
2
2
|
import { n as i, r as a, t as o } from "./_virtual_mf___mfe_internal__addon_training_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DnrbBvrw.mjs";
|
|
3
3
|
import { n as s, t as c } from "./chevron-right-cA8Hucbi.mjs";
|
|
4
|
-
import { g as l } from "./responsive-
|
|
4
|
+
import { g as l } from "./responsive-Dq7_CDVT.mjs";
|
|
5
5
|
//#region ../ui-library/src/composites/widget-panel.tsx
|
|
6
6
|
n();
|
|
7
7
|
function u({ title: e, icon: t, headerRight: n, collapsible: l = !1, defaultOpen: u = !0, open: d, onOpenChange: f, bodyClassName: p = "p-3", children: m }) {
|