@camstack/addon-export-google 0.1.114 → 0.1.115
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-google.addon.js +144 -11
- package/dist/export-google.addon.mjs +144 -11
- package/package.json +1 -1
|
@@ -10486,7 +10486,7 @@ object({
|
|
|
10486
10486
|
params: record(string(), union([string(), number()])).optional()
|
|
10487
10487
|
});
|
|
10488
10488
|
//#endregion
|
|
10489
|
-
//#region ../types/dist/err-msg-
|
|
10489
|
+
//#region ../types/dist/err-msg-DIorGYeC.mjs
|
|
10490
10490
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10491
10491
|
DeviceType["Camera"] = "camera";
|
|
10492
10492
|
DeviceType["Hub"] = "hub";
|
|
@@ -10580,8 +10580,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10580
10580
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10581
10581
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10582
10582
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10583
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10583
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10584
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
10584
10585
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
10586
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
10587
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
10588
|
+
DeviceType["Washer"] = "washer";
|
|
10589
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
10590
|
+
DeviceType["Dryer"] = "dryer";
|
|
10585
10591
|
return DeviceType;
|
|
10586
10592
|
}({});
|
|
10587
10593
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -10839,7 +10845,7 @@ function errMsg(err) {
|
|
|
10839
10845
|
return String(err);
|
|
10840
10846
|
}
|
|
10841
10847
|
//#endregion
|
|
10842
|
-
//#region ../types/dist/composition-
|
|
10848
|
+
//#region ../types/dist/composition-B2rw5L29.mjs
|
|
10843
10849
|
/**
|
|
10844
10850
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10845
10851
|
*
|
|
@@ -11595,6 +11601,26 @@ function validateExpressionSource(src) {
|
|
|
11595
11601
|
return null;
|
|
11596
11602
|
}
|
|
11597
11603
|
/**
|
|
11604
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
11605
|
+
*
|
|
11606
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
11607
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
11608
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
11609
|
+
*
|
|
11610
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
11611
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
11612
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
11613
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
11614
|
+
* can move later without moving the others.
|
|
11615
|
+
*/
|
|
11616
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
11617
|
+
var APPLIANCE_KINDS = [
|
|
11618
|
+
"washer",
|
|
11619
|
+
"dryer",
|
|
11620
|
+
"dishwasher"
|
|
11621
|
+
];
|
|
11622
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11623
|
+
/**
|
|
11598
11624
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11599
11625
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11600
11626
|
* `composition.ts` (D659).
|
|
@@ -11657,6 +11683,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
|
|
|
11657
11683
|
members: array(HelperMemberSchema).min(1).max(64),
|
|
11658
11684
|
/** Actuator groups only. Readings leave this unset. */
|
|
11659
11685
|
active: ActiveCriterionSchema.optional()
|
|
11686
|
+
}), object({
|
|
11687
|
+
kind: literal("appliance"),
|
|
11688
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11689
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11690
|
+
thresholdWatts: number().positive(),
|
|
11691
|
+
startDwellMs: number().int().nonnegative(),
|
|
11692
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11693
|
+
member: HelperMemberSchema
|
|
11660
11694
|
})]);
|
|
11661
11695
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11662
11696
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
@@ -61298,7 +61332,7 @@ object({
|
|
|
61298
61332
|
/** Ms epoch when the slice was last updated. */
|
|
61299
61333
|
lastFetchedAt: number()
|
|
61300
61334
|
});
|
|
61301
|
-
DeviceType.Sensor;
|
|
61335
|
+
DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
61302
61336
|
/**
|
|
61303
61337
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61304
61338
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61745,7 +61779,7 @@ object({
|
|
|
61745
61779
|
phase: string().nullable()
|
|
61746
61780
|
});
|
|
61747
61781
|
Object.values(DeviceType);
|
|
61748
|
-
DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61782
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61749
61783
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
61750
61784
|
kind: "mutation",
|
|
61751
61785
|
auth: "admin"
|
|
@@ -65484,7 +65518,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65484
65518
|
auth: "admin"
|
|
65485
65519
|
});
|
|
65486
65520
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65487
|
-
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;
|
|
65521
|
+
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;
|
|
65488
65522
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65489
65523
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65490
65524
|
new Set(CAP_NAMES);
|
|
@@ -65537,7 +65571,7 @@ var AccessoryKind = {
|
|
|
65537
65571
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
65538
65572
|
};
|
|
65539
65573
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
65540
|
-
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;
|
|
65574
|
+
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;
|
|
65541
65575
|
new Set(Object.values(DeviceType));
|
|
65542
65576
|
Object.freeze({
|
|
65543
65577
|
"accessories.getStatus": {
|
|
@@ -77824,7 +77858,39 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77824
77858
|
phrase: t("When {device} finishes", "Quando {device} finisce"),
|
|
77825
77859
|
icon: "square"
|
|
77826
77860
|
}
|
|
77827
|
-
}
|
|
77861
|
+
},
|
|
77862
|
+
overrides: { byType: {
|
|
77863
|
+
[DeviceType.Washer]: {
|
|
77864
|
+
state: { running: {
|
|
77865
|
+
whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
|
|
77866
|
+
whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
|
|
77867
|
+
} },
|
|
77868
|
+
events: {
|
|
77869
|
+
onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
|
|
77870
|
+
onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
|
|
77871
|
+
}
|
|
77872
|
+
},
|
|
77873
|
+
[DeviceType.Dryer]: {
|
|
77874
|
+
state: { running: {
|
|
77875
|
+
whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
|
|
77876
|
+
whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
|
|
77877
|
+
} },
|
|
77878
|
+
events: {
|
|
77879
|
+
onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
|
|
77880
|
+
onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
|
|
77881
|
+
}
|
|
77882
|
+
},
|
|
77883
|
+
[DeviceType.Dishwasher]: {
|
|
77884
|
+
state: { running: {
|
|
77885
|
+
whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
|
|
77886
|
+
whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
|
|
77887
|
+
} },
|
|
77888
|
+
events: {
|
|
77889
|
+
onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
|
|
77890
|
+
onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
|
|
77891
|
+
}
|
|
77892
|
+
}
|
|
77893
|
+
} }
|
|
77828
77894
|
},
|
|
77829
77895
|
update: {
|
|
77830
77896
|
scope: "device",
|
|
@@ -79124,8 +79190,72 @@ function projectAction(cap, action) {
|
|
|
79124
79190
|
};
|
|
79125
79191
|
}
|
|
79126
79192
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
79127
|
-
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;
|
|
79193
|
+
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;
|
|
79128
79194
|
DeviceFeature.BatteryOperated;
|
|
79195
|
+
/**
|
|
79196
|
+
* How a washer, dryer or dishwasher leaves CamStack.
|
|
79197
|
+
*
|
|
79198
|
+
* Home Assistant has no laundry domain: the device is offered, and what
|
|
79199
|
+
* travels is its power reading. The others have a laundry type that this
|
|
79200
|
+
* export cannot honour yet, so they are named and withheld.
|
|
79201
|
+
*/
|
|
79202
|
+
var PLUG_APPLIANCE_TYPES = [
|
|
79203
|
+
DeviceType.Washer,
|
|
79204
|
+
DeviceType.Dryer,
|
|
79205
|
+
DeviceType.Dishwasher
|
|
79206
|
+
];
|
|
79207
|
+
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.";
|
|
79208
|
+
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.";
|
|
79209
|
+
var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
|
|
79210
|
+
var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
|
|
79211
|
+
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.";
|
|
79212
|
+
function withheld(reason) {
|
|
79213
|
+
return {
|
|
79214
|
+
[DeviceType.Washer]: {
|
|
79215
|
+
exported: false,
|
|
79216
|
+
reason
|
|
79217
|
+
},
|
|
79218
|
+
[DeviceType.Dryer]: {
|
|
79219
|
+
exported: false,
|
|
79220
|
+
reason
|
|
79221
|
+
},
|
|
79222
|
+
[DeviceType.Dishwasher]: {
|
|
79223
|
+
exported: false,
|
|
79224
|
+
reason
|
|
79225
|
+
}
|
|
79226
|
+
};
|
|
79227
|
+
}
|
|
79228
|
+
function offered(received) {
|
|
79229
|
+
return {
|
|
79230
|
+
[DeviceType.Washer]: {
|
|
79231
|
+
exported: true,
|
|
79232
|
+
as: received
|
|
79233
|
+
},
|
|
79234
|
+
[DeviceType.Dryer]: {
|
|
79235
|
+
exported: true,
|
|
79236
|
+
as: received
|
|
79237
|
+
},
|
|
79238
|
+
[DeviceType.Dishwasher]: {
|
|
79239
|
+
exported: true,
|
|
79240
|
+
as: received
|
|
79241
|
+
}
|
|
79242
|
+
};
|
|
79243
|
+
}
|
|
79244
|
+
var APPLIANCE_EXPORT = {
|
|
79245
|
+
ha: offered(HA_AS),
|
|
79246
|
+
homekit: withheld(HOMEKIT_REASON),
|
|
79247
|
+
alexa: withheld(ALEXA_REASON),
|
|
79248
|
+
google: withheld(GOOGLE_REASON),
|
|
79249
|
+
matter: withheld(MATTER_REASON)
|
|
79250
|
+
};
|
|
79251
|
+
function isPlugApplianceType(deviceType) {
|
|
79252
|
+
return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
|
|
79253
|
+
}
|
|
79254
|
+
/** The decision for this ecosystem, or null when the type is not an appliance. */
|
|
79255
|
+
function applianceExport(ecosystem, deviceType) {
|
|
79256
|
+
if (!isPlugApplianceType(deviceType)) return null;
|
|
79257
|
+
return APPLIANCE_EXPORT[ecosystem][deviceType];
|
|
79258
|
+
}
|
|
79129
79259
|
Object.freeze({
|
|
79130
79260
|
"accessories.getStatus": [{
|
|
79131
79261
|
name: "deviceId",
|
|
@@ -83494,8 +83624,9 @@ function traitForCommand(capNames, command) {
|
|
|
83494
83624
|
* (`SUPPORTED_DEVICE_KINDS` in `ha-export.addon.ts`) and it is what kept the
|
|
83495
83625
|
* previous exporter confined to cameras. `DeviceType` is consulted for exactly
|
|
83496
83626
|
* one thing here — picking between two Google types that carry the SAME traits
|
|
83497
|
-
* (a LIGHT and a SWITCH are both OnOff)
|
|
83498
|
-
*
|
|
83627
|
+
* (a LIGHT and a SWITCH are both OnOff). A washer, dryer or dishwasher is
|
|
83628
|
+
* withheld even when some other trait would match: Google's laundry types
|
|
83629
|
+
* require RunCycle, and this export does not publish that trait.
|
|
83499
83630
|
*/
|
|
83500
83631
|
var MANUFACTURER = "CamStack";
|
|
83501
83632
|
/**
|
|
@@ -83511,6 +83642,8 @@ var MANUFACTURER = "CamStack";
|
|
|
83511
83642
|
* A SECURITYSYSTEM would promise `ArmDisarm`, which nothing here answers.
|
|
83512
83643
|
*/
|
|
83513
83644
|
function resolveGoogleDeviceType(deviceType, traits) {
|
|
83645
|
+
const withheld = applianceExport("google", deviceType);
|
|
83646
|
+
if (withheld !== null && !withheld.exported) return null;
|
|
83514
83647
|
if (traits.includes("action.devices.traits.LockUnlock")) return "action.devices.types.LOCK";
|
|
83515
83648
|
if (traits.includes("action.devices.traits.OpenClose")) return "action.devices.types.SHUTTER";
|
|
83516
83649
|
if (!traits.includes("action.devices.traits.OnOff") && !traits.includes("action.devices.traits.Brightness")) return null;
|
|
@@ -10482,7 +10482,7 @@ object({
|
|
|
10482
10482
|
params: record(string(), union([string(), number()])).optional()
|
|
10483
10483
|
});
|
|
10484
10484
|
//#endregion
|
|
10485
|
-
//#region ../types/dist/err-msg-
|
|
10485
|
+
//#region ../types/dist/err-msg-DIorGYeC.mjs
|
|
10486
10486
|
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
10487
10487
|
DeviceType["Camera"] = "camera";
|
|
10488
10488
|
DeviceType["Hub"] = "hub";
|
|
@@ -10576,8 +10576,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
|
10576
10576
|
DeviceType["PetFeeder"] = "pet-feeder";
|
|
10577
10577
|
/** Built-in dishwasher — program lifecycle, door / remote-start gates,
|
|
10578
10578
|
* salt and rinse-aid levels. Installed with the `dishwasher` cap.
|
|
10579
|
-
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10579
|
+
* Sources: native Bosch Home Connect, reusable by similar integrations.
|
|
10580
|
+
* A plug-built dishwasher carries running-state and power instead. */
|
|
10580
10581
|
DeviceType["Dishwasher"] = "dishwasher";
|
|
10582
|
+
/** Washing machine. A plug-built one is running while its power stays
|
|
10583
|
+
* above a threshold. No program cap — that surface is the dishwasher's. */
|
|
10584
|
+
DeviceType["Washer"] = "washer";
|
|
10585
|
+
/** Tumble dryer. Same plug-built running surface as {@link Washer}. */
|
|
10586
|
+
DeviceType["Dryer"] = "dryer";
|
|
10581
10587
|
return DeviceType;
|
|
10582
10588
|
}({});
|
|
10583
10589
|
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
@@ -10835,7 +10841,7 @@ function errMsg(err) {
|
|
|
10835
10841
|
return String(err);
|
|
10836
10842
|
}
|
|
10837
10843
|
//#endregion
|
|
10838
|
-
//#region ../types/dist/composition-
|
|
10844
|
+
//#region ../types/dist/composition-B2rw5L29.mjs
|
|
10839
10845
|
/**
|
|
10840
10846
|
* The ffmpeg build every CamStack node downloads, per platform and arch.
|
|
10841
10847
|
*
|
|
@@ -11591,6 +11597,26 @@ function validateExpressionSource(src) {
|
|
|
11591
11597
|
return null;
|
|
11592
11598
|
}
|
|
11593
11599
|
/**
|
|
11600
|
+
* One power reading becomes a washer, dryer or dishwasher (D944 helper).
|
|
11601
|
+
*
|
|
11602
|
+
* Standby of the control board is under 5 W; a motor or a heater is far
|
|
11603
|
+
* above that, so 5 W is the line. A door lock or a short pump spike is not
|
|
11604
|
+
* a cycle, so running starts only after 30 s above the line.
|
|
11605
|
+
*
|
|
11606
|
+
* A wash, dry or dishwasher pause (soak, heat-wait, heater off between
|
|
11607
|
+
* bursts) lasts several minutes. Ending the cycle on the first dip would
|
|
11608
|
+
* report "finished" in the middle of the program, so the stop dwell is
|
|
11609
|
+
* 10 minutes on every type. The number is stored per type so one machine
|
|
11610
|
+
* can move later without moving the others.
|
|
11611
|
+
*/
|
|
11612
|
+
var APPLIANCE_TEMPLATE_ID = "appliance";
|
|
11613
|
+
var APPLIANCE_KINDS = [
|
|
11614
|
+
"washer",
|
|
11615
|
+
"dryer",
|
|
11616
|
+
"dishwasher"
|
|
11617
|
+
];
|
|
11618
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
11619
|
+
/**
|
|
11594
11620
|
* A composition source identity: `(addonId, stableId)`, never a numeric device
|
|
11595
11621
|
* id. Split out so helper schemas can name it without a cycle through
|
|
11596
11622
|
* `composition.ts` (D659).
|
|
@@ -11653,6 +11679,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
|
|
|
11653
11679
|
members: array(HelperMemberSchema).min(1).max(64),
|
|
11654
11680
|
/** Actuator groups only. Readings leave this unset. */
|
|
11655
11681
|
active: ActiveCriterionSchema.optional()
|
|
11682
|
+
}), object({
|
|
11683
|
+
kind: literal("appliance"),
|
|
11684
|
+
templateId: literal(APPLIANCE_TEMPLATE_ID),
|
|
11685
|
+
appliance: _enum(APPLIANCE_KINDS),
|
|
11686
|
+
thresholdWatts: number().positive(),
|
|
11687
|
+
startDwellMs: number().int().nonnegative(),
|
|
11688
|
+
stopDwellMs: number().int().nonnegative(),
|
|
11689
|
+
member: HelperMemberSchema
|
|
11656
11690
|
})]);
|
|
11657
11691
|
/** A composed device's stableId is this prefix plus the block id. */
|
|
11658
11692
|
var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
|
|
@@ -61294,7 +61328,7 @@ object({
|
|
|
61294
61328
|
/** Ms epoch when the slice was last updated. */
|
|
61295
61329
|
lastFetchedAt: number()
|
|
61296
61330
|
});
|
|
61297
|
-
DeviceType.Sensor;
|
|
61331
|
+
DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
|
|
61298
61332
|
/**
|
|
61299
61333
|
* Presence cap. Models HA `person.*` and `device_tracker.*` entities
|
|
61300
61334
|
* on `DeviceType.Presence`. Read-only — no setters: presence is
|
|
@@ -61741,7 +61775,7 @@ object({
|
|
|
61741
61775
|
phase: string().nullable()
|
|
61742
61776
|
});
|
|
61743
61777
|
Object.values(DeviceType);
|
|
61744
|
-
DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61778
|
+
DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
|
|
61745
61779
|
DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
|
|
61746
61780
|
kind: "mutation",
|
|
61747
61781
|
auth: "admin"
|
|
@@ -65480,7 +65514,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
|
|
|
65480
65514
|
auth: "admin"
|
|
65481
65515
|
});
|
|
65482
65516
|
SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
|
|
65483
|
-
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;
|
|
65517
|
+
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;
|
|
65484
65518
|
String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
|
|
65485
65519
|
DeviceRole.BinarySensor, DeviceRole.MotionSensor;
|
|
65486
65520
|
new Set(CAP_NAMES);
|
|
@@ -65533,7 +65567,7 @@ var AccessoryKind = {
|
|
|
65533
65567
|
PrivacyMask: DeviceRole.PrivacyMask
|
|
65534
65568
|
};
|
|
65535
65569
|
AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
|
|
65536
|
-
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;
|
|
65570
|
+
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;
|
|
65537
65571
|
new Set(Object.values(DeviceType));
|
|
65538
65572
|
Object.freeze({
|
|
65539
65573
|
"accessories.getStatus": {
|
|
@@ -77820,7 +77854,39 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
77820
77854
|
phrase: t("When {device} finishes", "Quando {device} finisce"),
|
|
77821
77855
|
icon: "square"
|
|
77822
77856
|
}
|
|
77823
|
-
}
|
|
77857
|
+
},
|
|
77858
|
+
overrides: { byType: {
|
|
77859
|
+
[DeviceType.Washer]: {
|
|
77860
|
+
state: { running: {
|
|
77861
|
+
whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
|
|
77862
|
+
whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
|
|
77863
|
+
} },
|
|
77864
|
+
events: {
|
|
77865
|
+
onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
|
|
77866
|
+
onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
|
|
77867
|
+
}
|
|
77868
|
+
},
|
|
77869
|
+
[DeviceType.Dryer]: {
|
|
77870
|
+
state: { running: {
|
|
77871
|
+
whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
|
|
77872
|
+
whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
|
|
77873
|
+
} },
|
|
77874
|
+
events: {
|
|
77875
|
+
onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
|
|
77876
|
+
onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
|
|
77877
|
+
}
|
|
77878
|
+
},
|
|
77879
|
+
[DeviceType.Dishwasher]: {
|
|
77880
|
+
state: { running: {
|
|
77881
|
+
whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
|
|
77882
|
+
whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
|
|
77883
|
+
} },
|
|
77884
|
+
events: {
|
|
77885
|
+
onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
|
|
77886
|
+
onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
|
|
77887
|
+
}
|
|
77888
|
+
}
|
|
77889
|
+
} }
|
|
77824
77890
|
},
|
|
77825
77891
|
update: {
|
|
77826
77892
|
scope: "device",
|
|
@@ -79120,8 +79186,72 @@ function projectAction(cap, action) {
|
|
|
79120
79186
|
};
|
|
79121
79187
|
}
|
|
79122
79188
|
Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
|
|
79123
|
-
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;
|
|
79189
|
+
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;
|
|
79124
79190
|
DeviceFeature.BatteryOperated;
|
|
79191
|
+
/**
|
|
79192
|
+
* How a washer, dryer or dishwasher leaves CamStack.
|
|
79193
|
+
*
|
|
79194
|
+
* Home Assistant has no laundry domain: the device is offered, and what
|
|
79195
|
+
* travels is its power reading. The others have a laundry type that this
|
|
79196
|
+
* export cannot honour yet, so they are named and withheld.
|
|
79197
|
+
*/
|
|
79198
|
+
var PLUG_APPLIANCE_TYPES = [
|
|
79199
|
+
DeviceType.Washer,
|
|
79200
|
+
DeviceType.Dryer,
|
|
79201
|
+
DeviceType.Dishwasher
|
|
79202
|
+
];
|
|
79203
|
+
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.";
|
|
79204
|
+
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.";
|
|
79205
|
+
var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
|
|
79206
|
+
var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
|
|
79207
|
+
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.";
|
|
79208
|
+
function withheld(reason) {
|
|
79209
|
+
return {
|
|
79210
|
+
[DeviceType.Washer]: {
|
|
79211
|
+
exported: false,
|
|
79212
|
+
reason
|
|
79213
|
+
},
|
|
79214
|
+
[DeviceType.Dryer]: {
|
|
79215
|
+
exported: false,
|
|
79216
|
+
reason
|
|
79217
|
+
},
|
|
79218
|
+
[DeviceType.Dishwasher]: {
|
|
79219
|
+
exported: false,
|
|
79220
|
+
reason
|
|
79221
|
+
}
|
|
79222
|
+
};
|
|
79223
|
+
}
|
|
79224
|
+
function offered(received) {
|
|
79225
|
+
return {
|
|
79226
|
+
[DeviceType.Washer]: {
|
|
79227
|
+
exported: true,
|
|
79228
|
+
as: received
|
|
79229
|
+
},
|
|
79230
|
+
[DeviceType.Dryer]: {
|
|
79231
|
+
exported: true,
|
|
79232
|
+
as: received
|
|
79233
|
+
},
|
|
79234
|
+
[DeviceType.Dishwasher]: {
|
|
79235
|
+
exported: true,
|
|
79236
|
+
as: received
|
|
79237
|
+
}
|
|
79238
|
+
};
|
|
79239
|
+
}
|
|
79240
|
+
var APPLIANCE_EXPORT = {
|
|
79241
|
+
ha: offered(HA_AS),
|
|
79242
|
+
homekit: withheld(HOMEKIT_REASON),
|
|
79243
|
+
alexa: withheld(ALEXA_REASON),
|
|
79244
|
+
google: withheld(GOOGLE_REASON),
|
|
79245
|
+
matter: withheld(MATTER_REASON)
|
|
79246
|
+
};
|
|
79247
|
+
function isPlugApplianceType(deviceType) {
|
|
79248
|
+
return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
|
|
79249
|
+
}
|
|
79250
|
+
/** The decision for this ecosystem, or null when the type is not an appliance. */
|
|
79251
|
+
function applianceExport(ecosystem, deviceType) {
|
|
79252
|
+
if (!isPlugApplianceType(deviceType)) return null;
|
|
79253
|
+
return APPLIANCE_EXPORT[ecosystem][deviceType];
|
|
79254
|
+
}
|
|
79125
79255
|
Object.freeze({
|
|
79126
79256
|
"accessories.getStatus": [{
|
|
79127
79257
|
name: "deviceId",
|
|
@@ -83490,8 +83620,9 @@ function traitForCommand(capNames, command) {
|
|
|
83490
83620
|
* (`SUPPORTED_DEVICE_KINDS` in `ha-export.addon.ts`) and it is what kept the
|
|
83491
83621
|
* previous exporter confined to cameras. `DeviceType` is consulted for exactly
|
|
83492
83622
|
* one thing here — picking between two Google types that carry the SAME traits
|
|
83493
|
-
* (a LIGHT and a SWITCH are both OnOff)
|
|
83494
|
-
*
|
|
83623
|
+
* (a LIGHT and a SWITCH are both OnOff). A washer, dryer or dishwasher is
|
|
83624
|
+
* withheld even when some other trait would match: Google's laundry types
|
|
83625
|
+
* require RunCycle, and this export does not publish that trait.
|
|
83495
83626
|
*/
|
|
83496
83627
|
var MANUFACTURER = "CamStack";
|
|
83497
83628
|
/**
|
|
@@ -83507,6 +83638,8 @@ var MANUFACTURER = "CamStack";
|
|
|
83507
83638
|
* A SECURITYSYSTEM would promise `ArmDisarm`, which nothing here answers.
|
|
83508
83639
|
*/
|
|
83509
83640
|
function resolveGoogleDeviceType(deviceType, traits) {
|
|
83641
|
+
const withheld = applianceExport("google", deviceType);
|
|
83642
|
+
if (withheld !== null && !withheld.exported) return null;
|
|
83510
83643
|
if (traits.includes("action.devices.traits.LockUnlock")) return "action.devices.types.LOCK";
|
|
83511
83644
|
if (traits.includes("action.devices.traits.OpenClose")) return "action.devices.types.SHUTTER";
|
|
83512
83645
|
if (!traits.includes("action.devices.traits.OnOff") && !traits.includes("action.devices.traits.Brightness")) return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-export-google",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.115",
|
|
4
4
|
"description": "Google Home export — hub-side smart-home fulfillment (SYNC / QUERY / EXECUTE / DISCONNECT) for the non-camera fleet, served over the hub's own OAuth account link. No Google credential is stored, sent or required.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|