@camstack/addon-export-alexa 1.2.170 → 1.2.171
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/dist/export-alexa.addon.js +150 -9
- package/dist/export-alexa.addon.mjs +150 -9
- package/package.json +1 -1
|
@@ -10443,7 +10443,7 @@ object({
|
|
|
10443
10443
|
params: record(string(), union([string(), number()])).optional()
|
|
10444
10444
|
});
|
|
10445
10445
|
//#endregion
|
|
10446
|
-
//#region ../types/dist/err-msg-
|
|
10446
|
+
//#region ../types/dist/err-msg-DIorGYeC.mjs
|
|
10447
10447
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10448
10448
|
DeviceType["Camera"] = "camera";
|
|
10449
10449
|
DeviceType["Hub"] = "hub";
|
|
@@ -10537,8 +10537,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10537
10537
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10538
10538
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10539
10539
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10540
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10540
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10541
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
10541
10542
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
10543
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
10544
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
10545
|
+
DeviceType["Washer"] = "washer";
|
|
10546
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
10547
|
+
DeviceType["Dryer"] = "dryer";
|
|
10542
10548
|
return DeviceType;
|
|
10543
10549
|
}({});
|
|
10544
10550
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -10796,7 +10802,7 @@ function errMsg(err) {
|
|
|
10796
10802
|
return String(err);
|
|
10797
10803
|
}
|
|
10798
10804
|
//#endregion
|
|
10799
|
-
//#region ../types/dist/composition-
|
|
10805
|
+
//#region ../types/dist/composition-B2rw5L29.mjs
|
|
10800
10806
|
/**
|
|
10801
10807
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10802
10808
|
*
|
|
@@ -11552,6 +11558,26 @@ function validateExpressionSource(src) {
|
|
|
11552
11558
|
return null;
|
|
11553
11559
|
}
|
|
11554
11560
|
/**
|
|
11561
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
11562
|
+
*
|
|
11563
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
11564
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
11565
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
11566
|
+
*
|
|
11567
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
11568
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
11569
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
11570
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
11571
|
+
* can move later without moving the others.
|
|
11572
|
+
*/
|
|
11573
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
11574
|
+
var APPLIANCE_KINDS = [
|
|
11575
|
+
"washer",
|
|
11576
|
+
"dryer",
|
|
11577
|
+
"dishwasher"
|
|
11578
|
+
];
|
|
11579
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11580
|
+
/**
|
|
11555
11581
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11556
11582
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11557
11583
|
* `composition.ts` (D659).
|
|
@@ -11614,6 +11640,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
|
|
|
11614
11640
|
members: array(HelperMemberSchema).min(1).max(64),
|
|
11615
11641
|
/** Actuator groups only. Readings leave this unset. */
|
|
11616
11642
|
active: ActiveCriterionSchema.optional()
|
|
11643
|
+
}), object({
|
|
11644
|
+
kind: literal("appliance"),
|
|
11645
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11646
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11647
|
+
thresholdWatts: number().positive(),
|
|
11648
|
+
startDwellMs: number().int().nonnegative(),
|
|
11649
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11650
|
+
member: HelperMemberSchema
|
|
11617
11651
|
})]);
|
|
11618
11652
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11619
11653
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
@@ -61438,7 +61472,7 @@ object({
|
|
|
61438
61472
|
/** Ms epoch when the slice was last updated. */
|
|
61439
61473
|
lastFetchedAt: number()
|
|
61440
61474
|
});
|
|
61441
|
-
DeviceType.Sensor;
|
|
61475
|
+
DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
61442
61476
|
/**
|
|
61443
61477
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61444
61478
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61885,7 +61919,7 @@ object({
|
|
|
61885
61919
|
phase: string().nullable()
|
|
61886
61920
|
});
|
|
61887
61921
|
Object.values(DeviceType);
|
|
61888
|
-
DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61922
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61889
61923
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
61890
61924
|
kind: "mutation",
|
|
61891
61925
|
auth: "admin"
|
|
@@ -65636,7 +65670,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65636
65670
|
auth: "admin"
|
|
65637
65671
|
});
|
|
65638
65672
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65639
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65673
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65640
65674
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65641
65675
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65642
65676
|
new Set(CAP_NAMES);
|
|
@@ -65689,7 +65723,7 @@ var AccessoryKind = {
|
|
|
65689
65723
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
65690
65724
|
};
|
|
65691
65725
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
65692
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher;
|
|
65726
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
65693
65727
|
new Set(Object.values(DeviceType));
|
|
65694
65728
|
Object.freeze({
|
|
65695
65729
|
"accessories.getStatus": {
|
|
@@ -77976,7 +78010,39 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77976
78010
|
phrase: t("When {device} finishes", "Quando {device} finisce"),
|
|
77977
78011
|
icon: "square"
|
|
77978
78012
|
}
|
|
77979
|
-
}
|
|
78013
|
+
},
|
|
78014
|
+
overrides: { byType: {
|
|
78015
|
+
[DeviceType.Washer]: {
|
|
78016
|
+
state: { running: {
|
|
78017
|
+
whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
|
|
78018
|
+
whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
|
|
78019
|
+
} },
|
|
78020
|
+
events: {
|
|
78021
|
+
onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
|
|
78022
|
+
onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
|
|
78023
|
+
}
|
|
78024
|
+
},
|
|
78025
|
+
[DeviceType.Dryer]: {
|
|
78026
|
+
state: { running: {
|
|
78027
|
+
whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
|
|
78028
|
+
whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
|
|
78029
|
+
} },
|
|
78030
|
+
events: {
|
|
78031
|
+
onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
|
|
78032
|
+
onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
|
|
78033
|
+
}
|
|
78034
|
+
},
|
|
78035
|
+
[DeviceType.Dishwasher]: {
|
|
78036
|
+
state: { running: {
|
|
78037
|
+
whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
|
|
78038
|
+
whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
|
|
78039
|
+
} },
|
|
78040
|
+
events: {
|
|
78041
|
+
onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
|
|
78042
|
+
onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
|
|
78043
|
+
}
|
|
78044
|
+
}
|
|
78045
|
+
} }
|
|
77980
78046
|
},
|
|
77981
78047
|
update: {
|
|
77982
78048
|
scope: "device",
|
|
@@ -79276,8 +79342,72 @@ function projectAction(cap, action) {
|
|
|
79276
79342
|
};
|
|
79277
79343
|
}
|
|
79278
79344
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
79279
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher;
|
|
79345
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
79280
79346
|
DeviceFeature.BatteryOperated;
|
|
79347
|
+
/**
|
|
79348
|
+
* How a washer, dryer or dishwasher leaves CamStack.
|
|
79349
|
+
*
|
|
79350
|
+
* Home Assistant has no laundry domain: the device is offered, and what
|
|
79351
|
+
* travels is its power reading. The others have a laundry type that this
|
|
79352
|
+
* export cannot honour yet, so they are named and withheld.
|
|
79353
|
+
*/
|
|
79354
|
+
var PLUG_APPLIANCE_TYPES = [
|
|
79355
|
+
DeviceType.Washer,
|
|
79356
|
+
DeviceType.Dryer,
|
|
79357
|
+
DeviceType.Dishwasher
|
|
79358
|
+
];
|
|
79359
|
+
var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
|
|
79360
|
+
var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
|
|
79361
|
+
var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
|
|
79362
|
+
var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
|
|
79363
|
+
var MATTER_REASON = "No Matter export is built. The closest device types are Laundry Washer (0x0073) and Laundry Dryer (0x0074); a power threshold is not the Laundry Washer Mode cluster.";
|
|
79364
|
+
function withheld(reason) {
|
|
79365
|
+
return {
|
|
79366
|
+
[DeviceType.Washer]: {
|
|
79367
|
+
exported: false,
|
|
79368
|
+
reason
|
|
79369
|
+
},
|
|
79370
|
+
[DeviceType.Dryer]: {
|
|
79371
|
+
exported: false,
|
|
79372
|
+
reason
|
|
79373
|
+
},
|
|
79374
|
+
[DeviceType.Dishwasher]: {
|
|
79375
|
+
exported: false,
|
|
79376
|
+
reason
|
|
79377
|
+
}
|
|
79378
|
+
};
|
|
79379
|
+
}
|
|
79380
|
+
function offered(received) {
|
|
79381
|
+
return {
|
|
79382
|
+
[DeviceType.Washer]: {
|
|
79383
|
+
exported: true,
|
|
79384
|
+
as: received
|
|
79385
|
+
},
|
|
79386
|
+
[DeviceType.Dryer]: {
|
|
79387
|
+
exported: true,
|
|
79388
|
+
as: received
|
|
79389
|
+
},
|
|
79390
|
+
[DeviceType.Dishwasher]: {
|
|
79391
|
+
exported: true,
|
|
79392
|
+
as: received
|
|
79393
|
+
}
|
|
79394
|
+
};
|
|
79395
|
+
}
|
|
79396
|
+
var APPLIANCE_EXPORT = {
|
|
79397
|
+
ha: offered(HA_AS),
|
|
79398
|
+
homekit: withheld(HOMEKIT_REASON),
|
|
79399
|
+
alexa: withheld(ALEXA_REASON),
|
|
79400
|
+
google: withheld(GOOGLE_REASON),
|
|
79401
|
+
matter: withheld(MATTER_REASON)
|
|
79402
|
+
};
|
|
79403
|
+
function isPlugApplianceType(deviceType) {
|
|
79404
|
+
return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
|
|
79405
|
+
}
|
|
79406
|
+
/** The decision for this ecosystem, or null when the type is not an appliance. */
|
|
79407
|
+
function applianceExport(ecosystem, deviceType) {
|
|
79408
|
+
if (!isPlugApplianceType(deviceType)) return null;
|
|
79409
|
+
return APPLIANCE_EXPORT[ecosystem][deviceType];
|
|
79410
|
+
}
|
|
79281
79411
|
Object.freeze({
|
|
79282
79412
|
"accessories.getStatus": [{
|
|
79283
79413
|
name: "deviceId",
|
|
@@ -86233,6 +86363,12 @@ function switchCategory(device) {
|
|
|
86233
86363
|
}
|
|
86234
86364
|
//#endregion
|
|
86235
86365
|
//#region src/endpoints/adapters/index.ts
|
|
86366
|
+
/**
|
|
86367
|
+
* The adapter registry (D869): the ONE list Discovery, ReportState,
|
|
86368
|
+
* ChangeReport, the reconcile, the directive router and the validator read.
|
|
86369
|
+
* Adding a cap to Alexa is adding its adapter here — in order: the first
|
|
86370
|
+
* adapter with a category decides the endpoint's display category.
|
|
86371
|
+
*/
|
|
86236
86372
|
var GENERIC_ADAPTERS = [
|
|
86237
86373
|
lockAdapter,
|
|
86238
86374
|
contactAdapter,
|
|
@@ -86319,6 +86455,11 @@ function capabilityKey$2(c) {
|
|
|
86319
86455
|
}
|
|
86320
86456
|
/** What a device becomes, folding every applicable adapter in registry order. */
|
|
86321
86457
|
function planGenericDevice(device) {
|
|
86458
|
+
const withheld = applianceExport("alexa", device.type);
|
|
86459
|
+
if (withheld !== null && !withheld.exported) return {
|
|
86460
|
+
kind: "skip",
|
|
86461
|
+
reasons: [withheld.reason]
|
|
86462
|
+
};
|
|
86322
86463
|
const capabilities = [BASE];
|
|
86323
86464
|
const seen = /* @__PURE__ */ new Set();
|
|
86324
86465
|
const reasons = [];
|
|
@@ -10414,7 +10414,7 @@ object({
|
|
|
10414
10414
|
params: record(string(), union([string(), number()])).optional()
|
|
10415
10415
|
});
|
|
10416
10416
|
//#endregion
|
|
10417
|
-
//#region ../types/dist/err-msg-
|
|
10417
|
+
//#region ../types/dist/err-msg-DIorGYeC.mjs
|
|
10418
10418
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10419
10419
|
DeviceType["Camera"] = "camera";
|
|
10420
10420
|
DeviceType["Hub"] = "hub";
|
|
@@ -10508,8 +10508,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10508
10508
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10509
10509
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10510
10510
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10511
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10511
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10512
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
10512
10513
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
10514
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
10515
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
10516
|
+
DeviceType["Washer"] = "washer";
|
|
10517
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
10518
|
+
DeviceType["Dryer"] = "dryer";
|
|
10513
10519
|
return DeviceType;
|
|
10514
10520
|
}({});
|
|
10515
10521
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -10767,7 +10773,7 @@ function errMsg(err) {
|
|
|
10767
10773
|
return String(err);
|
|
10768
10774
|
}
|
|
10769
10775
|
//#endregion
|
|
10770
|
-
//#region ../types/dist/composition-
|
|
10776
|
+
//#region ../types/dist/composition-B2rw5L29.mjs
|
|
10771
10777
|
/**
|
|
10772
10778
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10773
10779
|
*
|
|
@@ -11523,6 +11529,26 @@ function validateExpressionSource(src) {
|
|
|
11523
11529
|
return null;
|
|
11524
11530
|
}
|
|
11525
11531
|
/**
|
|
11532
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
11533
|
+
*
|
|
11534
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
11535
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
11536
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
11537
|
+
*
|
|
11538
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
11539
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
11540
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
11541
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
11542
|
+
* can move later without moving the others.
|
|
11543
|
+
*/
|
|
11544
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
11545
|
+
var APPLIANCE_KINDS = [
|
|
11546
|
+
"washer",
|
|
11547
|
+
"dryer",
|
|
11548
|
+
"dishwasher"
|
|
11549
|
+
];
|
|
11550
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11551
|
+
/**
|
|
11526
11552
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11527
11553
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11528
11554
|
* `composition.ts` (D659).
|
|
@@ -11585,6 +11611,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
|
|
|
11585
11611
|
members: array(HelperMemberSchema).min(1).max(64),
|
|
11586
11612
|
/** Actuator groups only. Readings leave this unset. */
|
|
11587
11613
|
active: ActiveCriterionSchema.optional()
|
|
11614
|
+
}), object({
|
|
11615
|
+
kind: literal("appliance"),
|
|
11616
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11617
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11618
|
+
thresholdWatts: number().positive(),
|
|
11619
|
+
startDwellMs: number().int().nonnegative(),
|
|
11620
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11621
|
+
member: HelperMemberSchema
|
|
11588
11622
|
})]);
|
|
11589
11623
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11590
11624
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
@@ -61409,7 +61443,7 @@ object({
|
|
|
61409
61443
|
/** Ms epoch when the slice was last updated. */
|
|
61410
61444
|
lastFetchedAt: number()
|
|
61411
61445
|
});
|
|
61412
|
-
DeviceType.Sensor;
|
|
61446
|
+
DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
61413
61447
|
/**
|
|
61414
61448
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61415
61449
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61856,7 +61890,7 @@ object({
|
|
|
61856
61890
|
phase: string().nullable()
|
|
61857
61891
|
});
|
|
61858
61892
|
Object.values(DeviceType);
|
|
61859
|
-
DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61893
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61860
61894
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
61861
61895
|
kind: "mutation",
|
|
61862
61896
|
auth: "admin"
|
|
@@ -65607,7 +65641,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65607
65641
|
auth: "admin"
|
|
65608
65642
|
});
|
|
65609
65643
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65610
|
-
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65644
|
+
DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer, DeviceType.Camera, DeviceType.Camera, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
65611
65645
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65612
65646
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65613
65647
|
new Set(CAP_NAMES);
|
|
@@ -65660,7 +65694,7 @@ var AccessoryKind = {
|
|
|
65660
65694
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
65661
65695
|
};
|
|
65662
65696
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
65663
|
-
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher;
|
|
65697
|
+
DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Camera, DeviceType.Hub, DeviceType.Switch, DeviceType.Siren, DeviceType.Light, DeviceType.Fan, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
65664
65698
|
new Set(Object.values(DeviceType));
|
|
65665
65699
|
Object.freeze({
|
|
65666
65700
|
"accessories.getStatus": {
|
|
@@ -77947,7 +77981,39 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77947
77981
|
phrase: t("When {device} finishes", "Quando {device} finisce"),
|
|
77948
77982
|
icon: "square"
|
|
77949
77983
|
}
|
|
77950
|
-
}
|
|
77984
|
+
},
|
|
77985
|
+
overrides: { byType: {
|
|
77986
|
+
[DeviceType.Washer]: {
|
|
77987
|
+
state: { running: {
|
|
77988
|
+
whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
|
|
77989
|
+
whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
|
|
77990
|
+
} },
|
|
77991
|
+
events: {
|
|
77992
|
+
onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
|
|
77993
|
+
onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
|
|
77994
|
+
}
|
|
77995
|
+
},
|
|
77996
|
+
[DeviceType.Dryer]: {
|
|
77997
|
+
state: { running: {
|
|
77998
|
+
whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
|
|
77999
|
+
whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
|
|
78000
|
+
} },
|
|
78001
|
+
events: {
|
|
78002
|
+
onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
|
|
78003
|
+
onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
|
|
78004
|
+
}
|
|
78005
|
+
},
|
|
78006
|
+
[DeviceType.Dishwasher]: {
|
|
78007
|
+
state: { running: {
|
|
78008
|
+
whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
|
|
78009
|
+
whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
|
|
78010
|
+
} },
|
|
78011
|
+
events: {
|
|
78012
|
+
onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
|
|
78013
|
+
onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
|
|
78014
|
+
}
|
|
78015
|
+
}
|
|
78016
|
+
} }
|
|
77951
78017
|
},
|
|
77952
78018
|
update: {
|
|
77953
78019
|
scope: "device",
|
|
@@ -79247,8 +79313,72 @@ function projectAction(cap, action) {
|
|
|
79247
79313
|
};
|
|
79248
79314
|
}
|
|
79249
79315
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
79250
|
-
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher;
|
|
79316
|
+
DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, 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.Dishwasher, DeviceType.Washer, DeviceType.Dryer;
|
|
79251
79317
|
DeviceFeature.BatteryOperated;
|
|
79318
|
+
/**
|
|
79319
|
+
* How a washer, dryer or dishwasher leaves CamStack.
|
|
79320
|
+
*
|
|
79321
|
+
* Home Assistant has no laundry domain: the device is offered, and what
|
|
79322
|
+
* travels is its power reading. The others have a laundry type that this
|
|
79323
|
+
* export cannot honour yet, so they are named and withheld.
|
|
79324
|
+
*/
|
|
79325
|
+
var PLUG_APPLIANCE_TYPES = [
|
|
79326
|
+
DeviceType.Washer,
|
|
79327
|
+
DeviceType.Dryer,
|
|
79328
|
+
DeviceType.Dishwasher
|
|
79329
|
+
];
|
|
79330
|
+
var HA_AS = "a power sensor (device_class power). Home Assistant has no laundry domain. running-state stays unexported until a null reading can be published as unavailable.";
|
|
79331
|
+
var HOMEKIT_REASON = "HomeKit has no laundry-appliance service. The export tab would pair an accessory with nothing on it: running-state is withheld until a null reading can be unavailable, and power is not a HomeKit service this export honours.";
|
|
79332
|
+
var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
|
|
79333
|
+
var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
|
|
79334
|
+
var MATTER_REASON = "No Matter export is built. The closest device types are Laundry Washer (0x0073) and Laundry Dryer (0x0074); a power threshold is not the Laundry Washer Mode cluster.";
|
|
79335
|
+
function withheld(reason) {
|
|
79336
|
+
return {
|
|
79337
|
+
[DeviceType.Washer]: {
|
|
79338
|
+
exported: false,
|
|
79339
|
+
reason
|
|
79340
|
+
},
|
|
79341
|
+
[DeviceType.Dryer]: {
|
|
79342
|
+
exported: false,
|
|
79343
|
+
reason
|
|
79344
|
+
},
|
|
79345
|
+
[DeviceType.Dishwasher]: {
|
|
79346
|
+
exported: false,
|
|
79347
|
+
reason
|
|
79348
|
+
}
|
|
79349
|
+
};
|
|
79350
|
+
}
|
|
79351
|
+
function offered(received) {
|
|
79352
|
+
return {
|
|
79353
|
+
[DeviceType.Washer]: {
|
|
79354
|
+
exported: true,
|
|
79355
|
+
as: received
|
|
79356
|
+
},
|
|
79357
|
+
[DeviceType.Dryer]: {
|
|
79358
|
+
exported: true,
|
|
79359
|
+
as: received
|
|
79360
|
+
},
|
|
79361
|
+
[DeviceType.Dishwasher]: {
|
|
79362
|
+
exported: true,
|
|
79363
|
+
as: received
|
|
79364
|
+
}
|
|
79365
|
+
};
|
|
79366
|
+
}
|
|
79367
|
+
var APPLIANCE_EXPORT = {
|
|
79368
|
+
ha: offered(HA_AS),
|
|
79369
|
+
homekit: withheld(HOMEKIT_REASON),
|
|
79370
|
+
alexa: withheld(ALEXA_REASON),
|
|
79371
|
+
google: withheld(GOOGLE_REASON),
|
|
79372
|
+
matter: withheld(MATTER_REASON)
|
|
79373
|
+
};
|
|
79374
|
+
function isPlugApplianceType(deviceType) {
|
|
79375
|
+
return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
|
|
79376
|
+
}
|
|
79377
|
+
/** The decision for this ecosystem, or null when the type is not an appliance. */
|
|
79378
|
+
function applianceExport(ecosystem, deviceType) {
|
|
79379
|
+
if (!isPlugApplianceType(deviceType)) return null;
|
|
79380
|
+
return APPLIANCE_EXPORT[ecosystem][deviceType];
|
|
79381
|
+
}
|
|
79252
79382
|
Object.freeze({
|
|
79253
79383
|
"accessories.getStatus": [{
|
|
79254
79384
|
name: "deviceId",
|
|
@@ -86204,6 +86334,12 @@ function switchCategory(device) {
|
|
|
86204
86334
|
}
|
|
86205
86335
|
//#endregion
|
|
86206
86336
|
//#region src/endpoints/adapters/index.ts
|
|
86337
|
+
/**
|
|
86338
|
+
* The adapter registry (D869): the ONE list Discovery, ReportState,
|
|
86339
|
+
* ChangeReport, the reconcile, the directive router and the validator read.
|
|
86340
|
+
* Adding a cap to Alexa is adding its adapter here — in order: the first
|
|
86341
|
+
* adapter with a category decides the endpoint's display category.
|
|
86342
|
+
*/
|
|
86207
86343
|
var GENERIC_ADAPTERS = [
|
|
86208
86344
|
lockAdapter,
|
|
86209
86345
|
contactAdapter,
|
|
@@ -86290,6 +86426,11 @@ function capabilityKey$2(c) {
|
|
|
86290
86426
|
}
|
|
86291
86427
|
/** What a device becomes, folding every applicable adapter in registry order. */
|
|
86292
86428
|
function planGenericDevice(device) {
|
|
86429
|
+
const withheld = applianceExport("alexa", device.type);
|
|
86430
|
+
if (withheld !== null && !withheld.exported) return {
|
|
86431
|
+
kind: "skip",
|
|
86432
|
+
reasons: [withheld.reason]
|
|
86433
|
+
};
|
|
86293
86434
|
const capabilities = [BASE];
|
|
86294
86435
|
const seen = /* @__PURE__ */ new Set();
|
|
86295
86436
|
const reasons = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-export-alexa",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.171",
|
|
4
4
|
"description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|