@camstack/addon-export-hap 1.2.182 → 1.2.183

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.
@@ -10495,7 +10495,7 @@ object({
10495
10495
  params: record(string(), union([string(), number()])).optional()
10496
10496
  });
10497
10497
  //#endregion
10498
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10498
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10499
10499
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10500
10500
  DeviceType["Camera"] = "camera";
10501
10501
  DeviceType["Hub"] = "hub";
@@ -10589,8 +10589,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10589
10589
  DeviceType["PetFeeder"] = "pet-feeder";
10590
10590
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10591
10591
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10592
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10592
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10593
+ * A plug-built dishwasher carries running-state and power instead. */
10593
10594
  DeviceType["Dishwasher"] = "dishwasher";
10595
+ /** Washing machine. A plug-built one is running while its power stays
10596
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10597
+ DeviceType["Washer"] = "washer";
10598
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10599
+ DeviceType["Dryer"] = "dryer";
10594
10600
  return DeviceType;
10595
10601
  }({});
10596
10602
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10848,7 +10854,7 @@ function errMsg$16(err) {
10848
10854
  return String(err);
10849
10855
  }
10850
10856
  //#endregion
10851
- //#region ../types/dist/composition-OhpuespA.mjs
10857
+ //#region ../types/dist/composition-B2rw5L29.mjs
10852
10858
  var AUDIO_ENCODER_BY_CODEC = {
10853
10859
  opus: "libopus",
10854
10860
  aac: "aac",
@@ -12199,6 +12205,26 @@ function validateExpressionSource(src) {
12199
12205
  return null;
12200
12206
  }
12201
12207
  /**
12208
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
12209
+ *
12210
+ * Standby of the control board is under 5 W; a motor or a heater is far
12211
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
12212
+ * a cycle, so running starts only after 30 s above the line.
12213
+ *
12214
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
12215
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
12216
+ * report "finished" in the middle of the program, so the stop dwell is
12217
+ * 10 minutes on every type. The number is stored per type so one machine
12218
+ * can move later without moving the others.
12219
+ */
12220
+ var APPLIANCE_TEMPLATE_ID = "appliance";
12221
+ var APPLIANCE_KINDS = [
12222
+ "washer",
12223
+ "dryer",
12224
+ "dishwasher"
12225
+ ];
12226
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12227
+ /**
12202
12228
  * A composition source identity: `(addonId, stableId)`, never a numeric device
12203
12229
  * id. Split out so helper schemas can name it without a cycle through
12204
12230
  * `composition.ts` (D659).
@@ -12261,6 +12287,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
12261
12287
  members: array(HelperMemberSchema).min(1).max(64),
12262
12288
  /** Actuator groups only. Readings leave this unset. */
12263
12289
  active: ActiveCriterionSchema.optional()
12290
+ }), object({
12291
+ kind: literal("appliance"),
12292
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
12293
+ appliance: _enum(APPLIANCE_KINDS),
12294
+ thresholdWatts: number().positive(),
12295
+ startDwellMs: number().int().nonnegative(),
12296
+ stopDwellMs: number().int().nonnegative(),
12297
+ member: HelperMemberSchema
12264
12298
  })]);
12265
12299
  /** A composed device's stableId is this prefix plus the block id. */
12266
12300
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
@@ -62240,7 +62274,7 @@ object({
62240
62274
  /** Ms epoch when the slice was last updated. */
62241
62275
  lastFetchedAt: number()
62242
62276
  });
