@camstack/addon-provider-homematic 1.2.189 → 1.2.190
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/_stub.js +606 -606
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-gabItMV6.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_provider_homematic_page-Q5yqYY2a.mjs} +4 -4
- package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CjAB6Xz2.mjs +26 -0
- package/dist/addon-provider-homematic.css +1 -1
- package/dist/addon.js +719 -463
- package/dist/addon.mjs +719 -463
- package/dist/{hostInit-_8HOpx8j.mjs → hostInit-CUN01TKv.mjs} +3 -3
- package/dist/remoteEntry.js +1 -1
- package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-CcrJu_nF.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_provider_homematic_page__remoteEntry_js-BlhMmAz5.mjs} +1 -1
- package/package.json +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_provider_homematic_page__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-BekQrhZR.mjs +0 -26
package/dist/addon.mjs
CHANGED
|
@@ -812,7 +812,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
812
812
|
return EventCategory;
|
|
813
813
|
}({});
|
|
814
814
|
//#endregion
|
|
815
|
-
//#region ../types/dist/composed-stable-id-
|
|
815
|
+
//#region ../types/dist/composed-stable-id-CPp3votu.mjs
|
|
816
816
|
/**
|
|
817
817
|
import { errMsg } from '@camstack/types'
|
|
818
818
|
* Extract a human-readable message from an unknown error value.
|
|
@@ -825,17 +825,18 @@ function errMsg(err) {
|
|
|
825
825
|
}
|
|
826
826
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
827
827
|
DeviceType["Camera"] = "camera";
|
|
828
|
+
/** Legacy stored value, read only by the hub-to-integration migrations; no live device carries it. */
|
|
828
829
|
DeviceType["Hub"] = "hub";
|
|
829
830
|
DeviceType["Light"] = "light";
|
|
830
831
|
DeviceType["Siren"] = "siren";
|
|
831
832
|
DeviceType["Switch"] = "switch";
|
|
832
833
|
DeviceType["Sensor"] = "sensor";
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
* `climate-control`
|
|
836
|
-
*
|
|
837
|
-
*
|
|
838
|
-
*
|
|
834
|
+
/** Every climate device: an air conditioner, a room thermostat, a radiator
|
|
835
|
+
* valve, a floor-heating zone, a heat-pump circuit. They share one set of
|
|
836
|
+
* controls (`climate-control`), so they are one type; WHICH kind of climate
|
|
837
|
+
* device it is is its {@link DeviceRole} (`climate-*`), which the UI and the
|
|
838
|
+
* exports branch on. The retired `thermostat` type is read as this one
|
|
839
|
+
* (`canonicalStoredDeviceType`). */
|
|
839
840
|
DeviceType["Climate"] = "climate";
|
|
840
841
|
DeviceType["Button"] = "button";
|
|
841
842
|
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
@@ -926,10 +927,6 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
926
927
|
/** Washing machine. A plug-built one is running while its power stays
|
|
927
928
|
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
928
929
|
DeviceType["Washer"] = "washer";
|
|
929
|
-
/** A dumb plug-in stove or heater: a switch (and, with a meter, a power
|
|
930
|
-
* reading) that only runs while the plug is on. Built from a smart plug;
|
|
931
|
-
* the `timed-run` cap switches it off again after a chosen time. */
|
|
932
|
-
DeviceType["Heater"] = "heater";
|
|
933
930
|
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
934
931
|
DeviceType["Dryer"] = "dryer";
|
|
935
932
|
/** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
|
|
@@ -1149,6 +1146,27 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1149
1146
|
/** A smart plug: a `switch` whose source says it is an outlet (HA
|
|
1150
1147
|
* `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
|
|
1151
1148
|
DeviceRole["Outlet"] = "outlet";
|
|
1149
|
+
/** A dumb plug-in stove or heater behind a switch: it runs only while the
|
|
1150
|
+
* switch is on. Offered `timed-run`, which switches it off again after a
|
|
1151
|
+
* chosen time. */
|
|
1152
|
+
DeviceRole["SwitchHeater"] = "switch-heater";
|
|
1153
|
+
/** A plain fan behind a switch (a smart plug powering it): drawn as a fan,
|
|
1154
|
+
* with the switch's on/off only. Speed or oscillation appear only when the
|
|
1155
|
+
* device also has a fan cap (D1033). */
|
|
1156
|
+
DeviceRole["SwitchFan"] = "switch-fan";
|
|
1157
|
+
/** Air conditioner / split unit: cooling, fan speed, louvres. */
|
|
1158
|
+
DeviceRole["ClimateAc"] = "climate-ac";
|
|
1159
|
+
/** Room thermostat: a setpoint and a room temperature. The default. */
|
|
1160
|
+
DeviceRole["ClimateThermostat"] = "climate-thermostat";
|
|
1161
|
+
/** Floor-heating zone actuator. */
|
|
1162
|
+
DeviceRole["ClimateFloor"] = "climate-floor";
|
|
1163
|
+
/** Radiator valve (thermostatic radiator head). */
|
|
1164
|
+
DeviceRole["ClimateRadiator"] = "climate-radiator";
|
|
1165
|
+
/** A heater with its own thermostat (stove, convector). */
|
|
1166
|
+
DeviceRole["ClimateHeater"] = "climate-heater";
|
|
1167
|
+
/** One heating/cooling circuit of a heat pump: a water loop with comfort /
|
|
1168
|
+
* eco setpoints and a heat/cool mode, no room sensor. */
|
|
1169
|
+
DeviceRole["ClimateHeatPumpCircuit"] = "climate-heat-pump-circuit";
|
|
1152
1170
|
/** Generic motion / occupancy / moving event source. Distinct from
|
|
1153
1171
|
* the camera accessory PirSensor role: that one is a camera child;
|
|
1154
1172
|
* this is a standalone HA / 3rd-party motion sensor. */
|
|
@@ -6036,7 +6054,7 @@ var ZodIssueCode = {
|
|
|
6036
6054
|
var ZodFirstPartyTypeKind;
|
|
6037
6055
|
ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
|
|
6038
6056
|
//#endregion
|
|
6039
|
-
//#region ../types/dist/sleep-
|
|
6057
|
+
//#region ../types/dist/sleep-Bn346wCJ.mjs
|
|
6040
6058
|
/**
|
|
6041
6059
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
6042
6060
|
* window to float samples (D455).
|
|
@@ -11753,6 +11771,50 @@ var ACTUATOR_CAP_VOCABULARY = {
|
|
|
11753
11771
|
value: false
|
|
11754
11772
|
},
|
|
11755
11773
|
args: { oscillating: false }
|
|
11774
|
+
},
|
|
11775
|
+
{
|
|
11776
|
+
id: "fan.horizontalOscillateOn",
|
|
11777
|
+
method: "setOscillationAxis",
|
|
11778
|
+
label: t("Horizontal oscillation on", "Oscillazione orizzontale attiva"),
|
|
11779
|
+
phrase: t("Start the horizontal oscillation of {device}", "Attiva l’oscillazione orizzontale di {device}"),
|
|
11780
|
+
icon: "move-horizontal",
|
|
11781
|
+
args: {
|
|
11782
|
+
axis: "horizontal",
|
|
11783
|
+
oscillating: true
|
|
11784
|
+
}
|
|
11785
|
+
},
|
|
11786
|
+
{
|
|
11787
|
+
id: "fan.horizontalOscillateOff",
|
|
11788
|
+
method: "setOscillationAxis",
|
|
11789
|
+
label: t("Horizontal oscillation off", "Oscillazione orizzontale spenta"),
|
|
11790
|
+
phrase: t("Stop the horizontal oscillation of {device}", "Ferma l’oscillazione orizzontale di {device}"),
|
|
11791
|
+
icon: "move-horizontal",
|
|
11792
|
+
args: {
|
|
11793
|
+
axis: "horizontal",
|
|
11794
|
+
oscillating: false
|
|
11795
|
+
}
|
|
11796
|
+
},
|
|
11797
|
+
{
|
|
11798
|
+
id: "fan.verticalOscillateOn",
|
|
11799
|
+
method: "setOscillationAxis",
|
|
11800
|
+
label: t("Vertical oscillation on", "Oscillazione verticale attiva"),
|
|
11801
|
+
phrase: t("Start the vertical oscillation of {device}", "Attiva l’oscillazione verticale di {device}"),
|
|
11802
|
+
icon: "move-vertical",
|
|
11803
|
+
args: {
|
|
11804
|
+
axis: "vertical",
|
|
11805
|
+
oscillating: true
|
|
11806
|
+
}
|
|
11807
|
+
},
|
|
11808
|
+
{
|
|
11809
|
+
id: "fan.verticalOscillateOff",
|
|
11810
|
+
method: "setOscillationAxis",
|
|
11811
|
+
label: t("Vertical oscillation off", "Oscillazione verticale spenta"),
|
|
11812
|
+
phrase: t("Stop the vertical oscillation of {device}", "Ferma l’oscillazione verticale di {device}"),
|
|
11813
|
+
icon: "move-vertical",
|
|
11814
|
+
args: {
|
|
11815
|
+
axis: "vertical",
|
|
11816
|
+
oscillating: false
|
|
11817
|
+
}
|
|
11756
11818
|
}
|
|
11757
11819
|
],
|
|
11758
11820
|
state: [{
|
|
@@ -13842,10 +13904,6 @@ var CAMERA_CAP_VOCABULARY = {
|
|
|
13842
13904
|
scope: "device",
|
|
13843
13905
|
noun: t("Admin link", "Link di amministrazione")
|
|
13844
13906
|
},
|
|
13845
|
-
"device-discovery": {
|
|
13846
|
-
scope: "device",
|
|
13847
|
-
noun: t("Discovery", "Rilevamento dispositivi")
|
|
13848
|
-
},
|
|
13849
13907
|
"device-extension": {
|
|
13850
13908
|
scope: "device",
|
|
13851
13909
|
noun: t("Device extension", "Estensione del dispositivo")
|
|
@@ -15342,7 +15400,6 @@ var CAP_NAMES = Object.freeze([
|
|
|
15342
15400
|
"device-admin-link",
|
|
15343
15401
|
"device-adoption",
|
|
15344
15402
|
"device-credentials",
|
|
15345
|
-
"device-discovery",
|
|
15346
15403
|
"device-export",
|
|
15347
15404
|
"device-extension",
|
|
15348
15405
|
"device-history",
|
|
@@ -15964,13 +16021,6 @@ Object.freeze({
|
|
|
15964
16021
|
"valueType": "string"
|
|
15965
16022
|
}
|
|
15966
16023
|
],
|
|
15967
|
-
"device-discovery": [{
|
|
15968
|
-
"path": "lastDiscoveryAt",
|
|
15969
|
-
"valueType": "number"
|
|
15970
|
-
}, {
|
|
15971
|
-
"path": "lastError",
|
|
15972
|
-
"valueType": "string"
|
|
15973
|
-
}],
|
|
15974
16024
|
"device-export": [
|
|
15975
16025
|
{
|
|
15976
16026
|
"path": "linkState",
|
|
@@ -17422,7 +17472,7 @@ Object.freeze({
|
|
|
17422
17472
|
}
|
|
17423
17473
|
});
|
|
17424
17474
|
//#endregion
|
|
17425
|
-
//#region ../types/dist/implemented-methods-
|
|
17475
|
+
//#region ../types/dist/implemented-methods-5YMDeE3f.mjs
|
|
17426
17476
|
/**
|
|
17427
17477
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
17428
17478
|
*
|
|
@@ -44150,6 +44200,13 @@ var AutomationConditionOperatorSchema = _enum([
|
|
|
44150
44200
|
"in"
|
|
44151
44201
|
]);
|
|
44152
44202
|
/**
|
|
44203
|
+
* The stable name of an event leaf. A path (`when.0.1`) moves when a row is
|
|
44204
|
+
* reordered; the id does not, so a `triggered-by` leaf keeps pointing at the
|
|
44205
|
+
* same row. Optional: a leaf nothing refers to needs none.
|
|
44206
|
+
*/
|
|
44207
|
+
var EVENT_LEAF_ID_RE = /^[A-Za-z0-9_-]{1,40}$/;
|
|
44208
|
+
var eventLeafId = { id: string().regex(EVENT_LEAF_ID_RE).optional() };
|
|
44209
|
+
/**
|
|
44153
44210
|
* D8 compliance, and it is the reason a "becomes" leaf is not merely an event
|
|
44154
44211
|
* subscription: it evaluates against the **state mirror**, which is reconciled,
|
|
44155
44212
|
* and an event only WAKES the evaluation. A dropped event therefore DELAYS a
|
|
@@ -44157,6 +44214,7 @@ var AutomationConditionOperatorSchema = _enum([
|
|
|
44157
44214
|
*/
|
|
44158
44215
|
var DeviceBecomesLeafSchema = object({
|
|
44159
44216
|
kind: literal("device-becomes"),
|
|
44217
|
+
...eventLeafId,
|
|
44160
44218
|
deviceId: number$1().int().nonnegative(),
|
|
44161
44219
|
cap: string().min(1),
|
|
44162
44220
|
fieldPath: string().min(1),
|
|
@@ -44209,6 +44267,7 @@ var DeviceBecomesLeafSchema = object({
|
|
|
44209
44267
|
});
|
|
44210
44268
|
var DeviceEventLeafSchema = object({
|
|
44211
44269
|
kind: literal("device-event"),
|
|
44270
|
+
...eventLeafId,
|
|
44212
44271
|
/** An `EventCategory` value. */
|
|
44213
44272
|
category: string().min(1),
|
|
44214
44273
|
deviceId: number$1().int().nonnegative().optional()
|
|
@@ -44221,18 +44280,24 @@ var DeviceEventLeafSchema = object({
|
|
|
44221
44280
|
*/
|
|
44222
44281
|
var ScheduleLeafSchema = object({
|
|
44223
44282
|
kind: literal("schedule"),
|
|
44283
|
+
...eventLeafId,
|
|
44224
44284
|
at: TimeSpecSchema.optional(),
|
|
44225
44285
|
days: array(WeekdayKeySchema).min(1).max(7).optional(),
|
|
44226
44286
|
/** @deprecated legacy cron — new schedules use `at`. */
|
|
44227
44287
|
cron: string().min(1).max(120).optional()
|
|
44228
44288
|
}).refine((leaf) => leaf.at === void 0 !== (leaf.cron === void 0), { message: "a schedule names exactly one of `at` (a time spec) and `cron` (legacy)" }).refine((leaf) => leaf.days === void 0 || leaf.at !== void 0, { message: "`days` goes with `at`; a cron expression carries its own days" });
|
|
44229
|
-
var ManualLeafSchema = object({
|
|
44289
|
+
var ManualLeafSchema = object({
|
|
44290
|
+
kind: literal("manual"),
|
|
44291
|
+
...eventLeafId
|
|
44292
|
+
});
|
|
44230
44293
|
var IntervalLeafSchema = object({
|
|
44231
44294
|
kind: literal("interval"),
|
|
44295
|
+
...eventLeafId,
|
|
44232
44296
|
minutes: number$1().int().min(1).max(1440)
|
|
44233
44297
|
});
|
|
44234
44298
|
var DetectionLeafSchema = object({
|
|
44235
44299
|
kind: literal("detection"),
|
|
44300
|
+
...eventLeafId,
|
|
44236
44301
|
/** One macro class each, optionally narrowed by a label; a track of any listed subject fires. */
|
|
44237
44302
|
subjects: array(DetectionSubjectSchema).min(1),
|
|
44238
44303
|
deviceIds: array(number$1().int().nonnegative()).min(1),
|
|
@@ -44243,6 +44308,7 @@ var DetectionLeafSchema = object({
|
|
|
44243
44308
|
});
|
|
44244
44309
|
var StationaryLeafSchema = object({
|
|
44245
44310
|
kind: literal("stationary"),
|
|
44311
|
+
...eventLeafId,
|
|
44246
44312
|
deviceIds: array(number$1().int().nonnegative()).min(1),
|
|
44247
44313
|
subjects: array(StationarySubjectSchema).min(1).optional(),
|
|
44248
44314
|
zones: array(string().min(1)).min(1).optional(),
|
|
@@ -44288,6 +44354,41 @@ var StationaryPresentLeafSchema = object({
|
|
|
44288
44354
|
minCount: number$1().int().positive().optional()
|
|
44289
44355
|
});
|
|
44290
44356
|
/**
|
|
44357
|
+
* True while the site-local clock is inside a daily window and/or on one of
|
|
44358
|
+
* the named days. `days` names the local day a window STARTS on, so
|
|
44359
|
+
* 22:00-06:00 on weekdays is still inside at 01:00 Saturday. A one-date spec
|
|
44360
|
+
* (`kind: 'date'`) is refused: only a clock time or a sun event makes a window
|
|
44361
|
+
* that repeats every day.
|
|
44362
|
+
*/
|
|
44363
|
+
var TimeIsLeafSchema = object({
|
|
44364
|
+
kind: literal("time-is"),
|
|
44365
|
+
between: object({
|
|
44366
|
+
from: TimeSpecSchema,
|
|
44367
|
+
to: TimeSpecSchema
|
|
44368
|
+
}).optional(),
|
|
44369
|
+
days: array(WeekdayKeySchema).min(1).max(7).optional()
|
|
44370
|
+
}).superRefine((leaf, ctx) => {
|
|
44371
|
+
if (leaf.between === void 0 && leaf.days === void 0) ctx.addIssue({
|
|
44372
|
+
code: "custom",
|
|
44373
|
+
message: "a time-is leaf needs a between window, days, or both"
|
|
44374
|
+
});
|
|
44375
|
+
for (const end of ["from", "to"]) if (leaf.between?.[end].kind === "date") ctx.addIssue({
|
|
44376
|
+
code: "custom",
|
|
44377
|
+
message: "a one-date time cannot bound a daily window: use a clock time or a sun event",
|
|
44378
|
+
path: ["between", end]
|
|
44379
|
+
});
|
|
44380
|
+
});
|
|
44381
|
+
/**
|
|
44382
|
+
* True for the run that one of the named event leaves started. It reads the
|
|
44383
|
+
* run, not a device: in the tree it is judged against the leaf that fired, in
|
|
44384
|
+
* a step guard against the trigger the run carries. A run no event leaf
|
|
44385
|
+
* started (a state-only tree becoming true) is false.
|
|
44386
|
+
*/
|
|
44387
|
+
var TriggeredByLeafSchema = object({
|
|
44388
|
+
kind: literal("triggered-by"),
|
|
44389
|
+
leafIds: array(string().regex(EVENT_LEAF_ID_RE)).min(1).max(20)
|
|
44390
|
+
});
|
|
44391
|
+
/**
|
|
44291
44392
|
* The escape hatch: the bounded expression engine over named device bindings.
|
|
44292
44393
|
* Declared as a plain object so a discriminated union can read `kind`; the
|
|
44293
44394
|
* author-time validation is the SAME function `ExpressionSourceSchema` runs.
|
|
@@ -44333,7 +44434,9 @@ var AutomationWhenSchema = lazy(() => discriminatedUnion("kind", [
|
|
|
44333
44434
|
StationaryLeafSchema,
|
|
44334
44435
|
DeviceIsLeafSchema,
|
|
44335
44436
|
StationaryPresentLeafSchema,
|
|
44336
|
-
ExpressionLeafSchema
|
|
44437
|
+
ExpressionLeafSchema,
|
|
44438
|
+
TimeIsLeafSchema,
|
|
44439
|
+
TriggeredByLeafSchema
|
|
44337
44440
|
]));
|
|
44338
44441
|
var EVENT_KINDS = new Set([
|
|
44339
44442
|
"device-becomes",
|
|
@@ -44387,6 +44490,28 @@ function hasEventLeaves(node) {
|
|
|
44387
44490
|
});
|
|
44388
44491
|
return found;
|
|
44389
44492
|
}
|
|
44493
|
+
/** The event leaves of the tree that carry an id, in tree order. */
|
|
44494
|
+
function identifiedEventLeaves(when) {
|
|
44495
|
+
const found = [];
|
|
44496
|
+
forEachLeaf(when, (leaf, path) => {
|
|
44497
|
+
if (isEventLeaf(leaf) && leaf.id !== void 0) found.push({
|
|
44498
|
+
id: leaf.id,
|
|
44499
|
+
path,
|
|
44500
|
+
leaf
|
|
44501
|
+
});
|
|
44502
|
+
});
|
|
44503
|
+
return found;
|
|
44504
|
+
}
|
|
44505
|
+
/** Does the tree hold a `triggered-by` leaf? */
|
|
44506
|
+
function hasTriggeredByLeaves(when) {
|
|
44507
|
+
let found = false;
|
|
44508
|
+
forEachLeaf(when, (leaf) => {
|
|
44509
|
+
if (leaf.kind === "triggered-by") found = true;
|
|
44510
|
+
});
|
|
44511
|
+
return found;
|
|
44512
|
+
}
|
|
44513
|
+
/** Why a `triggered-by` leaf is refused outside an automation: there is no trigger row to name. */
|
|
44514
|
+
var TRIGGERED_BY_NEEDS_AUTOMATION = "\"triggered by\" reads which trigger started an automation — an action or a scheduler has no trigger rows, so it could never be true here";
|
|
44390
44515
|
function hasEmptyContainer(node) {
|
|
44391
44516
|
if (isLeaf(node)) return false;
|
|
44392
44517
|
if (node.kind === "not") return hasEmptyContainer(node.child);
|
|
@@ -44445,6 +44570,11 @@ function validateWhenTree(when) {
|
|
|
44445
44570
|
if (depth > 4) return `the rules nest ${depth} levels deep — the limit is 4. "not (any of …)" is the same as "all of (not …)", which is one level shallower`;
|
|
44446
44571
|
const leaves = countWhenLeaves(when);
|
|
44447
44572
|
if (leaves > 32) return `the rules use ${leaves} rows — the limit is 32`;
|
|
44573
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44574
|
+
for (const entry of identifiedEventLeaves(when)) {
|
|
44575
|
+
if (seen.has(entry.id)) return `two trigger rows share the id "${entry.id}" — an id names one row`;
|
|
44576
|
+
seen.add(entry.id);
|
|
44577
|
+
}
|
|
44448
44578
|
const need = eventNeed(when, "when", false);
|
|
44449
44579
|
if ("error" in need) return need.error;
|
|
44450
44580
|
const [first, second] = need.paths;
|
|
@@ -44735,7 +44865,18 @@ var GuardedCapStepSchema = AutomationCapStepBaseSchema.extend(stepGuardShape).re
|
|
|
44735
44865
|
message: "a domain target needs the vocabulary action it applies to (actionId)",
|
|
44736
44866
|
path: ["actionId"]
|
|
44737
44867
|
}).refine((step) => step.else === void 0 || step.if !== void 0, elseNeedsIf);
|
|
44738
|
-
|
|
44868
|
+
/**
|
|
44869
|
+
* A step of a STANDALONE list (an action, a scheduler point, a preset): the
|
|
44870
|
+
* same two step kinds an automation runs, minus a guard that reads the
|
|
44871
|
+
* automation's trigger, which such a list does not have.
|
|
44872
|
+
*/
|
|
44873
|
+
var ActionStepSchema = discriminatedUnion("kind", [GuardedWaitStepSchema, GuardedCapStepSchema]).superRefine((step, ctx) => {
|
|
44874
|
+
if (step.if !== void 0 && hasTriggeredByLeaves(step.if)) ctx.addIssue({
|
|
44875
|
+
code: "custom",
|
|
44876
|
+
message: TRIGGERED_BY_NEEDS_AUTOMATION,
|
|
44877
|
+
path: ["if"]
|
|
44878
|
+
});
|
|
44879
|
+
});
|
|
44739
44880
|
var AutomationActionSchema = discriminatedUnion("kind", [
|
|
44740
44881
|
GuardedWaitStepSchema,
|
|
44741
44882
|
GuardedCapStepSchema,
|
|
@@ -44832,6 +44973,11 @@ var STATIONARY_DESCRIPTIONS = {
|
|
|
44832
44973
|
phase: "appeared or departed",
|
|
44833
44974
|
entryId: "the stopped object"
|
|
44834
44975
|
};
|
|
44976
|
+
var BECOMES_DESCRIPTIONS = {
|
|
44977
|
+
deviceId: "the device that changed",
|
|
44978
|
+
from: "the value before the change, empty when it is not known",
|
|
44979
|
+
to: "the value it changed to"
|
|
44980
|
+
};
|
|
44835
44981
|
function describe$1(descriptions) {
|
|
44836
44982
|
return Object.entries(descriptions).map(([name, description]) => ({
|
|
44837
44983
|
name,
|
|
@@ -44840,6 +44986,10 @@ function describe$1(descriptions) {
|
|
|
44840
44986
|
}
|
|
44841
44987
|
describe$1(DETECTION_DESCRIPTIONS);
|
|
44842
44988
|
describe$1(STATIONARY_DESCRIPTIONS);
|
|
44989
|
+
describe$1(BECOMES_DESCRIPTIONS).map((v) => v.name === "deviceId" ? {
|
|
44990
|
+
...v,
|
|
44991
|
+
hintKey: "becomesDeviceId"
|
|
44992
|
+
} : v);
|
|
44843
44993
|
new Set(Object.values(COCO_TO_MACRO.mapping));
|
|
44844
44994
|
/**
|
|
44845
44995
|
* Schedulers (D983) — an entity that performs actions over the day.
|
|
@@ -44864,6 +45014,13 @@ var SchedulerStateTreeSchema = AutomationWhenSchema.superRefine((when, ctx) => {
|
|
|
44864
45014
|
});
|
|
44865
45015
|
return;
|
|
44866
45016
|
}
|
|
45017
|
+
if (hasTriggeredByLeaves(when)) {
|
|
45018
|
+
ctx.addIssue({
|
|
45019
|
+
code: "custom",
|
|
45020
|
+
message: TRIGGERED_BY_NEEDS_AUTOMATION
|
|
45021
|
+
});
|
|
45022
|
+
return;
|
|
45023
|
+
}
|
|
44867
45024
|
const problem = validateWhenTree(when);
|
|
44868
45025
|
if (problem !== null) ctx.addIssue({
|
|
44869
45026
|
code: "custom",
|
|
@@ -45084,6 +45241,8 @@ var AutomationConditionTraceNodeSchema = object({
|
|
|
45084
45241
|
"device-is",
|
|
45085
45242
|
"expression",
|
|
45086
45243
|
"stationary-present",
|
|
45244
|
+
"time-is",
|
|
45245
|
+
"triggered-by",
|
|
45087
45246
|
"device-becomes",
|
|
45088
45247
|
"device-event",
|
|
45089
45248
|
"schedule",
|
|
@@ -45417,7 +45576,7 @@ object({
|
|
|
45417
45576
|
* is irrelevant; the array is treated as a set by consumers. */
|
|
45418
45577
|
hiddenChildIds: array(number$1()).readonly()
|
|
45419
45578
|
});
|
|
45420
|
-
DeviceType.Camera, DeviceType.
|
|
45579
|
+
DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Sensor, DeviceType.Climate, DeviceType.Cover, DeviceType.Lock, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Generic, method(object({
|
|
45421
45580
|
deviceId: number$1().int().nonnegative(),
|
|
45422
45581
|
childDeviceId: number$1().int().nonnegative(),
|
|
45423
45582
|
hidden: boolean()
|
|
@@ -47715,7 +47874,7 @@ var BATTERY_DEVICE_TYPES = [
|
|
|
47715
47874
|
DeviceType.Switch,
|
|
47716
47875
|
DeviceType.PetFeeder,
|
|
47717
47876
|
DeviceType.Container,
|
|
47718
|
-
DeviceType.
|
|
47877
|
+
DeviceType.Climate,
|
|
47719
47878
|
DeviceType.EventEmitter
|
|
47720
47879
|
];
|
|
47721
47880
|
/** Generic Customize target for the percentage reading (D936). */
|
|
@@ -49478,7 +49637,14 @@ var climateControlCapability = {
|
|
|
49478
49637
|
scope: "device",
|
|
49479
49638
|
deviceNative: true,
|
|
49480
49639
|
mode: "singleton",
|
|
49481
|
-
deviceTypes: [DeviceType.
|
|
49640
|
+
deviceTypes: [DeviceType.Climate],
|
|
49641
|
+
power: {
|
|
49642
|
+
kind: "mode",
|
|
49643
|
+
field: "mode",
|
|
49644
|
+
offValue: "off",
|
|
49645
|
+
set: "setMode",
|
|
49646
|
+
lastField: "lastActiveMode"
|
|
49647
|
+
},
|
|
49482
49648
|
methods: {
|
|
49483
49649
|
setMode: method(object({
|
|
49484
49650
|
deviceId: number$1().int().nonnegative(),
|
|
@@ -49863,6 +50029,7 @@ var CompositionProblemSchema = object({
|
|
|
49863
50029
|
"nested-field",
|
|
49864
50030
|
"missing-field",
|
|
49865
50031
|
"kind-mismatch",
|
|
50032
|
+
"source-kind-mismatch",
|
|
49866
50033
|
"may-be-null",
|
|
49867
50034
|
"source-missing",
|
|
49868
50035
|
"source-unreadable",
|
|
@@ -49884,7 +50051,8 @@ var CompositionProblemSchema = object({
|
|
|
49884
50051
|
"command-method-unknown",
|
|
49885
50052
|
"command-source-unknown",
|
|
49886
50053
|
"command-input-unknown",
|
|
49887
|
-
"command-input-missing"
|
|
50054
|
+
"command-input-missing",
|
|
50055
|
+
"power-source-is-actuator"
|
|
49888
50056
|
]),
|
|
49889
50057
|
path: string(),
|
|
49890
50058
|
message: string()
|
|
@@ -50922,6 +51090,13 @@ var mediaPlayerCapability = {
|
|
|
50922
51090
|
deviceNative: true,
|
|
50923
51091
|
mode: "singleton",
|
|
50924
51092
|
deviceTypes: [DeviceType.MediaPlayer],
|
|
51093
|
+
power: {
|
|
51094
|
+
kind: "methods",
|
|
51095
|
+
field: "state",
|
|
51096
|
+
offValues: ["off", "standby"],
|
|
51097
|
+
on: "turnOn",
|
|
51098
|
+
off: "turnOff"
|
|
51099
|
+
},
|
|
50925
51100
|
methods: {
|
|
50926
51101
|
turnOn: optionalMethod(deviceOnly, _void(), {
|
|
50927
51102
|
kind: "mutation",
|
|
@@ -51052,7 +51227,7 @@ var mediaPlayerCapability = {
|
|
|
51052
51227
|
isMuted: { kind: "boolean" }
|
|
51053
51228
|
} }
|
|
51054
51229
|
};
|
|
51055
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.
|
|
51230
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Climate, DeviceType.EventEmitter, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Fan, DeviceType.Lock, DeviceType.Camera, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Switch, DeviceType.Light, DeviceType.Fan, DeviceType.Climate, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.PetFeeder, DeviceType.Gateway, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater, DeviceType.MediaPlayer, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.PetFeeder, DeviceType.MediaPlayer;
|
|
51056
51231
|
var NUMBER = {
|
|
51057
51232
|
kind: "fixed",
|
|
51058
51233
|
result: ["number"]
|
|
@@ -51135,7 +51310,7 @@ function numeric(input) {
|
|
|
51135
51310
|
}, ...alsoFrom === void 0 ? [] : [alsoFrom.accept]]
|
|
51136
51311
|
};
|
|
51137
51312
|
}
|
|
51138
|
-
var CLIMATE_DEVICES = [DeviceType.
|
|
51313
|
+
var CLIMATE_DEVICES = [DeviceType.Climate];
|
|
51139
51314
|
function binary(input) {
|
|
51140
51315
|
return {
|
|
51141
51316
|
...input,
|
|
@@ -51457,8 +51632,8 @@ var GROUP_TEMPLATES = [
|
|
|
51457
51632
|
actuator({
|
|
51458
51633
|
id: "climate",
|
|
51459
51634
|
summary: "Running when at least one thermostat or air conditioner is not off, or only when all of them are. Target temperature and fan are offered only when every device has them. A device that reports nothing is left out, never read as off.",
|
|
51460
|
-
deviceType: DeviceType.
|
|
51461
|
-
memberDeviceTypes: [DeviceType.
|
|
51635
|
+
deviceType: DeviceType.Climate,
|
|
51636
|
+
memberDeviceTypes: [DeviceType.Climate],
|
|
51462
51637
|
outputCap: "group-active",
|
|
51463
51638
|
outputField: "active",
|
|
51464
51639
|
member: {
|
|
@@ -51501,6 +51676,118 @@ function actuator(input) {
|
|
|
51501
51676
|
new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
|
|
51502
51677
|
DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
|
|
51503
51678
|
DeviceType.Camera;
|
|
51679
|
+
var PowerSourceRefusalReasonSchema = _enum([
|
|
51680
|
+
"no-power-source",
|
|
51681
|
+
"switch-missing",
|
|
51682
|
+
"switch-offline",
|
|
51683
|
+
"switch-unknown",
|
|
51684
|
+
"restart-in-progress",
|
|
51685
|
+
"switch-call-failed",
|
|
51686
|
+
"switch-is-actuator"
|
|
51687
|
+
]);
|
|
51688
|
+
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
51689
|
+
accepted: literal(false),
|
|
51690
|
+
reason: PowerSourceRefusalReasonSchema,
|
|
51691
|
+
/** One line for the operator, naming the switch. */
|
|
51692
|
+
message: string()
|
|
51693
|
+
})]);
|
|
51694
|
+
var PowerSourceInfoSchema = object({
|
|
51695
|
+
/** False when the device has no power source linked; the rest is then empty. */
|
|
51696
|
+
linked: boolean(),
|
|
51697
|
+
switchDeviceId: number$1().nullable(),
|
|
51698
|
+
switchName: string().nullable(),
|
|
51699
|
+
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
51700
|
+
switchOn: boolean().nullable(),
|
|
51701
|
+
switchOnline: boolean().nullable(),
|
|
51702
|
+
restartInProgress: boolean(),
|
|
51703
|
+
offSeconds: number$1().int()
|
|
51704
|
+
});
|
|
51705
|
+
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
51706
|
+
var PowerSourceStateSchema = object({
|
|
51707
|
+
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
51708
|
+
switchOn: boolean().nullable(),
|
|
51709
|
+
offSeconds: number$1().int(),
|
|
51710
|
+
lastFetchedAt: number$1()
|
|
51711
|
+
});
|
|
51712
|
+
var POWER_SOURCE_DEVICE_TYPES = [
|
|
51713
|
+
DeviceType.Gateway,
|
|
51714
|
+
DeviceType.Camera,
|
|
51715
|
+
DeviceType.Sensor,
|
|
51716
|
+
DeviceType.MediaPlayer,
|
|
51717
|
+
DeviceType.Vacuum,
|
|
51718
|
+
DeviceType.Generic,
|
|
51719
|
+
DeviceType.Washer,
|
|
51720
|
+
DeviceType.Dryer,
|
|
51721
|
+
DeviceType.Dishwasher,
|
|
51722
|
+
DeviceType.PetFountain,
|
|
51723
|
+
DeviceType.Fan,
|
|
51724
|
+
DeviceType.Humidifier,
|
|
51725
|
+
DeviceType.Climate,
|
|
51726
|
+
DeviceType.WaterHeater
|
|
51727
|
+
];
|
|
51728
|
+
var powerSourceCustomize = {
|
|
51729
|
+
version: 1,
|
|
51730
|
+
targets: [{
|
|
51731
|
+
id: "switch",
|
|
51732
|
+
cardinality: "scalar",
|
|
51733
|
+
vocabulary: {
|
|
51734
|
+
cap: "power-source",
|
|
51735
|
+
stateField: "switchOn"
|
|
51736
|
+
},
|
|
51737
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
51738
|
+
apply: "add",
|
|
51739
|
+
path: "switchOn",
|
|
51740
|
+
sources: [{
|
|
51741
|
+
kind: "switch",
|
|
51742
|
+
transforms: [{ kind: "identity" }]
|
|
51743
|
+
}],
|
|
51744
|
+
companions: [{
|
|
51745
|
+
kind: "constant",
|
|
51746
|
+
path: "offSeconds",
|
|
51747
|
+
value: 10,
|
|
51748
|
+
when: "add",
|
|
51749
|
+
formerValues: [0]
|
|
51750
|
+
}, {
|
|
51751
|
+
kind: "clock",
|
|
51752
|
+
path: "lastFetchedAt",
|
|
51753
|
+
when: "always"
|
|
51754
|
+
}],
|
|
51755
|
+
sourceReport: { status: "assignment-status" }
|
|
51756
|
+
}]
|
|
51757
|
+
};
|
|
51758
|
+
var deviceInput$2 = object({ deviceId: number$1().int().nonnegative() });
|
|
51759
|
+
var powerSourceCapability = {
|
|
51760
|
+
name: "power-source",
|
|
51761
|
+
scope: "device",
|
|
51762
|
+
mode: "singleton",
|
|
51763
|
+
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
51764
|
+
methods: {
|
|
51765
|
+
getStatus: systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "protected" }),
|
|
51766
|
+
powerOn: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
51767
|
+
kind: "mutation",
|
|
51768
|
+
auth: "protected"
|
|
51769
|
+
}),
|
|
51770
|
+
powerOff: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
51771
|
+
kind: "mutation",
|
|
51772
|
+
auth: "protected"
|
|
51773
|
+
}),
|
|
51774
|
+
forceRestart: systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
|
|
51775
|
+
kind: "mutation",
|
|
51776
|
+
auth: "protected"
|
|
51777
|
+
})
|
|
51778
|
+
},
|
|
51779
|
+
runtimeState: PowerSourceStateSchema,
|
|
51780
|
+
customize: powerSourceCustomize,
|
|
51781
|
+
/**
|
|
51782
|
+
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
51783
|
+
* its next report; a restored value would outlive the reading it names.
|
|
51784
|
+
*
|
|
51785
|
+
* See `RuntimeStateDurability`. Enforced by
|
|
51786
|
+
* `scripts/check-runtime-state-durability.ts`.
|
|
51787
|
+
*/
|
|
51788
|
+
durability: "session",
|
|
51789
|
+
history: "none"
|
|
51790
|
+
};
|
|
51504
51791
|
`${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
|
|
51505
51792
|
/**
|
|
51506
51793
|
* What a composition may BUILD on a device type (G2, D676): the caps a new
|
|
@@ -52545,167 +52832,6 @@ var deviceAdminLinkCapability = {
|
|
|
52545
52832
|
getAdminLink: method(object({ deviceId: number$1().int().nonnegative() }), DeviceAdminLinkSchema.nullable(), { auth: "admin" }) }
|
|
52546
52833
|
};
|
|
52547
52834
|
/**
|
|
52548
|
-
* device-discovery — device-scoped capability for parents that host /
|
|
52549
|
-
* enumerate child devices (Reolink Hub / NVR, ONVIF gateway, future
|
|
52550
|
-
* integrations). The parent advertises a list of discoverable children,
|
|
52551
|
-
* and the operator promotes a subset to real devices via `adoptDevice`.
|
|
52552
|
-
* Child lifecycle (kernel device create/remove, parent reference) is
|
|
52553
|
-
* owned by the framework so a single shared `<DiscoveryPanel />` can
|
|
52554
|
-
* drive any integration.
|
|
52555
|
-
*
|
|
52556
|
-
* Boundaries:
|
|
52557
|
-
* - The cap exposes ENUMERATION + ADOPT/RELEASE only. The protocol
|
|
52558
|
-
* used to discover children (CGI poll, mDNS, push from hub, ...)
|
|
52559
|
-
* is the integration's business; results land in `runtimeState`
|
|
52560
|
-
* so the panel can render without a fresh round-trip.
|
|
52561
|
-
* - `childNativeId` is integration-defined and must be stable across
|
|
52562
|
-
* reboots so re-discovery doesn't duplicate adopted children.
|
|
52563
|
-
* - `adoptDevice` returns the new `deviceId` so the UI can navigate
|
|
52564
|
-
* directly to the freshly-created child's settings page.
|
|
52565
|
-
*/
|
|
52566
|
-
/**
|
|
52567
|
-
* Status enum for a discovered device. Mirrors the Reolink simpleEvent
|
|
52568
|
-
* lifecycle (`online` / `sleeping` / `offline`) — generic enough for
|
|
52569
|
-
* battery cams, awake cams, and unreachable cams alike.
|
|
52570
|
-
*/
|
|
52571
|
-
var DiscoveredChildStatusSchema = _enum([
|
|
52572
|
-
"online",
|
|
52573
|
-
"sleeping",
|
|
52574
|
-
"offline",
|
|
52575
|
-
"unknown"
|
|
52576
|
-
]);
|
|
52577
|
-
var DiscoveredChildDeviceSchema = lazy(() => object({
|
|
52578
|
-
/** Stable, integration-defined identifier. Must be unique per parent and persistent across reboots. */
|
|
52579
|
-
childNativeId: string(),
|
|
52580
|
-
/** Friendly name as reported by the source (Reolink camera name, ONVIF profile, ...). */
|
|
52581
|
-
name: string(),
|
|
52582
|
-
/** DeviceType the child should be created with on adopt. */
|
|
52583
|
-
type: _enum(DeviceType),
|
|
52584
|
-
status: DiscoveredChildStatusSchema,
|
|
52585
|
-
/** Free-form integration-specific metadata surfaced in the panel. */
|
|
52586
|
-
metadata: object({
|
|
52587
|
-
model: string().optional(),
|
|
52588
|
-
serialNumber: string().optional(),
|
|
52589
|
-
uid: string().optional(),
|
|
52590
|
-
/** Reolink: 0-based channel index inside the parent NVR/Hub. */
|
|
52591
|
-
rtspChannel: number$1().int().nonnegative().optional(),
|
|
52592
|
-
isBattery: boolean().optional(),
|
|
52593
|
-
isDoorbell: boolean().optional(),
|
|
52594
|
-
isMultifocal: boolean().optional(),
|
|
52595
|
-
externalLocation: string().optional(),
|
|
52596
|
-
/** Vendor / manufacturer name as reported by the source (HA device
|
|
52597
|
-
* `manufacturer`, …). Surfaced in the adoption modal's fuzzy search. */
|
|
52598
|
-
manufacturer: string().optional(),
|
|
52599
|
-
/** Integration / platform domain the candidate belongs to (HA
|
|
52600
|
-
* `entity_registry.platform`, e.g. `dreame_vacuum`). Surfaced in the
|
|
52601
|
-
* adoption modal's fuzzy search. */
|
|
52602
|
-
integration: string().optional()
|
|
52603
|
-
}).default({}),
|
|
52604
|
-
/**
|
|
52605
|
-
* `true` when the framework already created a child device for this
|
|
52606
|
-
* `childNativeId` under the current parent. The panel uses it to
|
|
52607
|
-
* gate the Add/Remove button and surface the existing `deviceId`.
|
|
52608
|
-
*/
|
|
52609
|
-
alreadyAdopted: boolean(),
|
|
52610
|
-
/** When `alreadyAdopted=true`, the framework-assigned child device id. */
|
|
52611
|
-
adoptedDeviceId: number$1().int().nonnegative().nullable(),
|
|
52612
|
-
/** Capability names the candidate advertises — integrations populate, Hubs omit. */
|
|
52613
|
-
capabilities: array(string()).readonly().optional(),
|
|
52614
|
-
/** Feature flags the candidate advertises — integrations populate, Hubs omit. */
|
|
52615
|
-
features: array(string()).readonly().optional(),
|
|
52616
|
-
/** Upstream-system identity + rendering hints for the candidate. */
|
|
52617
|
-
sourceInfo: SourceInfoSchema.optional(),
|
|
52618
|
-
/** Nested entity-children for accordion preview — integrations populate, Hubs omit. */
|
|
52619
|
-
children: array(DiscoveredChildDeviceSchema).readonly().optional(),
|
|
52620
|
-
/** `childNativeId` of the gateway candidate in the same list this device sits behind. */
|
|
52621
|
-
parentStableId: string().optional()
|
|
52622
|
-
}));
|
|
52623
|
-
/**
|
|
52624
|
-
* Status block — populated by the integration after each
|
|
52625
|
-
* `refreshDiscovery` (or push-driven update). The runtime-state slice
|
|
52626
|
-
* is what the panel reads via the per-device proxy; `getStatus`
|
|
52627
|
-
* returns the same payload via the codegen'd auto-injection.
|
|
52628
|
-
*/
|
|
52629
|
-
var DeviceDiscoveryStatusSchema = object({
|
|
52630
|
-
discovered: array(DiscoveredChildDeviceSchema),
|
|
52631
|
-
/** Wall-clock ms of the last successful enumeration. */
|
|
52632
|
-
lastDiscoveryAt: number$1().int().nonnegative().nullable(),
|
|
52633
|
-
/** Last error surfaced from the source (rendered as a banner). */
|
|
52634
|
-
lastError: string().nullable()
|
|
52635
|
-
});
|
|
52636
|
-
var deviceDiscoveryCapability = {
|
|
52637
|
-
name: "device-discovery",
|
|
52638
|
-
scope: "device",
|
|
52639
|
-
deviceNative: true,
|
|
52640
|
-
mode: "singleton",
|
|
52641
|
-
deviceTypes: [DeviceType.Hub],
|
|
52642
|
-
status: {
|
|
52643
|
-
schema: DeviceDiscoveryStatusSchema,
|
|
52644
|
-
kind: "poll"
|
|
52645
|
-
},
|
|
52646
|
-
runtimeState: DeviceDiscoveryStatusSchema.extend({ lastFetchedAt: number$1().int().nonnegative() }),
|
|
52647
|
-
/**
|
|
52648
|
-
* Runtime-state durability: **session** — 5.7 KB of scan output on the largest device, fully re-derivable by re-scanning.
|
|
52649
|
-
*
|
|
52650
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
52651
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
52652
|
-
*/
|
|
52653
|
-
durability: "session",
|
|
52654
|
-
/**
|
|
52655
|
-
* History (D850): none — inventory.
|
|
52656
|
-
*/
|
|
52657
|
-
history: "none",
|
|
52658
|
-
methods: {
|
|
52659
|
-
/**
|
|
52660
|
-
* Snapshot of the current `discovered` list. Returns the
|
|
52661
|
-
* runtime-state cache — call `refreshDiscovery` first if a
|
|
52662
|
-
* fresh round-trip to the source is required.
|
|
52663
|
-
*/
|
|
52664
|
-
listDiscovered: method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly()),
|
|
52665
|
-
/**
|
|
52666
|
-
* Force the integration to re-enumerate and update the
|
|
52667
|
-
* runtime-state slice. Returns the freshly-enumerated list (also
|
|
52668
|
-
* available via `listDiscovered` post-call).
|
|
52669
|
-
*/
|
|
52670
|
-
refreshDiscovery: method(object({ deviceId: number$1().int().nonnegative() }), array(DiscoveredChildDeviceSchema).readonly(), {
|
|
52671
|
-
kind: "mutation",
|
|
52672
|
-
auth: "admin"
|
|
52673
|
-
}),
|
|
52674
|
-
/**
|
|
52675
|
-
* Promote a discovered entry to a real child device. The framework
|
|
52676
|
-
* creates the child via `kernel.devices.create()` with
|
|
52677
|
-
* `parentDeviceId = parent.id` and seeds the child's config from
|
|
52678
|
-
* `childInitialConfig` (driver-defined; usually carries channel +
|
|
52679
|
-
* uid + parent reference). Returns the kernel-assigned numeric id.
|
|
52680
|
-
*/
|
|
52681
|
-
adoptDevice: method(object({
|
|
52682
|
-
deviceId: number$1().int().nonnegative(),
|
|
52683
|
-
childNativeId: string(),
|
|
52684
|
-
/** Optional override for the child's display name. */
|
|
52685
|
-
name: string().optional()
|
|
52686
|
-
}), object({
|
|
52687
|
-
deviceId: number$1().int().nonnegative(),
|
|
52688
|
-
stableId: string()
|
|
52689
|
-
}), {
|
|
52690
|
-
kind: "mutation",
|
|
52691
|
-
auth: "admin"
|
|
52692
|
-
}),
|
|
52693
|
-
/**
|
|
52694
|
-
* Inverse of `adoptDevice`: removes the child device from the
|
|
52695
|
-
* kernel registry. The discovered entry remains in the
|
|
52696
|
-
* enumeration (status updates resume) so the operator can re-adopt
|
|
52697
|
-
* it later without a fresh refresh.
|
|
52698
|
-
*/
|
|
52699
|
-
releaseDevice: method(object({
|
|
52700
|
-
deviceId: number$1().int().nonnegative(),
|
|
52701
|
-
childDeviceId: number$1().int().nonnegative()
|
|
52702
|
-
}), _void(), {
|
|
52703
|
-
kind: "mutation",
|
|
52704
|
-
auth: "admin"
|
|
52705
|
-
})
|
|
52706
|
-
}
|
|
52707
|
-
};
|
|
52708
|
-
/**
|
|
52709
52835
|
* `device-adoption` — generic discovery + adoption surface,
|
|
52710
52836
|
* system-scoped collection (one provider per integration addon), routed
|
|
52711
52837
|
* by explicit `{ addonId }` on direct `deviceAdoption.*` calls — the same
|
|
@@ -52714,9 +52840,9 @@ var deviceDiscoveryCapability = {
|
|
|
52714
52840
|
* successor to `ha-discovery`:
|
|
52715
52841
|
* keyed by `integrationId` (the addon resolves integrationId → broker
|
|
52716
52842
|
* internally) rather than a connection-specific `brokerId`, and it
|
|
52717
|
-
*
|
|
52718
|
-
*
|
|
52719
|
-
*
|
|
52843
|
+
* OWNS the shared `DiscoveredChildDevice` candidate type
|
|
52844
|
+
* (declared below) so a single shared adoption modal renders any integration's
|
|
52845
|
+
* candidate tree.
|
|
52720
52846
|
*
|
|
52721
52847
|
* UI flow (Integrations page → integration detail):
|
|
52722
52848
|
* 1. `listCandidates({integrationId, page, pageSize, filter})` →
|
|
@@ -52734,6 +52860,62 @@ var deviceDiscoveryCapability = {
|
|
|
52734
52860
|
* removes the parent + every child from the kernel registry.
|
|
52735
52861
|
*/
|
|
52736
52862
|
/**
|
|
52863
|
+
* Status enum for a discovered device. Generic enough for
|
|
52864
|
+
* battery cams, awake cams, and unreachable cams alike.
|
|
52865
|
+
*/
|
|
52866
|
+
var DiscoveredChildStatusSchema = _enum([
|
|
52867
|
+
"online",
|
|
52868
|
+
"sleeping",
|
|
52869
|
+
"offline",
|
|
52870
|
+
"unknown"
|
|
52871
|
+
]);
|
|
52872
|
+
var DiscoveredChildDeviceSchema = lazy(() => object({
|
|
52873
|
+
/** Stable, integration-defined identifier. Must be unique per parent and persistent across reboots. */
|
|
52874
|
+
childNativeId: string(),
|
|
52875
|
+
/** Friendly name as reported by the source (Reolink camera name, ONVIF profile, ...). */
|
|
52876
|
+
name: string(),
|
|
52877
|
+
/** DeviceType the child should be created with on adopt. */
|
|
52878
|
+
type: _enum(DeviceType),
|
|
52879
|
+
status: DiscoveredChildStatusSchema,
|
|
52880
|
+
/** Free-form integration-specific metadata surfaced in the adoption modal. */
|
|
52881
|
+
metadata: object({
|
|
52882
|
+
model: string().optional(),
|
|
52883
|
+
serialNumber: string().optional(),
|
|
52884
|
+
uid: string().optional(),
|
|
52885
|
+
/** Reolink: 0-based channel index inside the parent NVR. */
|
|
52886
|
+
rtspChannel: number$1().int().nonnegative().optional(),
|
|
52887
|
+
isBattery: boolean().optional(),
|
|
52888
|
+
isDoorbell: boolean().optional(),
|
|
52889
|
+
isMultifocal: boolean().optional(),
|
|
52890
|
+
externalLocation: string().optional(),
|
|
52891
|
+
/** Vendor / manufacturer name as reported by the source (HA device
|
|
52892
|
+
* `manufacturer`, …). Surfaced in the adoption modal's fuzzy search. */
|
|
52893
|
+
manufacturer: string().optional(),
|
|
52894
|
+
/** Integration / platform domain the candidate belongs to (HA
|
|
52895
|
+
* `entity_registry.platform`, e.g. `dreame_vacuum`). Surfaced in the
|
|
52896
|
+
* adoption modal's fuzzy search. */
|
|
52897
|
+
integration: string().optional()
|
|
52898
|
+
}).default({}),
|
|
52899
|
+
/**
|
|
52900
|
+
* `true` when the framework already created a child device for this
|
|
52901
|
+
* `childNativeId` under the current parent. The adoption modal uses it to
|
|
52902
|
+
* gate the Add/Remove button and surface the existing `deviceId`.
|
|
52903
|
+
*/
|
|
52904
|
+
alreadyAdopted: boolean(),
|
|
52905
|
+
/** When `alreadyAdopted=true`, the framework-assigned child device id. */
|
|
52906
|
+
adoptedDeviceId: number$1().int().nonnegative().nullable(),
|
|
52907
|
+
/** Capability names the candidate advertises — integrations populate, flat enumerations omit. */
|
|
52908
|
+
capabilities: array(string()).readonly().optional(),
|
|
52909
|
+
/** Feature flags the candidate advertises — integrations populate, flat enumerations omit. */
|
|
52910
|
+
features: array(string()).readonly().optional(),
|
|
52911
|
+
/** Upstream-system identity + rendering hints for the candidate. */
|
|
52912
|
+
sourceInfo: SourceInfoSchema.optional(),
|
|
52913
|
+
/** Nested entity-children for accordion preview — integrations populate, flat enumerations omit. */
|
|
52914
|
+
children: array(DiscoveredChildDeviceSchema).readonly().optional(),
|
|
52915
|
+
/** `childNativeId` of the gateway candidate in the same list this device sits behind. */
|
|
52916
|
+
parentStableId: string().optional()
|
|
52917
|
+
}));
|
|
52918
|
+
/**
|
|
52737
52919
|
* Provider-declared discovery *granularity* filter (the keystone of the
|
|
52738
52920
|
* single-entity-import design). A provider advertises which discovery
|
|
52739
52921
|
* granularities it supports via `listCandidateFilters`; the operator picks
|
|
@@ -54161,8 +54343,14 @@ method(object({
|
|
|
54161
54343
|
"string",
|
|
54162
54344
|
"number",
|
|
54163
54345
|
"boolean",
|
|
54164
|
-
"enum"
|
|
54346
|
+
"enum",
|
|
54347
|
+
"union"
|
|
54165
54348
|
]),
|
|
54349
|
+
unionMembers: array(_enum([
|
|
54350
|
+
"string",
|
|
54351
|
+
"number",
|
|
54352
|
+
"boolean"
|
|
54353
|
+
])).optional(),
|
|
54166
54354
|
enumValues: array(string()).optional(),
|
|
54167
54355
|
item: boolean().optional(),
|
|
54168
54356
|
quantity: ReadingQuantitySchema.optional()
|
|
@@ -56790,8 +56978,85 @@ method(_void(), array(FailureContributionSchema).readonly());
|
|
|
56790
56978
|
* - `FanPreset` — preset selector
|
|
56791
56979
|
* - `FanDirection` — direction toggle (ceiling fans)
|
|
56792
56980
|
* - `FanOscillating` — oscillation toggle
|
|
56981
|
+
*
|
|
56982
|
+
* Per-axis oscillation (`oscillationAxes`, `setOscillationAxis`, D1034): an air
|
|
56983
|
+
* circulator sweeps horizontally and vertically, each axis with its own
|
|
56984
|
+
* switch, fixed angle, sweep bounds and limits. A provider may report them
|
|
56985
|
+
* natively; otherwise the OPERATOR links sibling devices to each field in
|
|
56986
|
+
* Customize (a `replace` over the fields listed in `overridable` — nothing is
|
|
56987
|
+
* linked or inferred by itself), and a write to a linked field is forwarded to
|
|
56988
|
+
* its source. `oscillating` stays the single summary flag: when axes exist it
|
|
56989
|
+
* means "any axis oscillates" (`anyAxisOscillating`).
|
|
56793
56990
|
*/
|
|
56794
56991
|
var FanDirectionSchema = _enum(["forward", "reverse"]);
|
|
56992
|
+
var FAN_OSCILLATION_AXES = ["horizontal", "vertical"];
|
|
56993
|
+
var FanOscillationAxisNameSchema = _enum(FAN_OSCILLATION_AXES);
|
|
56994
|
+
var FanOscillationAxisFieldSchema = _enum([
|
|
56995
|
+
"oscillating",
|
|
56996
|
+
"angle",
|
|
56997
|
+
"sweepFrom",
|
|
56998
|
+
"sweepTo"
|
|
56999
|
+
]);
|
|
57000
|
+
/** The limits of one axis, read from the source that serves its angle. */
|
|
57001
|
+
var FAN_OSCILLATION_AXIS_LIMITS = [
|
|
57002
|
+
"min",
|
|
57003
|
+
"max",
|
|
57004
|
+
"step"
|
|
57005
|
+
];
|
|
57006
|
+
/**
|
|
57007
|
+
* One oscillation axis. Every reading the device has not reported is `null`,
|
|
57008
|
+
* never `0` (D393): `0°` is a real position. Each leaf defaults to `null`, so
|
|
57009
|
+
* a slice that names only the leaves it knows (a Customize link of one field)
|
|
57010
|
+
* is still a whole axis.
|
|
57011
|
+
*/
|
|
57012
|
+
var FanOscillationAxisSchema = object({
|
|
57013
|
+
/** Whether the axis sweeps. */
|
|
57014
|
+
oscillating: boolean().nullable().default(null),
|
|
57015
|
+
/** The fixed position (degrees) the axis holds when it does not sweep. */
|
|
57016
|
+
angle: number$1().nullable().default(null),
|
|
57017
|
+
/** The sweep bounds (degrees): left → right, bottom → top. */
|
|
57018
|
+
sweepFrom: number$1().nullable().default(null),
|
|
57019
|
+
sweepTo: number$1().nullable().default(null),
|
|
57020
|
+
/** The angles the axis accepts. Null when the device states none. */
|
|
57021
|
+
min: number$1().nullable().default(null),
|
|
57022
|
+
max: number$1().nullable().default(null),
|
|
57023
|
+
step: number$1().nullable().default(null)
|
|
57024
|
+
});
|
|
57025
|
+
/** Both axes; an axis the device does not have is `null`. */
|
|
57026
|
+
var FanOscillationAxesSchema = object({
|
|
57027
|
+
horizontal: FanOscillationAxisSchema.nullable().default(null),
|
|
57028
|
+
vertical: FanOscillationAxisSchema.nullable().default(null)
|
|
57029
|
+
});
|
|
57030
|
+
var FanOscillationAxisRefusalSchema = _enum([
|
|
57031
|
+
"nothing-to-set",
|
|
57032
|
+
"axis-not-linked",
|
|
57033
|
+
"out-of-range",
|
|
57034
|
+
"source-gone",
|
|
57035
|
+
"source-unknown",
|
|
57036
|
+
"source-call-failed"
|
|
57037
|
+
]);
|
|
57038
|
+
var FanOscillationAxisResultSchema = discriminatedUnion("status", [object({ status: literal("applied") }), object({
|
|
57039
|
+
status: literal("refused"),
|
|
57040
|
+
reason: FanOscillationAxisRefusalSchema,
|
|
57041
|
+
/** The field at fault, when one is. */
|
|
57042
|
+
field: FanOscillationAxisFieldSchema.optional(),
|
|
57043
|
+
/** One line for the operator, naming the axis, the field and the source. */
|
|
57044
|
+
detail: string(),
|
|
57045
|
+
/** Fields that DID land before the refusal (writes run in order, stop at the first failure). */
|
|
57046
|
+
applied: array(FanOscillationAxisFieldSchema)
|
|
57047
|
+
})]);
|
|
57048
|
+
var SetOscillationAxisInputSchema = object({
|
|
57049
|
+
deviceId: number$1().int().nonnegative(),
|
|
57050
|
+
axis: FanOscillationAxisNameSchema,
|
|
57051
|
+
oscillating: boolean().optional(),
|
|
57052
|
+
angle: number$1().optional(),
|
|
57053
|
+
sweepFrom: number$1().optional(),
|
|
57054
|
+
sweepTo: number$1().optional()
|
|
57055
|
+
});
|
|
57056
|
+
/** The state path of one axis field: `oscillationAxes.<axis>.<field>`. */
|
|
57057
|
+
function fanAxisPath(axis, field) {
|
|
57058
|
+
return `oscillationAxes.${axis}.${field}`;
|
|
57059
|
+
}
|
|
56795
57060
|
var FanControlStatusSchema = object({
|
|
56796
57061
|
/** Active speed as 0..100 inclusive. Null when the device has no
|
|
56797
57062
|
* speed surface (single-speed fan). */
|
|
@@ -56810,9 +57075,102 @@ var FanControlStatusSchema = object({
|
|
|
56810
57075
|
/** Oscillation toggle. Null when the device has no oscillation
|
|
56811
57076
|
* surface. */
|
|
56812
57077
|
oscillating: boolean().nullable(),
|
|
57078
|
+
/**
|
|
57079
|
+
* Per-axis oscillation (air circulators). Absent when the device has no
|
|
57080
|
+
* per-axis surface and nothing is linked in Customize.
|
|
57081
|
+
*/
|
|
57082
|
+
oscillationAxes: FanOscillationAxesSchema.optional(),
|
|
56813
57083
|
/** Ms epoch when the slice was last updated. */
|
|
56814
57084
|
lastChangedAt: number$1()
|
|
56815
57085
|
});
|
|
57086
|
+
var FAN_CUSTOMIZE_DEVICE_TYPES = [DeviceType.Fan];
|
|
57087
|
+
/** The Customize section the axis targets are listed under. */
|
|
57088
|
+
var AXES_SECTION = "oscillation-axes";
|
|
57089
|
+
function axisOscillatingTarget(axis) {
|
|
57090
|
+
return {
|
|
57091
|
+
id: `${axis}-oscillating`,
|
|
57092
|
+
cardinality: "scalar",
|
|
57093
|
+
vocabulary: {
|
|
57094
|
+
cap: "fan-control",
|
|
57095
|
+
stateField: "oscillating"
|
|
57096
|
+
},
|
|
57097
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
57098
|
+
apply: "replace",
|
|
57099
|
+
section: AXES_SECTION,
|
|
57100
|
+
path: fanAxisPath(axis, "oscillating"),
|
|
57101
|
+
sources: [{
|
|
57102
|
+
kind: "switch",
|
|
57103
|
+
transforms: [{ kind: "identity" }]
|
|
57104
|
+
}],
|
|
57105
|
+
sourceReport: { status: "assignment-status" }
|
|
57106
|
+
};
|
|
57107
|
+
}
|
|
57108
|
+
/**
|
|
57109
|
+
* A numeric axis field. The `angle` link also carries the axis limits, read
|
|
57110
|
+
* from the SAME linked control's own range (`min`/`max`/`step`), so the limits
|
|
57111
|
+
* are the source's, never guessed.
|
|
57112
|
+
*/
|
|
57113
|
+
function axisNumericTarget(axis, field) {
|
|
57114
|
+
const base = {
|
|
57115
|
+
id: `${axis}-${field}`,
|
|
57116
|
+
cardinality: "scalar",
|
|
57117
|
+
vocabulary: { cap: "fan-control" },
|
|
57118
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
57119
|
+
apply: "replace",
|
|
57120
|
+
section: AXES_SECTION,
|
|
57121
|
+
path: fanAxisPath(axis, field),
|
|
57122
|
+
sources: [{
|
|
57123
|
+
kind: "numeric",
|
|
57124
|
+
transforms: [{ kind: "identity" }]
|
|
57125
|
+
}],
|
|
57126
|
+
sourceReport: { status: "assignment-status" }
|
|
57127
|
+
};
|
|
57128
|
+
if (field !== "angle") return base;
|
|
57129
|
+
return {
|
|
57130
|
+
...base,
|
|
57131
|
+
companions: FAN_OSCILLATION_AXIS_LIMITS.map((limit) => ({
|
|
57132
|
+
kind: "source-field",
|
|
57133
|
+
path: fanAxisPath(axis, limit),
|
|
57134
|
+
field: limit
|
|
57135
|
+
}))
|
|
57136
|
+
};
|
|
57137
|
+
}
|
|
57138
|
+
var AXIS_TARGETS = FAN_OSCILLATION_AXES.flatMap((axis) => [
|
|
57139
|
+
axisOscillatingTarget(axis),
|
|
57140
|
+
axisNumericTarget(axis, "angle"),
|
|
57141
|
+
axisNumericTarget(axis, "sweepFrom"),
|
|
57142
|
+
axisNumericTarget(axis, "sweepTo")
|
|
57143
|
+
]);
|
|
57144
|
+
/** A select (an enum control) the operator links to the fan's `preset`. */
|
|
57145
|
+
var PRESET_TARGET = {
|
|
57146
|
+
id: "preset",
|
|
57147
|
+
cardinality: "scalar",
|
|
57148
|
+
vocabulary: { cap: "fan-control" },
|
|
57149
|
+
deviceTypes: FAN_CUSTOMIZE_DEVICE_TYPES,
|
|
57150
|
+
apply: "replace",
|
|
57151
|
+
path: "preset",
|
|
57152
|
+
sources: [{
|
|
57153
|
+
kind: "field",
|
|
57154
|
+
valueKinds: ["string"],
|
|
57155
|
+
transforms: [{ kind: "identity" }]
|
|
57156
|
+
}],
|
|
57157
|
+
sourceReport: { status: "assignment-status" }
|
|
57158
|
+
};
|
|
57159
|
+
var FAN_CONTROL_TARGETS = [...AXIS_TARGETS, PRESET_TARGET];
|
|
57160
|
+
/**
|
|
57161
|
+
* Customize (D1034): the fan already serves `fan-control` natively, so every
|
|
57162
|
+
* target is a `replace` over a field listed in `overridable` — the axis leaves
|
|
57163
|
+
* and `preset`, nothing else. Nothing is pre-linked: the operator picks each
|
|
57164
|
+
* source (D356).
|
|
57165
|
+
*/
|
|
57166
|
+
var fanControlCustomize = {
|
|
57167
|
+
version: 1,
|
|
57168
|
+
overridable: FAN_CONTROL_TARGETS.map((target) => ({
|
|
57169
|
+
path: target.path,
|
|
57170
|
+
by: target.id
|
|
57171
|
+
})),
|
|
57172
|
+
targets: FAN_CONTROL_TARGETS
|
|
57173
|
+
};
|
|
56816
57174
|
var fanControlCapability = {
|
|
56817
57175
|
name: "fan-control",
|
|
56818
57176
|
scope: "device",
|
|
@@ -56847,6 +57205,18 @@ var fanControlCapability = {
|
|
|
56847
57205
|
}), _void(), {
|
|
56848
57206
|
kind: "mutation",
|
|
56849
57207
|
auth: "protected"
|
|
57208
|
+
}),
|
|
57209
|
+
/**
|
|
57210
|
+
* Sets one oscillation axis: its switch, fixed angle and/or sweep bounds.
|
|
57211
|
+
* Fields left out are untouched. A field linked in Customize is forwarded
|
|
57212
|
+
* to its linked source (D1034); otherwise the native provider serves it;
|
|
57213
|
+
* neither → `axis-not-linked`. Ranges are checked against the axis limits
|
|
57214
|
+
* before anything is written; writes run in order and stop at the first
|
|
57215
|
+
* failure, which the result names.
|
|
57216
|
+
*/
|
|
57217
|
+
setOscillationAxis: optionalMethod(SetOscillationAxisInputSchema, FanOscillationAxisResultSchema, {
|
|
57218
|
+
kind: "mutation",
|
|
57219
|
+
auth: "protected"
|
|
56850
57220
|
})
|
|
56851
57221
|
},
|
|
56852
57222
|
status: {
|
|
@@ -56858,6 +57228,7 @@ var fanControlCapability = {
|
|
|
56858
57228
|
* sliders read `speed` for live updates.
|
|
56859
57229
|
*/
|
|
56860
57230
|
runtimeState: FanControlStatusSchema,
|
|
57231
|
+
customize: fanControlCustomize,
|
|
56861
57232
|
/**
|
|
56862
57233
|
* Runtime-state durability: **session** — as `brightness`.
|
|
56863
57234
|
*
|
|
@@ -56877,16 +57248,33 @@ var fanControlCapability = {
|
|
|
56877
57248
|
oscillating: { kind: "boolean" }
|
|
56878
57249
|
} }
|
|
56879
57250
|
};
|
|
57251
|
+
/** One axis as a preset wants it; an absent field is left as it is. */
|
|
57252
|
+
var FanPresetAxisSchema = object({
|
|
57253
|
+
oscillating: boolean().optional(),
|
|
57254
|
+
angle: number$1().optional(),
|
|
57255
|
+
sweepFrom: number$1().optional(),
|
|
57256
|
+
sweepTo: number$1().optional()
|
|
57257
|
+
});
|
|
57258
|
+
/** The fan-control state a preset sets; an absent field is left as it is. */
|
|
57259
|
+
var FanPresetStateSchema = object({
|
|
57260
|
+
speed: number$1().min(0).max(100).optional(),
|
|
57261
|
+
/** The fan's own preset mode (or the linked select's option). */
|
|
57262
|
+
preset: string().min(1).optional(),
|
|
57263
|
+
direction: FanDirectionSchema.optional(),
|
|
57264
|
+
oscillationAxes: object({
|
|
57265
|
+
horizontal: FanPresetAxisSchema.optional(),
|
|
57266
|
+
vertical: FanPresetAxisSchema.optional()
|
|
57267
|
+
}).optional()
|
|
57268
|
+
});
|
|
56880
57269
|
var FanPresetSchema = object({
|
|
56881
57270
|
/** Stable key; never reused after a delete within one device's list. */
|
|
56882
57271
|
id: string().min(1).max(64),
|
|
56883
57272
|
/** What the operator and a voice assistant call it. */
|
|
56884
57273
|
name: string().trim().min(1).max(40),
|
|
56885
|
-
|
|
57274
|
+
state: FanPresetStateSchema
|
|
56886
57275
|
});
|
|
56887
57276
|
var FanPresetsRefusalSchema = _enum([
|
|
56888
|
-
"
|
|
56889
|
-
"bad-target",
|
|
57277
|
+
"empty-state",
|
|
56890
57278
|
"duplicate-name",
|
|
56891
57279
|
"duplicate-id",
|
|
56892
57280
|
"too-many",
|
|
@@ -56898,72 +57286,55 @@ var FanPresetsSetResultSchema = discriminatedUnion("status", [object({
|
|
|
56898
57286
|
}), object({
|
|
56899
57287
|
status: literal("refused"),
|
|
56900
57288
|
reason: FanPresetsRefusalSchema,
|
|
56901
|
-
/** Names the preset
|
|
57289
|
+
/** Names the preset at fault. */
|
|
56902
57290
|
detail: string()
|
|
56903
57291
|
})]);
|
|
56904
|
-
var
|
|
56905
|
-
|
|
57292
|
+
var FanPresetFieldResultSchema = object({
|
|
57293
|
+
/** The state path: `speed`, `preset`, `direction`, `oscillationAxes.horizontal.angle`. */
|
|
57294
|
+
field: string(),
|
|
56906
57295
|
outcome: _enum([
|
|
56907
57296
|
"applied",
|
|
56908
57297
|
"failed",
|
|
56909
57298
|
"not-run",
|
|
56910
57299
|
"refused"
|
|
56911
57300
|
]),
|
|
56912
|
-
deviceId: number$1().int().nonnegative().optional(),
|
|
56913
|
-
cap: string().optional(),
|
|
56914
|
-
method: string().optional(),
|
|
56915
57301
|
/** The cause, for every outcome but `applied`. */
|
|
56916
57302
|
message: string().optional()
|
|
56917
57303
|
});
|
|
56918
57304
|
var FanPresetApplyResultSchema = object({
|
|
56919
|
-
/** `applied`: every
|
|
57305
|
+
/** `applied`: every field landed. `partial`: some did, one did not. `refused`: nothing ran. */
|
|
56920
57306
|
status: _enum([
|
|
56921
57307
|
"applied",
|
|
56922
57308
|
"partial",
|
|
56923
57309
|
"refused"
|
|
56924
57310
|
]),
|
|
56925
|
-
|
|
57311
|
+
fields: array(FanPresetFieldResultSchema)
|
|
56926
57312
|
});
|
|
56927
57313
|
var FanCaptureFieldSchema = _enum([
|
|
56928
57314
|
"speed",
|
|
56929
|
-
"oscillating",
|
|
56930
57315
|
"direction",
|
|
56931
|
-
"preset"
|
|
57316
|
+
"preset",
|
|
57317
|
+
"oscillationAxes"
|
|
56932
57318
|
]);
|
|
56933
|
-
var FanCaptureOmissionSchema = object({
|
|
56934
|
-
/** A fan field (`speed`) or `step <n>` for a sibling step. */
|
|
56935
|
-
what: string(),
|
|
56936
|
-
/** Why no value was taken: unknown reading (never stored as 0, D393), or a step that cannot be read. */
|
|
56937
|
-
reason: string()
|
|
56938
|
-
});
|
|
56939
|
-
var FanCaptureItemSchema = object({
|
|
56940
|
-
group: _enum([
|
|
56941
|
-
"fan",
|
|
56942
|
-
"oscillation",
|
|
56943
|
-
"angles"
|
|
56944
|
-
]),
|
|
56945
|
-
/** What the step sets, in the operator's words (a device name, a fan field). */
|
|
56946
|
-
label: string()
|
|
56947
|
-
});
|
|
56948
57319
|
var FanPresetCaptureResultSchema = object({
|
|
56949
|
-
/** The
|
|
56950
|
-
|
|
56951
|
-
|
|
56952
|
-
|
|
56953
|
-
|
|
57320
|
+
/** The fan's CURRENT fan-control state, as a preset; NOT saved. */
|
|
57321
|
+
state: FanPresetStateSchema,
|
|
57322
|
+
omitted: array(object({
|
|
57323
|
+
/** A state path (`speed`, `oscillationAxes.vertical.angle`). */
|
|
57324
|
+
what: string(),
|
|
57325
|
+
/** Why no value was taken: an unknown reading is never stored as 0 (D393). */
|
|
57326
|
+
reason: string()
|
|
57327
|
+
}))
|
|
56954
57328
|
});
|
|
56955
|
-
var deviceInput$
|
|
57329
|
+
var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
|
|
56956
57330
|
DeviceType.Fan;
|
|
56957
|
-
method(deviceInput$
|
|
57331
|
+
method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
|
|
56958
57332
|
kind: "mutation",
|
|
56959
57333
|
auth: "admin"
|
|
56960
|
-
}), method(deviceInput$
|
|
57334
|
+
}), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
|
|
56961
57335
|
kind: "mutation",
|
|
56962
57336
|
auth: "protected"
|
|
56963
|
-
}), method(deviceInput$
|
|
56964
|
-
fields: array(FanCaptureFieldSchema).optional(),
|
|
56965
|
-
steps: array(ActionStepSchema).max(20).default([])
|
|
56966
|
-
}), FanPresetCaptureResultSchema, { auth: "protected" });
|
|
57337
|
+
}), method(deviceInput$1.extend({ fields: array(FanCaptureFieldSchema).optional() }), FanPresetCaptureResultSchema, { auth: "protected" });
|
|
56967
57338
|
/**
|
|
56968
57339
|
* Per-device feature/identity probe slice. Holds the runtime-resolved
|
|
56969
57340
|
* truth about what a device CAN do — which the kernel uses to:
|
|
@@ -57175,8 +57546,7 @@ var groupActiveCapability = {
|
|
|
57175
57546
|
DeviceType.Valve,
|
|
57176
57547
|
DeviceType.Lock,
|
|
57177
57548
|
DeviceType.MediaPlayer,
|
|
57178
|
-
DeviceType.Climate
|
|
57179
|
-
DeviceType.Thermostat
|
|
57549
|
+
DeviceType.Climate
|
|
57180
57550
|
],
|
|
57181
57551
|
methods: {},
|
|
57182
57552
|
status: {
|
|
@@ -57218,7 +57588,6 @@ var groupCommandsCapability = {
|
|
|
57218
57588
|
DeviceType.Valve,
|
|
57219
57589
|
DeviceType.Lock,
|
|
57220
57590
|
DeviceType.MediaPlayer,
|
|
57221
|
-
DeviceType.Thermostat,
|
|
57222
57591
|
DeviceType.Climate
|
|
57223
57592
|
],
|
|
57224
57593
|
methods: {},
|
|
@@ -57274,7 +57643,6 @@ var groupStatusCapability = {
|
|
|
57274
57643
|
DeviceType.Valve,
|
|
57275
57644
|
DeviceType.Lock,
|
|
57276
57645
|
DeviceType.MediaPlayer,
|
|
57277
|
-
DeviceType.Thermostat,
|
|
57278
57646
|
DeviceType.Climate
|
|
57279
57647
|
],
|
|
57280
57648
|
methods: {},
|
|
@@ -57603,7 +57971,7 @@ var heatingValveCapability = {
|
|
|
57603
57971
|
scope: "device",
|
|
57604
57972
|
deviceNative: true,
|
|
57605
57973
|
mode: "singleton",
|
|
57606
|
-
deviceTypes: [DeviceType.
|
|
57974
|
+
deviceTypes: [DeviceType.Climate],
|
|
57607
57975
|
methods: {},
|
|
57608
57976
|
status: {
|
|
57609
57977
|
schema: HeatingValveStatusSchema,
|
|
@@ -57633,13 +58001,18 @@ var heatingValveCapability = {
|
|
|
57633
58001
|
* retried in a loop - D49); a future one is re-armed.
|
|
57634
58002
|
*
|
|
57635
58003
|
* What a device may be run for, and for how long at most, is per device type
|
|
57636
|
-
* ({@link
|
|
58004
|
+
* and role ({@link timedRunLimitOf}): the maximum is a safety bound, not a preference,
|
|
57637
58005
|
* so a request above it is REFUSED with a typed reason, never clamped.
|
|
57638
58006
|
*/
|
|
57639
58007
|
var TimedRunUnitSchema = _enum(["s", "min"]);
|
|
57640
58008
|
_enum(["switch", "pet-fountain"]);
|
|
57641
|
-
|
|
57642
|
-
|
|
58009
|
+
/**
|
|
58010
|
+
* The device types `timed-run` may be offered on. A `switch` is narrowed by
|
|
58011
|
+
* role ({@link TIMED_RUN_DEVICE_ROLES}): only a plug-in heater runs on a timer.
|
|
58012
|
+
*/
|
|
58013
|
+
var TIMED_RUN_DEVICE_TYPES = [DeviceType.Switch, DeviceType.PetFountain];
|
|
58014
|
+
/** The roles that make a device of these types timed-run-able (D1033). */
|
|
58015
|
+
var TIMED_RUN_DEVICE_ROLES = { [DeviceType.Switch]: [DeviceRole.SwitchHeater] };
|
|
57643
58016
|
/** One duration, as the one-tap run asks for it. */
|
|
57644
58017
|
var TimedRunQuickRunSchema = object({
|
|
57645
58018
|
duration: number$1().positive().finite(),
|
|
@@ -57689,6 +58062,7 @@ var timedRunCapability = {
|
|
|
57689
58062
|
kind: "wrapper",
|
|
57690
58063
|
defaultActive: true,
|
|
57691
58064
|
deviceTypes: TIMED_RUN_DEVICE_TYPES,
|
|
58065
|
+
deviceRoles: TIMED_RUN_DEVICE_ROLES,
|
|
57692
58066
|
deviceConfig: { ui: {
|
|
57693
58067
|
kind: "derived-form",
|
|
57694
58068
|
builderId: "timed-run",
|
|
@@ -57849,8 +58223,8 @@ var HeroSceneSchema = object({
|
|
|
57849
58223
|
/** 0..1: volume, cover position, cycle progress. */
|
|
57850
58224
|
level: number$1().min(0).max(1).nullable()
|
|
57851
58225
|
});
|
|
57852
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.
|
|
57853
|
-
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
58226
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
58227
|
+
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
57854
58228
|
/** A string in both languages, as the cap vocabulary writes it (D920): no `t()` in the model. */
|
|
57855
58229
|
var HeroTextSchema = object({
|
|
57856
58230
|
en: string(),
|
|
@@ -58235,8 +58609,8 @@ var HeroRowModelSchema = object({
|
|
|
58235
58609
|
extras: array(HeroControlSchema).max(2).optional(),
|
|
58236
58610
|
trailing: HeroFactSchema.nullable()
|
|
58237
58611
|
});
|
|
58238
|
-
DeviceType.Climate
|
|
58239
|
-
DeviceType.Climate, DeviceType.
|
|
58612
|
+
DeviceType.Climate;
|
|
58613
|
+
DeviceType.Climate, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer;
|
|
58240
58614
|
/**
|
|
58241
58615
|
* hero-layout — what a device's hero says (D1023). Read-only: the FIXED
|
|
58242
58616
|
* layouts live in `@camstack/types` and nothing here stores or edits one.
|
|
@@ -58268,7 +58642,10 @@ method(heroInput, HeroModelSchema.nullable(), {
|
|
|
58268
58642
|
}), method(rowModelsInput, array(HeroRowModelSchema.nullable()), {
|
|
58269
58643
|
auth: "protected",
|
|
58270
58644
|
role: "viewer"
|
|
58271
|
-
}), method(object({
|
|
58645
|
+
}), method(object({
|
|
58646
|
+
deviceType: string(),
|
|
58647
|
+
role: string().nullable().optional()
|
|
58648
|
+
}), HeroLayoutRowsSchema, {
|
|
58272
58649
|
auth: "protected",
|
|
58273
58650
|
role: "viewer"
|
|
58274
58651
|
});
|
|
@@ -58315,6 +58692,11 @@ var humidifierCapability = {
|
|
|
58315
58692
|
deviceNative: true,
|
|
58316
58693
|
mode: "singleton",
|
|
58317
58694
|
deviceTypes: [DeviceType.Humidifier],
|
|
58695
|
+
power: {
|
|
58696
|
+
kind: "field",
|
|
58697
|
+
field: "on",
|
|
58698
|
+
set: "setOn"
|
|
58699
|
+
},
|
|
58318
58700
|
methods: {
|
|
58319
58701
|
setOn: method(object({
|
|
58320
58702
|
deviceId: number$1().int().nonnegative(),
|
|
@@ -58388,7 +58770,7 @@ var humiditySensorCapability = {
|
|
|
58388
58770
|
scope: "device",
|
|
58389
58771
|
deviceNative: true,
|
|
58390
58772
|
mode: "singleton",
|
|
58391
|
-
deviceTypes: [DeviceType.Sensor, DeviceType.
|
|
58773
|
+
deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
|
|
58392
58774
|
methods: {},
|
|
58393
58775
|
status: {
|
|
58394
58776
|
schema: HumiditySensorStatusSchema,
|
|
@@ -71993,9 +72375,13 @@ var petFeederCapability = {
|
|
|
71993
72375
|
*/
|
|
71994
72376
|
durability: "session",
|
|
71995
72377
|
/**
|
|
71996
|
-
* History (D850): recorded series.
|
|
72378
|
+
* History (D850): recorded series. `feeding` / `eating` are the meals the
|
|
72379
|
+
* device hero's "Meals" button names — change-only booleans, so a dispense
|
|
72380
|
+
* or a pet at the bowl is one span on the history.
|
|
71997
72381
|
*/
|
|
71998
72382
|
history: { fields: {
|
|
72383
|
+
feeding: { kind: "boolean" },
|
|
72384
|
+
eating: { kind: "boolean" },
|
|
71999
72385
|
foodLevel: { kind: "gauge" },
|
|
72000
72386
|
bowlFood: { kind: "gauge" },
|
|
72001
72387
|
food1: { kind: "gauge" },
|
|
@@ -72056,6 +72442,11 @@ var petFountainCapability = {
|
|
|
72056
72442
|
deviceNative: true,
|
|
72057
72443
|
mode: "singleton",
|
|
72058
72444
|
deviceTypes: [DeviceType.PetFountain],
|
|
72445
|
+
power: {
|
|
72446
|
+
kind: "field",
|
|
72447
|
+
field: "pumpRunning",
|
|
72448
|
+
set: "setPump"
|
|
72449
|
+
},
|
|
72059
72450
|
methods: {
|
|
72060
72451
|
/** Start or stop the pump. */
|
|
72061
72452
|
setPump: method(object({
|
|
@@ -73631,7 +74022,6 @@ var POWER_METER_DEVICE_TYPES = [
|
|
|
73631
74022
|
DeviceType.Light,
|
|
73632
74023
|
DeviceType.Fan,
|
|
73633
74024
|
DeviceType.Climate,
|
|
73634
|
-
DeviceType.Thermostat,
|
|
73635
74025
|
DeviceType.Humidifier,
|
|
73636
74026
|
DeviceType.WaterHeater,
|
|
73637
74027
|
DeviceType.MediaPlayer,
|
|
@@ -73640,8 +74030,7 @@ var POWER_METER_DEVICE_TYPES = [
|
|
|
73640
74030
|
DeviceType.Dishwasher,
|
|
73641
74031
|
DeviceType.Vacuum,
|
|
73642
74032
|
DeviceType.LawnMower,
|
|
73643
|
-
DeviceType.PetFeeder
|
|
73644
|
-
DeviceType.Heater
|
|
74033
|
+
DeviceType.PetFeeder
|
|
73645
74034
|
];
|
|
73646
74035
|
/** Everything but a bare `Sensor`: a sensor that takes its reading from another sensor adds nothing. */
|
|
73647
74036
|
var POWER_METER_CUSTOMIZE_DEVICE_TYPES = POWER_METER_DEVICE_TYPES.filter((type) => type !== DeviceType.Sensor);
|
|
@@ -73754,118 +74143,6 @@ var powerMeterCapability = {
|
|
|
73754
74143
|
volatileStateFields: ["lastFetchedAt"],
|
|
73755
74144
|
customize: powerMeterCustomize
|
|
73756
74145
|
};
|
|
73757
|
-
var PowerSourceRefusalReasonSchema = _enum([
|
|
73758
|
-
"no-power-source",
|
|
73759
|
-
"switch-missing",
|
|
73760
|
-
"switch-offline",
|
|
73761
|
-
"switch-unknown",
|
|
73762
|
-
"restart-in-progress",
|
|
73763
|
-
"switch-call-failed"
|
|
73764
|
-
]);
|
|
73765
|
-
var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
|
|
73766
|
-
accepted: literal(false),
|
|
73767
|
-
reason: PowerSourceRefusalReasonSchema,
|
|
73768
|
-
/** One line for the operator, naming the switch. */
|
|
73769
|
-
message: string()
|
|
73770
|
-
})]);
|
|
73771
|
-
var PowerSourceInfoSchema = object({
|
|
73772
|
-
/** False when the device has no power source linked; the rest is then empty. */
|
|
73773
|
-
linked: boolean(),
|
|
73774
|
-
switchDeviceId: number$1().nullable(),
|
|
73775
|
-
switchName: string().nullable(),
|
|
73776
|
-
/** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
|
|
73777
|
-
switchOn: boolean().nullable(),
|
|
73778
|
-
switchOnline: boolean().nullable(),
|
|
73779
|
-
restartInProgress: boolean(),
|
|
73780
|
-
offSeconds: number$1().int()
|
|
73781
|
-
});
|
|
73782
|
-
/** The composed slice: the switch state the link mirrors, plus the stored off time. */
|
|
73783
|
-
var PowerSourceStateSchema = object({
|
|
73784
|
-
/** Null while the switch has not reported: unknown is never `false` (D393). */
|
|
73785
|
-
switchOn: boolean().nullable(),
|
|
73786
|
-
offSeconds: number$1().int(),
|
|
73787
|
-
lastFetchedAt: number$1()
|
|
73788
|
-
});
|
|
73789
|
-
var POWER_SOURCE_DEVICE_TYPES = [
|
|
73790
|
-
DeviceType.Gateway,
|
|
73791
|
-
DeviceType.Hub,
|
|
73792
|
-
DeviceType.Camera,
|
|
73793
|
-
DeviceType.Sensor,
|
|
73794
|
-
DeviceType.MediaPlayer,
|
|
73795
|
-
DeviceType.Vacuum,
|
|
73796
|
-
DeviceType.Generic,
|
|
73797
|
-
DeviceType.Washer,
|
|
73798
|
-
DeviceType.Dryer,
|
|
73799
|
-
DeviceType.Dishwasher,
|
|
73800
|
-
DeviceType.PetFountain,
|
|
73801
|
-
DeviceType.Fan,
|
|
73802
|
-
DeviceType.Humidifier,
|
|
73803
|
-
DeviceType.Climate,
|
|
73804
|
-
DeviceType.WaterHeater
|
|
73805
|
-
];
|
|
73806
|
-
var powerSourceCustomize = {
|
|
73807
|
-
version: 1,
|
|
73808
|
-
targets: [{
|
|
73809
|
-
id: "switch",
|
|
73810
|
-
cardinality: "scalar",
|
|
73811
|
-
vocabulary: {
|
|
73812
|
-
cap: "power-source",
|
|
73813
|
-
stateField: "switchOn"
|
|
73814
|
-
},
|
|
73815
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
73816
|
-
apply: "add",
|
|
73817
|
-
path: "switchOn",
|
|
73818
|
-
sources: [{
|
|
73819
|
-
kind: "switch",
|
|
73820
|
-
transforms: [{ kind: "identity" }]
|
|
73821
|
-
}],
|
|
73822
|
-
companions: [{
|
|
73823
|
-
kind: "constant",
|
|
73824
|
-
path: "offSeconds",
|
|
73825
|
-
value: 10,
|
|
73826
|
-
when: "add",
|
|
73827
|
-
formerValues: [0]
|
|
73828
|
-
}, {
|
|
73829
|
-
kind: "clock",
|
|
73830
|
-
path: "lastFetchedAt",
|
|
73831
|
-
when: "always"
|
|
73832
|
-
}],
|
|
73833
|
-
sourceReport: { status: "assignment-status" }
|
|
73834
|
-
}]
|
|
73835
|
-
};
|
|
73836
|
-
var deviceInput$1 = object({ deviceId: number$1().int().nonnegative() });
|
|
73837
|
-
var powerSourceCapability = {
|
|
73838
|
-
name: "power-source",
|
|
73839
|
-
scope: "device",
|
|
73840
|
-
mode: "singleton",
|
|
73841
|
-
deviceTypes: POWER_SOURCE_DEVICE_TYPES,
|
|
73842
|
-
methods: {
|
|
73843
|
-
getStatus: systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "protected" }),
|
|
73844
|
-
powerOn: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
73845
|
-
kind: "mutation",
|
|
73846
|
-
auth: "protected"
|
|
73847
|
-
}),
|
|
73848
|
-
powerOff: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
73849
|
-
kind: "mutation",
|
|
73850
|
-
auth: "protected"
|
|
73851
|
-
}),
|
|
73852
|
-
forceRestart: systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
|
|
73853
|
-
kind: "mutation",
|
|
73854
|
-
auth: "protected"
|
|
73855
|
-
})
|
|
73856
|
-
},
|
|
73857
|
-
runtimeState: PowerSourceStateSchema,
|
|
73858
|
-
customize: powerSourceCustomize,
|
|
73859
|
-
/**
|
|
73860
|
-
* Runtime-state durability: **session** — mirrored from the linked switch on
|
|
73861
|
-
* its next report; a restored value would outlive the reading it names.
|
|
73862
|
-
*
|
|
73863
|
-
* See `RuntimeStateDurability`. Enforced by
|
|
73864
|
-
* `scripts/check-runtime-state-durability.ts`.
|
|
73865
|
-
*/
|
|
73866
|
-
durability: "session",
|
|
73867
|
-
history: "none"
|
|
73868
|
-
};
|
|
73869
74146
|
/**
|
|
73870
74147
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
73871
74148
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -77332,9 +77609,7 @@ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
|
|
|
77332
77609
|
DeviceType.Humidifier,
|
|
77333
77610
|
DeviceType.Fan,
|
|
77334
77611
|
DeviceType.Climate,
|
|
77335
|
-
DeviceType.
|
|
77336
|
-
DeviceType.PetFeeder,
|
|
77337
|
-
DeviceType.Heater
|
|
77612
|
+
DeviceType.PetFeeder
|
|
77338
77613
|
];
|
|
77339
77614
|
var runningStateCapability = {
|
|
77340
77615
|
name: "running-state",
|
|
@@ -79422,8 +79697,7 @@ var switchCapability = {
|
|
|
79422
79697
|
DeviceType.Switch,
|
|
79423
79698
|
DeviceType.Siren,
|
|
79424
79699
|
DeviceType.Light,
|
|
79425
|
-
DeviceType.Fan
|
|
79426
|
-
DeviceType.Heater
|
|
79700
|
+
DeviceType.Fan
|
|
79427
79701
|
],
|
|
79428
79702
|
methods: { setState: method(object({
|
|
79429
79703
|
deviceId: number$1(),
|
|
@@ -80117,7 +80391,7 @@ var temperatureSensorCapability = {
|
|
|
80117
80391
|
scope: "device",
|
|
80118
80392
|
deviceNative: true,
|
|
80119
80393
|
mode: "singleton",
|
|
80120
|
-
deviceTypes: [DeviceType.Sensor, DeviceType.
|
|
80394
|
+
deviceTypes: [DeviceType.Sensor, DeviceType.Climate],
|
|
80121
80395
|
methods: {},
|
|
80122
80396
|
status: {
|
|
80123
80397
|
schema: TemperatureSensorStatusSchema,
|
|
@@ -81764,6 +82038,13 @@ var waterHeaterCapability = {
|
|
|
81764
82038
|
deviceNative: true,
|
|
81765
82039
|
mode: "singleton",
|
|
81766
82040
|
deviceTypes: [DeviceType.WaterHeater],
|
|
82041
|
+
power: {
|
|
82042
|
+
kind: "mode",
|
|
82043
|
+
field: "operationMode",
|
|
82044
|
+
offValue: "off",
|
|
82045
|
+
set: "setOperationMode",
|
|
82046
|
+
lastField: "lastActiveMode"
|
|
82047
|
+
},
|
|
81767
82048
|
methods: {
|
|
81768
82049
|
setTargetTemp: method(object({
|
|
81769
82050
|
deviceId: number$1().int().nonnegative(),
|
|
@@ -83422,7 +83703,6 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
83422
83703
|
control: controlCapability,
|
|
83423
83704
|
cover: coverCapability,
|
|
83424
83705
|
dayNight: dayNightCapability,
|
|
83425
|
-
deviceDiscovery: deviceDiscoveryCapability,
|
|
83426
83706
|
deviceStatus: deviceStatusCapability,
|
|
83427
83707
|
dishwasher: dishwasherCapability,
|
|
83428
83708
|
doNotDisturb: doNotDisturbCapability,
|
|
@@ -84517,15 +84797,16 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84517
84797
|
});
|
|
84518
84798
|
const meta = await this.ctx.api.deviceManager.loadMeta.query({ deviceId: id });
|
|
84519
84799
|
if (meta === null) throw new Error(`${this.providerName}: no persisted meta for "${stableId}" (id ${id}) — cannot reload`);
|
|
84520
|
-
const
|
|
84521
|
-
|
|
84800
|
+
const Class = this.deviceClassForRow({
|
|
84801
|
+
type: meta.type,
|
|
84802
|
+
stableId
|
|
84803
|
+
});
|
|
84522
84804
|
if (!Class) throw new Error(`${this.providerName}: no device class for type "${meta.type}" — "${stableId}" is an accessory child; reload its parent instead`);
|
|
84523
84805
|
await devices.create(stableId, Class, {}, meta.parentDeviceId ?? null);
|
|
84524
84806
|
const rows = await this.ctx.api.deviceManager.listPersistedByAddon.query({ addonId: this.addonId });
|
|
84525
84807
|
for (const row of rows) {
|
|
84526
84808
|
if (row.parentDeviceId !== id) continue;
|
|
84527
|
-
const
|
|
84528
|
-
const ChildClass = childType !== void 0 ? this.deviceClasses[childType] : void 0;
|
|
84809
|
+
const ChildClass = this.deviceClassForRow(row);
|
|
84529
84810
|
if (!ChildClass) continue;
|
|
84530
84811
|
try {
|
|
84531
84812
|
await devices.create(row.stableId, ChildClass, {}, id);
|
|
@@ -84552,6 +84833,16 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84552
84833
|
return { deviceId: id };
|
|
84553
84834
|
}
|
|
84554
84835
|
/**
|
|
84836
|
+
* The class a PERSISTED row is rebuilt with. Default: by type, from
|
|
84837
|
+
* `deviceClasses`. A provider whose distinct devices share one type (D1033:
|
|
84838
|
+
* a radiator valve and a room climate are both `climate`) overrides this
|
|
84839
|
+
* and tells them apart by the row's stable id or config.
|
|
84840
|
+
*/
|
|
84841
|
+
deviceClassForRow(row) {
|
|
84842
|
+
const type = Object.values(DeviceType).find((t) => t === row.type);
|
|
84843
|
+
return type !== void 0 ? this.deviceClasses[type] : void 0;
|
|
84844
|
+
}
|
|
84845
|
+
/**
|
|
84555
84846
|
* Restore devices from persisted state. Two-pass:
|
|
84556
84847
|
*
|
|
84557
84848
|
* 1. **Top-level pass** — invokes `kernel.devices.create()` for every
|
|
@@ -84612,7 +84903,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84612
84903
|
restored.add(saved.id);
|
|
84613
84904
|
return;
|
|
84614
84905
|
}
|
|
84615
|
-
const Class = this.
|
|
84906
|
+
const Class = this.deviceClassForRow(saved);
|
|
84616
84907
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
84617
84908
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
84618
84909
|
await this.healSavedConfig(saved, savedDevices);
|
|
@@ -84629,7 +84920,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84629
84920
|
};
|
|
84630
84921
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
|
84631
84922
|
const restoreOne = async (saved) => {
|
|
84632
|
-
if (!this.
|
|
84923
|
+
if (!this.deviceClassForRow(saved)) {
|
|
84633
84924
|
this.ctx.logger.warn("No device class registered for restored type — skipping", {
|
|
84634
84925
|
tags: {
|
|
84635
84926
|
deviceId: saved.id,
|
|
@@ -84668,7 +84959,7 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84668
84959
|
const failedTopLevelIds = new Set(failures.map((failure) => failure.saved.id));
|
|
84669
84960
|
const childRows = savedDevices.filter((s) => s.parentDeviceId !== null);
|
|
84670
84961
|
for (const saved of childRows) {
|
|
84671
|
-
if (!this.
|
|
84962
|
+
if (!this.deviceClassForRow(saved)) continue;
|
|
84672
84963
|
if (saved.parentDeviceId === null) continue;
|
|
84673
84964
|
if (restored.has(saved.parentDeviceId)) {
|
|
84674
84965
|
try {
|
|
@@ -84722,7 +85013,9 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
84722
85013
|
}
|
|
84723
85014
|
};
|
|
84724
85015
|
DeviceType.HeatPump;
|
|
84725
|
-
DeviceType.
|
|
85016
|
+
DeviceType.Climate;
|
|
85017
|
+
DeviceRole.ClimateThermostat, DeviceRole.ClimateAc, DeviceRole.ClimateRadiator, DeviceRole.ClimateFloor, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit;
|
|
85018
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
84726
85019
|
new Set(Object.values(DeviceType));
|
|
84727
85020
|
/** Parses the raw slice with the cap's own schema; `undefined` when it does not parse. */
|
|
84728
85021
|
function contribution(cap, schema, build) {
|
|
@@ -86728,7 +87021,7 @@ var HEAT_PUMP_FAMILY_CONTRIBUTIONS = { "heat-pump-status": contribution("heat-pu
|
|
|
86728
87021
|
...Object.values(CLIMATE_FAMILY_CONTRIBUTIONS),
|
|
86729
87022
|
...Object.values(HEAT_PUMP_FAMILY_CONTRIBUTIONS)
|
|
86730
87023
|
];
|
|
86731
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.
|
|
87024
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
86732
87025
|
/**
|
|
86733
87026
|
* Who looks like what (D1023). One look per {@link DeviceType}, refined by a
|
|
86734
87027
|
* {@link DeviceRole} where the role changes how the device reads (a leak
|
|
@@ -87372,9 +87665,9 @@ lookOf({
|
|
|
87372
87665
|
idle: INFO,
|
|
87373
87666
|
standby: MUTED
|
|
87374
87667
|
});
|
|
87375
|
-
DeviceType.Climate
|
|
87376
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.
|
|
87377
|
-
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
87668
|
+
DeviceType.Climate;
|
|
87669
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
87670
|
+
DeviceRole.Siren, DeviceRole.Floodlight, DeviceRole.Spotlight, DeviceRole.PirSensor, DeviceRole.Chime, DeviceRole.Autotrack, DeviceRole.Nightvision, DeviceRole.PrivacyMask, DeviceRole.Doorbell, DeviceRole.CoverBlind, DeviceRole.CoverShutter, DeviceRole.CoverAwning, DeviceRole.CoverCurtain, DeviceRole.CoverGarage, DeviceRole.CoverGate, DeviceRole.CoverDoor, DeviceRole.CoverWindow, DeviceRole.BinaryHelper, DeviceRole.Outlet, DeviceRole.SwitchHeater, DeviceRole.SwitchFan, DeviceRole.ClimateAc, DeviceRole.ClimateThermostat, DeviceRole.ClimateFloor, DeviceRole.ClimateRadiator, DeviceRole.ClimateHeater, DeviceRole.ClimateHeatPumpCircuit, DeviceRole.MotionSensor, DeviceRole.ContactSensor, DeviceRole.LeakSensor, DeviceRole.SmokeSensor, DeviceRole.COSensor, DeviceRole.GasSensor, DeviceRole.TamperSensor, DeviceRole.VibrationSensor, DeviceRole.ConnectivitySensor, DeviceRole.SoundSensor, DeviceRole.BinarySensor, DeviceRole.TemperatureSensor, DeviceRole.HumiditySensor, DeviceRole.AmbientLightSensor, DeviceRole.PressureSensor, DeviceRole.WindSensor, DeviceRole.RainSensor, DeviceRole.UvSensor, DeviceRole.SolarRadiationSensor, DeviceRole.SoilMoistureSensor, DeviceRole.PowerSensor, DeviceRole.EnergySensor, DeviceRole.VoltageSensor, DeviceRole.CurrentSensor, DeviceRole.AirQualitySensor, DeviceRole.BatterySensor, DeviceRole.NumericSensor, DeviceRole.EnumSensor, DeviceRole.DateTimeSensor, DeviceRole.GenericSensor, DeviceRole.NumericControl, DeviceRole.SelectControl, DeviceRole.TextControl, DeviceRole.DateTimeControl, DeviceRole.MobilePushNotifier, DeviceRole.MessagingNotifier, DeviceRole.EmailNotifier, DeviceRole.GenericNotifier, DeviceRole.IrTransmitter;
|
|
87378
87671
|
Object.freeze({
|
|
87379
87672
|
"accessories.getStatus": {
|
|
87380
87673
|
capName: "accessories",
|
|
@@ -89224,41 +89517,6 @@ Object.freeze({
|
|
|
89224
89517
|
access: "create",
|
|
89225
89518
|
role: "admin"
|
|
89226
89519
|
},
|
|
89227
|
-
"deviceDiscovery.adoptDevice": {
|
|
89228
|
-
capName: "device-discovery",
|
|
89229
|
-
capScope: "device",
|
|
89230
|
-
addonId: null,
|
|
89231
|
-
access: "create",
|
|
89232
|
-
role: "admin"
|
|
89233
|
-
},
|
|
89234
|
-
"deviceDiscovery.getStatus": {
|
|
89235
|
-
capName: "device-discovery",
|
|
89236
|
-
capScope: "device",
|
|
89237
|
-
addonId: null,
|
|
89238
|
-
access: "view",
|
|
89239
|
-
role: "viewer"
|
|
89240
|
-
},
|
|
89241
|
-
"deviceDiscovery.listDiscovered": {
|
|
89242
|
-
capName: "device-discovery",
|
|
89243
|
-
capScope: "device",
|
|
89244
|
-
addonId: null,
|
|
89245
|
-
access: "view",
|
|
89246
|
-
role: "viewer"
|
|
89247
|
-
},
|
|
89248
|
-
"deviceDiscovery.refreshDiscovery": {
|
|
89249
|
-
capName: "device-discovery",
|
|
89250
|
-
capScope: "device",
|
|
89251
|
-
addonId: null,
|
|
89252
|
-
access: "create",
|
|
89253
|
-
role: "admin"
|
|
89254
|
-
},
|
|
89255
|
-
"deviceDiscovery.releaseDevice": {
|
|
89256
|
-
capName: "device-discovery",
|
|
89257
|
-
capScope: "device",
|
|
89258
|
-
addonId: null,
|
|
89259
|
-
access: "create",
|
|
89260
|
-
role: "admin"
|
|
89261
|
-
},
|
|
89262
89520
|
"deviceExport.applyDeviceSettingsPatch": {
|
|
89263
89521
|
capName: "device-export",
|
|
89264
89522
|
capScope: "system",
|
|
@@ -90806,6 +91064,13 @@ Object.freeze({
|
|
|
90806
91064
|
access: "create",
|
|
90807
91065
|
role: "viewer"
|
|
90808
91066
|
},
|
|
91067
|
+
"fanControl.setOscillationAxis": {
|
|
91068
|
+
capName: "fan-control",
|
|
91069
|
+
capScope: "device",
|
|
91070
|
+
addonId: null,
|
|
91071
|
+
access: "create",
|
|
91072
|
+
role: "viewer"
|
|
91073
|
+
},
|
|
90809
91074
|
"fanControl.setPercentage": {
|
|
90810
91075
|
capName: "fan-control",
|
|
90811
91076
|
capScope: "device",
|
|
@@ -97827,7 +98092,7 @@ function projectAction(cap, action) {
|
|
|
97827
98092
|
};
|
|
97828
98093
|
}
|
|
97829
98094
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
97830
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.
|
|
98095
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.HeatPump, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.PetFountain, DeviceType.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Gateway;
|
|
97831
98096
|
DeviceFeature.BatteryOperated;
|
|
97832
98097
|
function bound(cap, methods = [], authority = "reported") {
|
|
97833
98098
|
return {
|
|
@@ -98316,35 +98581,6 @@ Object.freeze({
|
|
|
98316
98581
|
form: "single",
|
|
98317
98582
|
optional: false
|
|
98318
98583
|
}],
|
|
98319
|
-
"deviceDiscovery.adoptDevice": [{
|
|
98320
|
-
name: "deviceId",
|
|
98321
|
-
form: "single",
|
|
98322
|
-
optional: false
|
|
98323
|
-
}],
|
|
98324
|
-
"deviceDiscovery.getStatus": [{
|
|
98325
|
-
name: "deviceId",
|
|
98326
|
-
form: "single",
|
|
98327
|
-
optional: false
|
|
98328
|
-
}],
|
|
98329
|
-
"deviceDiscovery.listDiscovered": [{
|
|
98330
|
-
name: "deviceId",
|
|
98331
|
-
form: "single",
|
|
98332
|
-
optional: false
|
|
98333
|
-
}],
|
|
98334
|
-
"deviceDiscovery.refreshDiscovery": [{
|
|
98335
|
-
name: "deviceId",
|
|
98336
|
-
form: "single",
|
|
98337
|
-
optional: false
|
|
98338
|
-
}],
|
|
98339
|
-
"deviceDiscovery.releaseDevice": [{
|
|
98340
|
-
name: "childDeviceId",
|
|
98341
|
-
form: "single",
|
|
98342
|
-
optional: false
|
|
98343
|
-
}, {
|
|
98344
|
-
name: "deviceId",
|
|
98345
|
-
form: "single",
|
|
98346
|
-
optional: false
|
|
98347
|
-
}],
|
|
98348
98584
|
"deviceExport.applyDeviceSettingsPatch": [{
|
|
98349
98585
|
name: "deviceId",
|
|
98350
98586
|
form: "single",
|
|
@@ -98908,6 +99144,11 @@ Object.freeze({
|
|
|
98908
99144
|
form: "single",
|
|
98909
99145
|
optional: false
|
|
98910
99146
|
}],
|
|
99147
|
+
"fanControl.setOscillationAxis": [{
|
|
99148
|
+
name: "deviceId",
|
|
99149
|
+
form: "single",
|
|
99150
|
+
optional: false
|
|
99151
|
+
}],
|
|
98911
99152
|
"fanControl.setPercentage": [{
|
|
98912
99153
|
name: "deviceId",
|
|
98913
99154
|
form: "single",
|
|
@@ -127296,7 +127537,7 @@ function mapHmChannel(channelType) {
|
|
|
127296
127537
|
capabilities: ["cover"]
|
|
127297
127538
|
};
|
|
127298
127539
|
case "HEATING_CLIMATECONTROL_TRANSCEIVER": return {
|
|
127299
|
-
deviceType: DeviceType.
|
|
127540
|
+
deviceType: DeviceType.Climate,
|
|
127300
127541
|
role: null,
|
|
127301
127542
|
capabilities: [
|
|
127302
127543
|
"climate-control",
|
|
@@ -127335,12 +127576,12 @@ function mapHmChannel(channelType) {
|
|
|
127335
127576
|
* from the union of its channel mappings. Actuators win over sensors so
|
|
127336
127577
|
* a switch + energy-meter device (HmIP-BSM) reports as a Switch, not a
|
|
127337
127578
|
* Sensor, and a thermostat with a humidity sensor reports as a
|
|
127338
|
-
*
|
|
127579
|
+
* Climate device (D1033). A remote/wall-switch is primarily an EventEmitter: it is
|
|
127339
127580
|
* ranked above Sensor so its battery / maintenance sensor channels don't
|
|
127340
127581
|
* win the parent type. Returns `DeviceType.Generic` when no channel maps.
|
|
127341
127582
|
*/
|
|
127342
127583
|
var PARENT_TYPE_PRIORITY = [
|
|
127343
|
-
DeviceType.
|
|
127584
|
+
DeviceType.Climate,
|
|
127344
127585
|
DeviceType.Lock,
|
|
127345
127586
|
DeviceType.Cover,
|
|
127346
127587
|
DeviceType.Light,
|
|
@@ -127524,7 +127765,7 @@ function actuatorInfo(kind) {
|
|
|
127524
127765
|
case "climate": return {
|
|
127525
127766
|
kind: "climate",
|
|
127526
127767
|
capName: "climate-control",
|
|
127527
|
-
type: DeviceType.
|
|
127768
|
+
type: DeviceType.Climate
|
|
127528
127769
|
};
|
|
127529
127770
|
default: return null;
|
|
127530
127771
|
}
|
|
@@ -127534,13 +127775,28 @@ function actuatorInfo(kind) {
|
|
|
127534
127775
|
* tilt), a plain `cover` entity is the roller shutter (HmIP-BROLL). Exporters
|
|
127535
127776
|
* read it; every other actuator has no role.
|
|
127536
127777
|
*/
|
|
127537
|
-
function actuatorRole(kind) {
|
|
127778
|
+
function actuatorRole(kind, model) {
|
|
127538
127779
|
if (kind === "blind") return DeviceRole.CoverBlind;
|
|
127539
127780
|
if (kind === "cover") return DeviceRole.CoverShutter;
|
|
127781
|
+
if (kind === "climate") return climateRoleOfModel(model);
|
|
127540
127782
|
return null;
|
|
127541
127783
|
}
|
|
127784
|
+
/** Radiator valves: HmIP-eTRV-* and the classic HM-CC-RT-DN. */
|
|
127785
|
+
var RADIATOR_MODEL = /eTRV|HM-CC-RT-DN/i;
|
|
127786
|
+
/** Floor-heating actuators: HmIP-FAL* / HmIP-FALMOT-*. */
|
|
127787
|
+
var FLOOR_MODEL = /FAL/i;
|
|
127788
|
+
/**
|
|
127789
|
+
* D1033 — which climate device a Homematic model is. A radiator valve and a
|
|
127790
|
+
* floor-heating actuator are told apart by model; a wall thermostat, a
|
|
127791
|
+
* heating group and an unknown model are thermostats.
|
|
127792
|
+
*/
|
|
127793
|
+
function climateRoleOfModel(model) {
|
|
127794
|
+
if (model !== void 0 && RADIATOR_MODEL.test(model)) return DeviceRole.ClimateRadiator;
|
|
127795
|
+
if (model !== void 0 && FLOOR_MODEL.test(model)) return DeviceRole.ClimateFloor;
|
|
127796
|
+
return DeviceRole.ClimateThermostat;
|
|
127797
|
+
}
|
|
127542
127798
|
/** Actuator specs from the library's typed custom entities (correct channel). */
|
|
127543
|
-
function deriveActuatorSpecs(customEntities) {
|
|
127799
|
+
function deriveActuatorSpecs(customEntities, model) {
|
|
127544
127800
|
const out = [];
|
|
127545
127801
|
for (const entity of customEntities) {
|
|
127546
127802
|
const info = actuatorInfo(entity.kind);
|
|
@@ -127548,7 +127804,7 @@ function deriveActuatorSpecs(customEntities) {
|
|
|
127548
127804
|
out.push({
|
|
127549
127805
|
key: `act-${entity.channel}`,
|
|
127550
127806
|
deviceType: info.type,
|
|
127551
|
-
role: actuatorRole(entity.kind),
|
|
127807
|
+
role: actuatorRole(entity.kind, model),
|
|
127552
127808
|
capabilities: [info.capName],
|
|
127553
127809
|
name: `${entity.kind} ${entity.channel}`,
|
|
127554
127810
|
config: {
|
|
@@ -127648,7 +127904,7 @@ function deriveUpdateSpec(device) {
|
|
|
127648
127904
|
*/
|
|
127649
127905
|
function deriveHmEntitySpecs(device, customEntities) {
|
|
127650
127906
|
return [
|
|
127651
|
-
...deriveActuatorSpecs(customEntities),
|
|
127907
|
+
...deriveActuatorSpecs(customEntities, device.type),
|
|
127652
127908
|
...deriveSensorAndEventSpecs(device),
|
|
127653
127909
|
...deriveDiagnosticSpecs(device, device.address),
|
|
127654
127910
|
...deriveUpdateSpec(device)
|