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