62243
- DeviceType.Sensor;
62277
+ DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
62244
62278
  /**
62245
62279
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
62246
62280
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -62687,7 +62721,7 @@ object({
62687
62721
  phase: string().nullable()
62688
62722
  });
62689
62723
  Object.values(DeviceType);
62690
- DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
62724
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
62691
62725
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
62692
62726
  kind: "mutation",
62693
62727
  auth: "admin"
@@ -66440,7 +66474,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
66440
66474
  auth: "admin"
66441
66475
  });
66442
66476
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
66443
- 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;
66477
+ 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;
66444
66478
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
66445
66479
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
66446
66480
  new Set(CAP_NAMES);
@@ -66493,7 +66527,7 @@ var AccessoryKind = {
66493
66527
  PrivacyMask: DeviceRole.PrivacyMask
66494
66528
  };
66495
66529
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
66496
- 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;
66530
+ 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;
66497
66531
  new Set(Object.values(DeviceType));
66498
66532
  Object.freeze({
66499
66533
  "accessories.getStatus": {
@@ -78780,7 +78814,39 @@ var APPLIANCE_CAP_VOCABULARY = {
78780
78814
  phrase: t("When {device} finishes", "Quando {device} finisce"),
78781
78815
  icon: "square"
78782
78816
  }
78783
- }
78817
+ },
78818
+ overrides: { byType: {
78819
+ [DeviceType.Washer]: {
78820
+ state: { running: {
78821
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
78822
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
78823
+ } },
78824
+ events: {
78825
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
78826
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
78827
+ }
78828
+ },
78829
+ [DeviceType.Dryer]: {
78830
+ state: { running: {
78831
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
78832
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
78833
+ } },
78834
+ events: {
78835
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
78836
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
78837
+ }
78838
+ },
78839
+ [DeviceType.Dishwasher]: {
78840
+ state: { running: {
78841
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
78842
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
78843
+ } },
78844
+ events: {
78845
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
78846
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
78847
+ }
78848
+ }
78849
+ } }
78784
78850
  },
78785
78851
  update: {
78786
78852
  scope: "device",
@@ -80080,8 +80146,72 @@ function projectAction(cap, action) {
80080
80146
  };
80081
80147
  }
80082
80148
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
80083
- 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;
80149
+ 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;
80084
80150
  DeviceFeature.BatteryOperated;
80151
+ /**
80152
+ * How a washer, dryer or dishwasher leaves CamStack.
80153
+ *
80154
+ * Home Assistant has no laundry domain: the device is offered, and what
80155
+ * travels is its power reading. The others have a laundry type that this
80156
+ * export cannot honour yet, so they are named and withheld.
80157
+ */
80158
+ var PLUG_APPLIANCE_TYPES = [
80159
+ DeviceType.Washer,
80160
+ DeviceType.Dryer,
80161
+ DeviceType.Dishwasher
80162
+ ];
80163
+ 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.";
80164
+ 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.";
80165
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
80166
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
80167
+ 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.";
80168
+ function withheld(reason) {
80169
+ return {
80170
+ [DeviceType.Washer]: {
80171
+ exported: false,
80172
+ reason
80173
+ },
80174
+ [DeviceType.Dryer]: {
80175
+ exported: false,
80176
+ reason
80177
+ },
80178
+ [DeviceType.Dishwasher]: {
80179
+ exported: false,
80180
+ reason
80181
+ }
80182
+ };
80183
+ }
80184
+ function offered(received) {
80185
+ return {
80186
+ [DeviceType.Washer]: {
80187
+ exported: true,
80188
+ as: received
80189
+ },
80190
+ [DeviceType.Dryer]: {
80191
+ exported: true,
80192
+ as: received
80193
+ },
80194
+ [DeviceType.Dishwasher]: {
80195
+ exported: true,
80196
+ as: received
80197
+ }
80198
+ };
80199
+ }
80200
+ var APPLIANCE_EXPORT = {
80201
+ ha: offered(HA_AS),
80202
+ homekit: withheld(HOMEKIT_REASON),
80203
+ alexa: withheld(ALEXA_REASON),
80204
+ google: withheld(GOOGLE_REASON),
80205
+ matter: withheld(MATTER_REASON)
80206
+ };
80207
+ function isPlugApplianceType(deviceType) {
80208
+ return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
80209
+ }
80210
+ /** The decision for this ecosystem, or null when the type is not an appliance. */
80211
+ function applianceExport(ecosystem, deviceType) {
80212
+ if (!isPlugApplianceType(deviceType)) return null;
80213
+ return APPLIANCE_EXPORT[ecosystem][deviceType];
80214
+ }
80085
80215
  Object.freeze({
80086
80216
  "accessories.getStatus": [{
80087
80217
  name: "deviceId",
@@ -149367,6 +149497,8 @@ var HAP_EXPORTABLE_DEVICE_TYPES = [
149367
149497
  function pickMapperKind(deviceType) {
149368
149498
  if (deviceType === null || deviceType === void 0 || deviceType.length === 0) return "camera";
149369
149499
  if (deviceType === DeviceType.Camera) return "camera";
149500
+ const withheld = applianceExport("homekit", deviceType);
149501
+ if (withheld !== null && !withheld.exported) return null;
149370
149502
  return HAP_EXPORTABLE_DEVICE_TYPES.find((type) => type === deviceType) === void 0 ? null : "generic";
149371
149503
  }
149372
149504
  /**
@@ -10485,7 +10485,7 @@ object({
10485
10485
  params: record(string(), union([string(), number()])).optional()
10486
10486
  });
10487
10487
  //#endregion
10488
- //#region ../types/dist/err-msg-BXKzRBwg.mjs
10488
+ //#region ../types/dist/err-msg-DIorGYeC.mjs
10489
10489
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
10490
10490
  DeviceType["Camera"] = "camera";
10491
10491
  DeviceType["Hub"] = "hub";
@@ -10579,8 +10579,14 @@ var DeviceType = /* @__PURE__ */ function(DeviceType) {
10579
10579
  DeviceType["PetFeeder"] = "pet-feeder";
10580
10580
  /** Built-in dishwasher — program lifecycle, door / remote-start gates,
10581
10581
  * salt and rinse-aid levels. Installed with the `dishwasher` cap.
10582
- * Sources: native Bosch Home Connect, reusable by similar integrations. */
10582
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
10583
+ * A plug-built dishwasher carries running-state and power instead. */
10583
10584
  DeviceType["Dishwasher"] = "dishwasher";
10585
+ /** Washing machine. A plug-built one is running while its power stays
10586
+ * above a threshold. No program cap — that surface is the dishwasher's. */
10587
+ DeviceType["Washer"] = "washer";
10588
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
10589
+ DeviceType["Dryer"] = "dryer";
10584
10590
  return DeviceType;
10585
10591
  }({});
10586
10592
  var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
@@ -10838,7 +10844,7 @@ function errMsg$16(err) {
10838
10844
  return String(err);
10839
10845
  }
10840
10846
  //#endregion
10841
- //#region ../types/dist/composition-OhpuespA.mjs
10847
+ //#region ../types/dist/composition-B2rw5L29.mjs
10842
10848
  var AUDIO_ENCODER_BY_CODEC = {
10843
10849
  opus: "libopus",
10844
10850
  aac: "aac",
@@ -12189,6 +12195,26 @@ function validateExpressionSource(src) {
12189
12195
  return null;
12190
12196
  }
12191
12197
  /**
12198
+ * One power reading becomes a washer, dryer or dishwasher (D944 helper).
12199
+ *
12200
+ * Standby of the control board is under 5 W; a motor or a heater is far
12201
+ * above that, so 5 W is the line. A door lock or a short pump spike is not
12202
+ * a cycle, so running starts only after 30 s above the line.
12203
+ *
12204
+ * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
12205
+ * bursts) lasts several minutes. Ending the cycle on the first dip would
12206
+ * report "finished" in the middle of the program, so the stop dwell is
12207
+ * 10 minutes on every type. The number is stored per type so one machine
12208
+ * can move later without moving the others.
12209
+ */
12210
+ var APPLIANCE_TEMPLATE_ID = "appliance";
12211
+ var APPLIANCE_KINDS = [
12212
+ "washer",
12213
+ "dryer",
12214
+ "dishwasher"
12215
+ ];
12216
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12217
+ /**
12192
12218
  * A composition source identity: `(addonId, stableId)`, never a numeric device
12193
12219
  * id. Split out so helper schemas can name it without a cycle through
12194
12220
  * `composition.ts` (D659).
@@ -12251,6 +12277,14 @@ var HelperSpecSchema = discriminatedUnion("kind", [object({
12251
12277
  members: array(HelperMemberSchema).min(1).max(64),
12252
12278
  /** Actuator groups only. Readings leave this unset. */
12253
12279
  active: ActiveCriterionSchema.optional()
12280
+ }), object({
12281
+ kind: literal("appliance"),
12282
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
12283
+ appliance: _enum(APPLIANCE_KINDS),
12284
+ thresholdWatts: number().positive(),
12285
+ startDwellMs: number().int().nonnegative(),
12286
+ stopDwellMs: number().int().nonnegative(),
12287
+ member: HelperMemberSchema
12254
12288
  })]);
12255
12289
  /** A composed device's stableId is this prefix plus the block id. */
12256
12290
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
@@ -62230,7 +62264,7 @@ object({
62230
62264
  /** Ms epoch when the slice was last updated. */
62231
62265
  lastFetchedAt: number()
62232
62266
  });
62233
- DeviceType.Sensor;
62267
+ DeviceType.Sensor, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
62234
62268
  /**
62235
62269
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
62236
62270
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -62677,7 +62711,7 @@ object({
62677
62711
  phase: string().nullable()
62678
62712
  });
62679
62713
  Object.values(DeviceType);
62680
- DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
62714
+ DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
62681
62715
  DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceId: number().int().nonnegative() }), object({ success: literal(true) }), {
62682
62716
  kind: "mutation",
62683
62717
  auth: "admin"
@@ -66430,7 +66464,7 @@ method(object({}), array(TrainingBaseModelSchema).readonly(), { auth: "admin" })
66430
66464
  auth: "admin"
66431
66465
  });
66432
66466
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
66433
- 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;
66467
+ 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;
66434
66468
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
66435
66469
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
66436
66470
  new Set(CAP_NAMES);
@@ -66483,7 +66517,7 @@ var AccessoryKind = {
66483
66517
  PrivacyMask: DeviceRole.PrivacyMask
66484
66518
  };
66485
66519
  AccessoryKind.Siren, AccessoryKind.Floodlight, AccessoryKind.Spotlight, AccessoryKind.PirSensor, AccessoryKind.Chime, AccessoryKind.Autotrack, AccessoryKind.Nightvision, AccessoryKind.PrivacyMask;
66486
- 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;
66520
+ 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;
66487
66521
  new Set(Object.values(DeviceType));
66488
66522
  Object.freeze({
66489
66523
  "accessories.getStatus": {
@@ -78770,7 +78804,39 @@ var APPLIANCE_CAP_VOCABULARY = {
78770
78804
  phrase: t("When {device} finishes", "Quando {device} finisce"),
78771
78805
  icon: "square"
78772
78806
  }
78773
- }
78807
+ },
78808
+ overrides: { byType: {
78809
+ [DeviceType.Washer]: {
78810
+ state: { running: {
78811
+ whenTrue: t("When the washing machine starts", "Quando la lavatrice inizia"),
78812
+ whenFalse: t("When the washing machine has finished", "Quando la lavatrice ha finito")
78813
+ } },
78814
+ events: {
78815
+ onStarted: { phrase: t("When the washing machine starts", "Quando la lavatrice inizia") },
78816
+ onFinished: { phrase: t("When the washing machine has finished", "Quando la lavatrice ha finito") }
78817
+ }
78818
+ },
78819
+ [DeviceType.Dryer]: {
78820
+ state: { running: {
78821
+ whenTrue: t("When the dryer starts", "Quando l'asciugatrice inizia"),
78822
+ whenFalse: t("When the dryer has finished", "Quando l'asciugatrice ha finito")
78823
+ } },
78824
+ events: {
78825
+ onStarted: { phrase: t("When the dryer starts", "Quando l'asciugatrice inizia") },
78826
+ onFinished: { phrase: t("When the dryer has finished", "Quando l'asciugatrice ha finito") }
78827
+ }
78828
+ },
78829
+ [DeviceType.Dishwasher]: {
78830
+ state: { running: {
78831
+ whenTrue: t("When the dishwasher starts", "Quando la lavastoviglie inizia"),
78832
+ whenFalse: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito")
78833
+ } },
78834
+ events: {
78835
+ onStarted: { phrase: t("When the dishwasher starts", "Quando la lavastoviglie inizia") },
78836
+ onFinished: { phrase: t("When the dishwasher has finished", "Quando la lavastoviglie ha finito") }
78837
+ }
78838
+ }
78839
+ } }
78774
78840
  },
78775
78841
  update: {
78776
78842
  scope: "device",
@@ -80070,8 +80136,72 @@ function projectAction(cap, action) {
80070
80136
  };
80071
80137
  }
80072
80138
  Object.entries(CAP_VOCABULARY_BY_NAME).flatMap(([cap, entry]) => entry.scope === "device" ? (entry.actions ?? []).map((a) => projectAction(cap, a)) : []);
80073
- 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;
80139
+ 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;
80074
80140
  DeviceFeature.BatteryOperated;
80141
+ /**
80142
+ * How a washer, dryer or dishwasher leaves CamStack.
80143
+ *
80144
+ * Home Assistant has no laundry domain: the device is offered, and what
80145
+ * travels is its power reading. The others have a laundry type that this
80146
+ * export cannot honour yet, so they are named and withheld.
80147
+ */
80148
+ var PLUG_APPLIANCE_TYPES = [
80149
+ DeviceType.Washer,
80150
+ DeviceType.Dryer,
80151
+ DeviceType.Dishwasher
80152
+ ];
80153
+ 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.";
80154
+ 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.";
80155
+ var ALEXA_REASON = "Alexa has no laundry category in this export, and neither power nor running has an Alexa interface.";
80156
+ var GOOGLE_REASON = "Google WASHER, DRYER and DISHWASHER require RunCycle. A power threshold is not that trait, and this export does not publish RunCycle.";
80157
+ 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.";
80158
+ function withheld(reason) {
80159
+ return {
80160
+ [DeviceType.Washer]: {
80161
+ exported: false,
80162
+ reason
80163
+ },
80164
+ [DeviceType.Dryer]: {
80165
+ exported: false,
80166
+ reason
80167
+ },
80168
+ [DeviceType.Dishwasher]: {
80169
+ exported: false,
80170
+ reason
80171
+ }
80172
+ };
80173
+ }
80174
+ function offered(received) {
80175
+ return {
80176
+ [DeviceType.Washer]: {
80177
+ exported: true,
80178
+ as: received
80179
+ },
80180
+ [DeviceType.Dryer]: {
80181
+ exported: true,
80182
+ as: received
80183
+ },
80184
+ [DeviceType.Dishwasher]: {
80185
+ exported: true,
80186
+ as: received
80187
+ }
80188
+ };
80189
+ }
80190
+ var APPLIANCE_EXPORT = {
80191
+ ha: offered(HA_AS),
80192
+ homekit: withheld(HOMEKIT_REASON),
80193
+ alexa: withheld(ALEXA_REASON),
80194
+ google: withheld(GOOGLE_REASON),
80195
+ matter: withheld(MATTER_REASON)
80196
+ };
80197
+ function isPlugApplianceType(deviceType) {
80198
+ return PLUG_APPLIANCE_TYPES.some((type) => type === deviceType);
80199
+ }
80200
+ /** The decision for this ecosystem, or null when the type is not an appliance. */
80201
+ function applianceExport(ecosystem, deviceType) {
80202
+ if (!isPlugApplianceType(deviceType)) return null;
80203
+ return APPLIANCE_EXPORT[ecosystem][deviceType];
80204
+ }
80075
80205
  Object.freeze({
80076
80206
  "accessories.getStatus": [{
80077
80207
  name: "deviceId",
@@ -149357,6 +149487,8 @@ var HAP_EXPORTABLE_DEVICE_TYPES = [
149357
149487
  function pickMapperKind(deviceType) {
149358
149488
  if (deviceType === null || deviceType === void 0 || deviceType.length === 0) return "camera";
149359
149489
  if (deviceType === DeviceType.Camera) return "camera";
149490
+ const withheld = applianceExport("homekit", deviceType);
149491
+ if (withheld !== null && !withheld.exported) return null;
149360
149492
  return HAP_EXPORTABLE_DEVICE_TYPES.find((type) => type === deviceType) === void 0 ? null : "generic";
149361
149493
  }
149362
149494
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-hap",
3
- "version": "1.2.182",
3
+ "version": "1.2.183",
4
4
  "description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
5
5
  "keywords": [
6
6
  "camstack",