@camstack/addon-provider-bosch 0.1.16 → 0.1.18

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.
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BUFPeAeI.js");
1
+ const require_dist = require("./dist-8MDf5Iki.js");
2
2
  //#region src/shared/oauth-callback.ts
3
3
  /** A code on its own: no scheme, no query, no separators. */
4
4
  var BARE_CODE = /^[A-Za-z0-9._~-]+$/;
@@ -1,4 +1,4 @@
1
- import { b as errMsg } from "./dist-PdvgOyAy.mjs";
1
+ import { x as errMsg } from "./dist-Cj3fyC1J.mjs";
2
2
  //#region src/shared/oauth-callback.ts
3
3
  /** A code on its own: no scheme, no query, no separators. */
4
4
  var BARE_CODE = /^[A-Za-z0-9._~-]+$/;
@@ -5431,7 +5431,7 @@ var ZodIssueCode = {
5431
5431
  var ZodFirstPartyTypeKind;
5432
5432
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5433
5433
  //#endregion
5434
- //#region ../types/dist/sleep-DJFUfKvA.mjs
5434
+ //#region ../types/dist/sleep-CUp20JkO.mjs
5435
5435
  /**
5436
5436
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5437
5437
  * window to float samples (D455).
@@ -8327,7 +8327,11 @@ var ContributionSectionSchema = object({
8327
8327
  literal(4)
8328
8328
  ]).optional(),
8329
8329
  tab: string().optional(),
8330
- location: _enum(["settings", "top-tab"]).optional(),
8330
+ location: _enum([
8331
+ "settings",
8332
+ "top-tab",
8333
+ "hero"
8334
+ ]).optional(),
8331
8335
  order: number().optional(),
8332
8336
  fields: array(any())
8333
8337
  });
@@ -13282,7 +13286,11 @@ var ConfigSectionWithValuesSchema = object({
13282
13286
  literal(4)
13283
13287
  ]).optional(),
13284
13288
  tab: string().optional(),
13285
- location: _enum(["settings", "top-tab"]).optional(),
13289
+ location: _enum([
13290
+ "settings",
13291
+ "top-tab",
13292
+ "hero"
13293
+ ]).optional(),
13286
13294
  order: number().optional(),
13287
13295
  fields: array(any())
13288
13296
  });
@@ -17162,6 +17170,52 @@ var TierStatusSchema = object({
17162
17170
  countedAt: number().nullable()
17163
17171
  });
17164
17172
  /** Operator/diagnostic view: rows per tier, last runs, refusals and drops since boot. */
17173
+ /**
17174
+ * Why a series is orphan. `device-gone`: its device is absent from the
17175
+ * successful device listings (the departure clock). `undeclared`: its `cap:`
17176
+ * key is declared by no capability any more (a field a cap removed).
17177
+ */
17178
+ var DeviceHistoryOrphanReasonSchema = _enum(["device-gone", "undeclared"]);
17179
+ /** Rows held per stored tier. */
17180
+ var TierRowsSchema = object({
17181
+ raw: number().int(),
17182
+ "5m": number().int(),
17183
+ "1h": number().int(),
17184
+ "1d": number().int()
17185
+ });
17186
+ var OrphanSeriesSchema = object({
17187
+ seriesId: number().int(),
17188
+ deviceId: number().int(),
17189
+ key: string(),
17190
+ scope: string(),
17191
+ /** The metric's display name; `null` when its metric row is gone too. */
17192
+ displayName: string().nullable(),
17193
+ reason: DeviceHistoryOrphanReasonSchema,
17194
+ /** `device-gone`: since when the device has been absent; `null` otherwise. */
17195
+ missingSince: number().nullable(),
17196
+ firstTs: number(),
17197
+ lastTs: number(),
17198
+ rows: TierRowsSchema
17199
+ });
17200
+ var DeviceHistoryOrphanDeleteRefusalSchema = _enum([
17201
+ "not-found",
17202
+ "not-orphan",
17203
+ "failed"
17204
+ ]);
17205
+ var OrphanDeleteEntrySchema = discriminatedUnion("ok", [object({
17206
+ seriesId: number().int(),
17207
+ ok: literal(true),
17208
+ deleted: TierRowsSchema
17209
+ }), object({
17210
+ seriesId: number().int(),
17211
+ ok: literal(false),
17212
+ reason: DeviceHistoryOrphanDeleteRefusalSchema
17213
+ })]);
17214
+ var OrphanListSchema = object({
17215
+ series: array(OrphanSeriesSchema).readonly(),
17216
+ /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
17217
+ truncated: boolean()
17218
+ });
17165
17219
  var DeviceHistoryStatusSchema = object({
17166
17220
  startedAt: number(),
17167
17221
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -17259,7 +17313,10 @@ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly())
17259
17313
  }), object({ enabled: boolean() }), {
17260
17314
  kind: "mutation",
17261
17315
  auth: "admin"
17262
- }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" });
17316
+ }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
17317
+ kind: "mutation",
17318
+ auth: "admin"
17319
+ });
17263
17320
  var DeviceCaStatusSchema = discriminatedUnion("state", [
17264
17321
  object({ state: literal("absent") }),
17265
17322
  object({
@@ -47987,7 +48044,6 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
47987
48044
  modelId: string()
47988
48045
  }),
47989
48046
  object({ kind: literal("cpu-device") }),
47990
- object({ kind: literal("coral-untouched") }),
47991
48047
  object({ kind: literal("device-disabled") }),
47992
48048
  object({ kind: literal("device-unavailable") }),
47993
48049
  object({ kind: literal("node-offline") }),
@@ -48085,11 +48141,6 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
48085
48141
  kind: literal("detector-store-unreadable"),
48086
48142
  error: string()
48087
48143
  }),
48088
- object({
48089
- kind: literal("coral-enabled"),
48090
- nodeId: string(),
48091
- deviceKey: string()
48092
- }),
48093
48144
  object({
48094
48145
  kind: literal("custom-pin-kept"),
48095
48146
  nodeId: string(),
@@ -55133,17 +55184,69 @@ var connectivityCapability = {
55133
55184
  volatileStateFields: ["lastChangedAt"]
55134
55185
  };
55135
55186
  /**
55136
- * Generic device-consumables capability — surfaces a device's
55137
- * maintenance items (vacuum filters/brushes, replaceable cartridges,
55138
- * descaling cycles, …) with their remaining life and an optional
55139
- * "Replaced" reset action. Device-agnostic: any provider that knows its
55140
- * device tracks consumables can register it; the cap declares no
55141
- * vocabulary of its own — the provider names each item verbatim.
55187
+ * Generic device-consumables capability — the ONE place a device reports what
55188
+ * it uses up or fills: wear parts (vacuum filters/brushes, cartridges,
55189
+ * descaling cycles), supplies it draws from (a vacuum's clean-water tank and
55190
+ * detergent, a dishwasher's salt and rinse aid) and waste it collects (a dirty
55191
+ * water tank, a dust bin). Each item carries its remaining life or fill and an
55192
+ * optional "Replaced" reset action. Device-agnostic: any provider that knows
55193
+ * its device tracks consumables registers it; the provider names each item
55194
+ * verbatim and says which `kind` it is.
55195
+ *
55196
+ * The admin UI renders it as ONE collapsible section directly under the
55197
+ * device page's hero card (`placement: 'hero'`), for every device bound to
55198
+ * this cap — never drawn by a device type's hero card itself (D915).
55142
55199
  *
55143
55200
  * Like `childLayout`, the cap is INERT until a provider sets items: no
55144
55201
  * provider populates it by guessing (no HA inference). The UI renders a
55145
55202
  * "No consumables reported" placeholder when `items` is empty.
55146
55203
  */
55204
+ /**
55205
+ * What an item IS, which decides which direction is bad:
55206
+ * - `wear` — a part that wears out (a brush, a filter); low life is bad.
55207
+ * - `supply` — something the device draws from (clean water, detergent,
55208
+ * salt, rinse aid); low or empty is bad.
55209
+ * - `waste` — something the device fills (dirty water, a dust bin); full is
55210
+ * bad.
55211
+ * Absent = `wear`.
55212
+ */
55213
+ var ConsumableKindSchema = _enum([
55214
+ "wear",
55215
+ "supply",
55216
+ "waste"
55217
+ ]);
55218
+ /**
55219
+ * What an item LOOKS like, which decides how a client draws it — independent
55220
+ * of `kind`, which decides which direction is bad:
55221
+ * - `part` — a part that wears (a brush, a filter, a mop pad): a wear bar,
55222
+ * remaining time and a reset.
55223
+ * - `tank` — a container of liquid (clean water, dirty water): a fill gauge.
55224
+ * - `product` — something bought and refilled (detergent, salt, rinse aid):
55225
+ * a stepped level and "refill".
55226
+ * - `bin` — a container that collects waste (a dust bin): a fill gauge
55227
+ * that warns when full.
55228
+ * Absent = derived from the kind ({@link consumableFormOf}).
55229
+ */
55230
+ var ConsumableFormSchema = _enum([
55231
+ "part",
55232
+ "tank",
55233
+ "product",
55234
+ "bin"
55235
+ ]);
55236
+ /** The provider's own discrete verdict on an item. */
55237
+ var ConsumableStatusSchema = _enum([
55238
+ "ok",
55239
+ "low",
55240
+ "empty",
55241
+ "full",
55242
+ "replace"
55243
+ ]);
55244
+ _enum([
55245
+ "ok",
55246
+ "low",
55247
+ "empty",
55248
+ "full"
55249
+ ]);
55147
55250
  /** Units a remaining-life counter is reported in. Closed: the panel renders
55148
55251
  * each. */
55149
55252
  var ConsumableRemainingUnitSchema = _enum([
@@ -55158,18 +55261,23 @@ var ConsumableRemainingSchema = object({
55158
55261
  unit: ConsumableRemainingUnitSchema
55159
55262
  });
55160
55263
  /** A single consumable item. Either a continuous `level` (remaining
55161
- * life %) or a discrete `status` may be known — both may be null when a
55162
- * provider only knows the item exists. `level` and `status` are not
55163
- * mutually exclusive; a provider may report both. */
55264
+ * life %, or fill % for a `supply` / `waste` item) or a discrete `status`
55265
+ * may be known — both may be null when a provider only knows the item
55266
+ * exists. `level` and `status` are not mutually exclusive; a provider may
55267
+ * report both. */
55164
55268
  var ConsumableItemSchema = object({
55165
55269
  /** Stable id, e.g. 'main-brush'. */
55166
55270
  key: string().min(1),
55167
55271
  /** Display name. */
55168
55272
  label: string().min(1),
55169
- /** Remaining life % when known (0..100). */
55273
+ /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
55170
55274
  level: number().min(0).max(100).nullable(),
55171
- /** Discrete state when known (binary mode). */
55172
- status: _enum(["ok", "replace"]).nullable(),
55275
+ /** The provider's discrete verdict when known (binary mode). */
55276
+ status: ConsumableStatusSchema.nullable(),
55277
+ /** What the item is — decides whether low or full is bad. Absent = `wear`. */
55278
+ kind: ConsumableKindSchema.optional(),
55279
+ /** How the item is drawn (part, tank, product, bin). Absent = derived from `kind`. */
55280
+ form: ConsumableFormSchema.optional(),
55173
55281
  /** Ms epoch of the last replace, when known. */
55174
55282
  lastResetAt: number().nullable(),
55175
55283
  /** Whether `reset()` is meaningful for this item. */
@@ -55192,7 +55300,7 @@ var consumablesCapability = {
55192
55300
  kind: "widget",
55193
55301
  widgetId: "host/consumables-panel",
55194
55302
  tab: "consumables",
55195
- topTab: true,
55303
+ placement: "hero",
55196
55304
  label: "Consumables",
55197
55305
  order: 5
55198
55306
  } },
@@ -55253,9 +55361,37 @@ reset: method(object({
55253
55361
  */
55254
55362
  durability: "restored",
55255
55363
  /**
55256
- * History (D850): none — `items` is an array keyed by runtime ids; a history path never enters it.
55364
+ * History (D850, D917): one series per (item field, item `key`) — the item key
55365
+ * is the series scope, the item `label` names it. A vacuum tank's fill, a
55366
+ * brush's remaining life and a dishwasher's salt are each recorded the moment
55367
+ * their provider reports them; an item that appears later gets its series.
55257
55368
  */
55258
- history: "none",
55369
+ history: {
55370
+ fields: {},
55371
+ items: {
55372
+ path: "items",
55373
+ key: "key",
55374
+ label: "label",
55375
+ fields: {
55376
+ level: {
55377
+ kind: "gauge",
55378
+ unit: "%",
55379
+ deadband: 2,
55380
+ displayName: "Level"
55381
+ },
55382
+ status: {
55383
+ kind: "enum",
55384
+ displayName: "Status"
55385
+ },
55386
+ "remaining.value": {
55387
+ kind: "gauge",
55388
+ unitFrom: "remaining.unit",
55389
+ deadband: 1,
55390
+ displayName: "Remaining"
55391
+ }
55392
+ }
55393
+ }
55394
+ },
55259
55395
  /** Clocks, not content: a re-read that changed no item costs no commit. */
55260
55396
  volatileStateFields: ["lastChangedAt", "lastFetchedAt"]
55261
55397
  };
@@ -55670,8 +55806,9 @@ onStatusChanged: { data: object({
55670
55806
  volatileStateFields: ["lastChangedAt"]
55671
55807
  };
55672
55808
  /**
55673
- * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55674
- * consumable levels (salt, rinse aid) and common program options.
55809
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates and
55810
+ * common program options. Salt and rinse aid are NOT here: they are items of
55811
+ * the device's `consumables` cap, like every other device's (D915).
55675
55812
  *
55676
55813
  * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55677
55814
  * by any integration that exposes the same program / option surface.
@@ -55719,11 +55856,6 @@ var DishwasherAvailabilitySchema = _enum([
55719
55856
  "offline",
55720
55857
  "description-missing"
55721
55858
  ]);
55722
- var DishwasherConsumableLevelSchema = _enum([
55723
- "ok",
55724
- "low",
55725
- "empty"
55726
- ]);
55727
55859
  var DishwasherStatusSchema = object({
55728
55860
  availability: DishwasherAvailabilitySchema,
55729
55861
  /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
@@ -55756,8 +55888,6 @@ var DishwasherStatusSchema = object({
55756
55888
  powerOn: boolean().nullable(),
55757
55889
  /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55758
55890
  powerState: string().nullable(),
55759
- saltLevel: DishwasherConsumableLevelSchema.nullable(),
55760
- rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55761
55891
  /**
55762
55892
  * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
55763
55893
  * combined care-and-filter reminder raised); false when every such reminder reads clear; null
@@ -64573,60 +64703,17 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
64573
64703
  auth: "admin",
64574
64704
  access: "delete"
64575
64705
  });
64576
- /**
64577
- * Robot-vacuum cap. Models HA `vacuum.*` entities — anything with a
64578
- * cleaning lifecycle plus a return-to-base / locate surface and an
64579
- * optional fan-speed selector.
64580
- *
64581
- * State follows HA's canonical vacuum lifecycle: `idle` / `cleaning` /
64582
- * `paused` / `returning` / `docked` / `error`. `batteryLevel`
64583
- * (0..100) is nullable — some vacuums don't report a battery
64584
- * percentage. `fanSpeed` is the current speed token (provider-verbatim,
64585
- * e.g. `'standard'` / `'turbo'`) and `availableFanSpeeds` lists the
64586
- * tokens the hardware accepts so the UI renders only supported choices.
64587
- *
64588
- * The `setFanSpeed` method takes the bare `speed` token — the provider
64589
- * validates it against the vacuum's own list. `locate` triggers the
64590
- * find-me chirp; `returnToBase` sends it home.
64591
- *
64592
- * Consumable / waste tanks: `cleanWater` / `dirtyWater` / `detergent` /
64593
- * `dustBin` each carry a nullable `{ level (0..100 %), status ('ok' |
64594
- * 'low' | 'full') }` reading. Native providers (e.g. Dreame, Roborock)
64595
- * SHOULD populate whichever tanks the hardware has — leave a field `null`
64596
- * only when the device has no such tank at all, and use a `TankStatus`
64597
- * with both inner fields `null` when the tank exists but its level is
64598
- * currently unknown. HA `vacuum.*` entities expose no per-tank telemetry,
64599
- * so the HA provider leaves all four `null`.
64600
- */
64601
- var VacuumStateSchema = _enum([
64602
- "idle",
64603
- "cleaning",
64604
- "paused",
64605
- "returning",
64606
- "docked",
64607
- "drying",
64608
- "error"
64609
- ]);
64610
- /**
64611
- * One consumable / waste tank on a robot vacuum (clean-water, dirty-water,
64612
- * detergent or dust-bin). A tank can report a numeric fill `level` (0..100),
64613
- * a discrete `status` (binary-style hardware), or both. Both `null` means the
64614
- * level is currently unknown; the OWNING field being `null` means the
64615
- * hardware has no such tank at all.
64616
- */
64617
- var TankStatusSchema = object({
64618
- /** Numeric fill 0..100 when the hardware reports a percentage; null otherwise. */
64619
- level: number().min(0).max(100).nullable(),
64620
- /** Discrete state when the hardware is binary-mode; null otherwise. */
64621
- status: _enum([
64622
- "ok",
64623
- "low",
64624
- "full"
64625
- ]).nullable()
64626
- });
64627
64706
  var VacuumControlStatusSchema = object({
64628
64707
  /** Lifecycle state of the vacuum. */
64629
- state: VacuumStateSchema,
64708
+ state: _enum([
64709
+ "idle",
64710
+ "cleaning",
64711
+ "paused",
64712
+ "returning",
64713
+ "docked",
64714
+ "drying",
64715
+ "error"
64716
+ ]),
64630
64717
  /** 0..100 battery percentage. Null when the device has no battery
64631
64718
  * reading. */
64632
64719
  batteryLevel: number().min(0).max(100).nullable(),
@@ -64635,14 +64722,6 @@ var VacuumControlStatusSchema = object({
64635
64722
  fanSpeed: string().nullable(),
64636
64723
  /** Speed tokens the hardware accepts — drives the UI selector. */
64637
64724
  availableFanSpeeds: array(string()),
64638
- /** Clean-water (mop) tank. Null when the hardware has no clean-water tank. */
64639
- cleanWater: TankStatusSchema.nullable(),
64640
- /** Dirty-water (recovery) tank. Null when the hardware has no dirty-water tank. */
64641
- dirtyWater: TankStatusSchema.nullable(),
64642
- /** Detergent tank. Null when the hardware has no detergent tank. */
64643
- detergent: TankStatusSchema.nullable(),
64644
- /** Dust bin. Null when the hardware has no dust bin. */
64645
- dustBin: TankStatusSchema.nullable(),
64646
64725
  /** 0..100 cleaning-completion percentage of the current task, or null. */
64647
64726
  progressPercent: number().min(0).max(100).nullable(),
64648
64727
  /** Current error code (0 / null = no error). */
@@ -64704,35 +64783,14 @@ var vacuumControlCapability = {
64704
64783
  */
64705
64784
  durability: "session",
64706
64785
  /**
64707
- * History (D850): recorded series. Tank levels are fixed-object paths (`cleanWater.level`, ...).
64786
+ * History (D850): recorded series. The tanks moved to `consumables` (D915), whose
64787
+ * items are keyed by runtime ids and record no history.
64708
64788
  */
64709
- history: { fields: {
64710
- batteryLevel: {
64711
- kind: "gauge",
64712
- unit: "%",
64713
- deadband: 2
64714
- },
64715
- "cleanWater.level": {
64716
- kind: "gauge",
64717
- unit: "%",
64718
- deadband: 2
64719
- },
64720
- "dirtyWater.level": {
64721
- kind: "gauge",
64722
- unit: "%",
64723
- deadband: 2
64724
- },
64725
- "detergent.level": {
64726
- kind: "gauge",
64727
- unit: "%",
64728
- deadband: 2
64729
- },
64730
- "dustBin.level": {
64731
- kind: "gauge",
64732
- unit: "%",
64733
- deadband: 2
64734
- }
64735
- } }
64789
+ history: { fields: { batteryLevel: {
64790
+ kind: "gauge",
64791
+ unit: "%",
64792
+ deadband: 2
64793
+ } } }
64736
64794
  };
64737
64795
  var ValveStatusSchema = object({
64738
64796
  /** Lifecycle state of the valve. */
@@ -69126,6 +69184,12 @@ Object.freeze({
69126
69184
  addonId: null,
69127
69185
  access: "create"
69128
69186
  },
69187
+ "deviceHistory.deleteOrphanSeries": {
69188
+ capName: "device-history",
69189
+ capScope: "system",
69190
+ addonId: null,
69191
+ access: "delete"
69192
+ },
69129
69193
  "deviceHistory.getDeviceEnabled": {
69130
69194
  capName: "device-history",
69131
69195
  capScope: "system",
@@ -69144,6 +69208,12 @@ Object.freeze({
69144
69208
  addonId: null,
69145
69209
  access: "view"
69146
69210
  },
69211
+ "deviceHistory.listOrphanSeries": {
69212
+ capName: "device-history",
69213
+ capScope: "system",
69214
+ addonId: null,
69215
+ access: "view"
69216
+ },
69147
69217
  "deviceHistory.listSeries": {
69148
69218
  capName: "device-history",
69149
69219
  capScope: "system",
@@ -79149,7 +79219,7 @@ var STATE_SUMMARY_VARS = [
79149
79219
  ([...RULE_TEXT], [...COMBINED_ALARM]),
79150
79220
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
79151
79221
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
79152
- ([...RULE_TEXT], [...CONSUMABLE]),
79222
+ ([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
79153
79223
  ([...RULE_TEXT], [...TANK]),
79154
79224
  [...RULE_TEXT],
79155
79225
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
@@ -79919,6 +79989,12 @@ Object.defineProperty(exports, "connectionTestCapability", {
79919
79989
  return connectionTestCapability;
79920
79990
  }
79921
79991
  });
79992
+ Object.defineProperty(exports, "consumablesCapability", {
79993
+ enumerable: true,
79994
+ get: function() {
79995
+ return consumablesCapability;
79996
+ }
79997
+ });
79922
79998
  Object.defineProperty(exports, "createEvent", {
79923
79999
  enumerable: true,
79924
80000
  get: function() {
@@ -5431,7 +5431,7 @@ var ZodIssueCode = {
5431
5431
  var ZodFirstPartyTypeKind;
5432
5432
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5433
5433
  //#endregion
5434
- //#region ../types/dist/sleep-DJFUfKvA.mjs
5434
+ //#region ../types/dist/sleep-CUp20JkO.mjs
5435
5435
  /**
5436
5436
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5437
5437
  * window to float samples (D455).
@@ -8327,7 +8327,11 @@ var ContributionSectionSchema = object({
8327
8327
  literal(4)
8328
8328
  ]).optional(),
8329
8329
  tab: string().optional(),
8330
- location: _enum(["settings", "top-tab"]).optional(),
8330
+ location: _enum([
8331
+ "settings",
8332
+ "top-tab",
8333
+ "hero"
8334
+ ]).optional(),
8331
8335
  order: number().optional(),
8332
8336
  fields: array(any())
8333
8337
  });
@@ -13282,7 +13286,11 @@ var ConfigSectionWithValuesSchema = object({
13282
13286
  literal(4)
13283
13287
  ]).optional(),
13284
13288
  tab: string().optional(),
13285
- location: _enum(["settings", "top-tab"]).optional(),
13289
+ location: _enum([
13290
+ "settings",
13291
+ "top-tab",
13292
+ "hero"
13293
+ ]).optional(),
13286
13294
  order: number().optional(),
13287
13295
  fields: array(any())
13288
13296
  });
@@ -17162,6 +17170,52 @@ var TierStatusSchema = object({
17162
17170
  countedAt: number().nullable()
17163
17171
  });
17164
17172
  /** Operator/diagnostic view: rows per tier, last runs, refusals and drops since boot. */
17173
+ /**
17174
+ * Why a series is orphan. `device-gone`: its device is absent from the
17175
+ * successful device listings (the departure clock). `undeclared`: its `cap:`
17176
+ * key is declared by no capability any more (a field a cap removed).
17177
+ */
17178
+ var DeviceHistoryOrphanReasonSchema = _enum(["device-gone", "undeclared"]);
17179
+ /** Rows held per stored tier. */
17180
+ var TierRowsSchema = object({
17181
+ raw: number().int(),
17182
+ "5m": number().int(),
17183
+ "1h": number().int(),
17184
+ "1d": number().int()
17185
+ });
17186
+ var OrphanSeriesSchema = object({
17187
+ seriesId: number().int(),
17188
+ deviceId: number().int(),
17189
+ key: string(),
17190
+ scope: string(),
17191
+ /** The metric's display name; `null` when its metric row is gone too. */
17192
+ displayName: string().nullable(),
17193
+ reason: DeviceHistoryOrphanReasonSchema,
17194
+ /** `device-gone`: since when the device has been absent; `null` otherwise. */
17195
+ missingSince: number().nullable(),
17196
+ firstTs: number(),
17197
+ lastTs: number(),
17198
+ rows: TierRowsSchema
17199
+ });
17200
+ var DeviceHistoryOrphanDeleteRefusalSchema = _enum([
17201
+ "not-found",
17202
+ "not-orphan",
17203
+ "failed"
17204
+ ]);
17205
+ var OrphanDeleteEntrySchema = discriminatedUnion("ok", [object({
17206
+ seriesId: number().int(),
17207
+ ok: literal(true),
17208
+ deleted: TierRowsSchema
17209
+ }), object({
17210
+ seriesId: number().int(),
17211
+ ok: literal(false),
17212
+ reason: DeviceHistoryOrphanDeleteRefusalSchema
17213
+ })]);
17214
+ var OrphanListSchema = object({
17215
+ series: array(OrphanSeriesSchema).readonly(),
17216
+ /** More orphans exist than {@link DEVICE_HISTORY_ORPHAN_LIST_MAX}. */
17217
+ truncated: boolean()
17218
+ });
17165
17219
  var DeviceHistoryStatusSchema = object({
17166
17220
  startedAt: number(),
17167
17221
  /** The store is declared, series loaded and the first reconcile has answered. */
@@ -17259,7 +17313,10 @@ method(object({ deviceId: number().int() }), array(SeriesInfoSchema).readonly())
17259
17313
  }), object({ enabled: boolean() }), {
17260
17314
  kind: "mutation",
17261
17315
  auth: "admin"
17262
- }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" });
17316
+ }), method(object({}), DeviceHistoryStatusSchema, { auth: "admin" }), method(object({}), OrphanListSchema, { auth: "admin" }), method(object({ seriesIds: array(number().int()).min(1).max(50) }), object({ results: array(OrphanDeleteEntrySchema).readonly() }), {
17317
+ kind: "mutation",
17318
+ auth: "admin"
17319
+ });
17263
17320
  var DeviceCaStatusSchema = discriminatedUnion("state", [
17264
17321
  object({ state: literal("absent") }),
17265
17322
  object({
@@ -47987,7 +48044,6 @@ var RecommendationReasonSchema = discriminatedUnion("kind", [
47987
48044
  modelId: string()
47988
48045
  }),
47989
48046
  object({ kind: literal("cpu-device") }),
47990
- object({ kind: literal("coral-untouched") }),
47991
48047
  object({ kind: literal("device-disabled") }),
47992
48048
  object({ kind: literal("device-unavailable") }),
47993
48049
  object({ kind: literal("node-offline") }),
@@ -48085,11 +48141,6 @@ var AutoTuneWarningSchema = discriminatedUnion("kind", [
48085
48141
  kind: literal("detector-store-unreadable"),
48086
48142
  error: string()
48087
48143
  }),
48088
- object({
48089
- kind: literal("coral-enabled"),
48090
- nodeId: string(),
48091
- deviceKey: string()
48092
- }),
48093
48144
  object({
48094
48145
  kind: literal("custom-pin-kept"),
48095
48146
  nodeId: string(),
@@ -55133,17 +55184,69 @@ var connectivityCapability = {
55133
55184
  volatileStateFields: ["lastChangedAt"]
55134
55185
  };
55135
55186
  /**
55136
- * Generic device-consumables capability — surfaces a device's
55137
- * maintenance items (vacuum filters/brushes, replaceable cartridges,
55138
- * descaling cycles, …) with their remaining life and an optional
55139
- * "Replaced" reset action. Device-agnostic: any provider that knows its
55140
- * device tracks consumables can register it; the cap declares no
55141
- * vocabulary of its own — the provider names each item verbatim.
55187
+ * Generic device-consumables capability — the ONE place a device reports what
55188
+ * it uses up or fills: wear parts (vacuum filters/brushes, cartridges,
55189
+ * descaling cycles), supplies it draws from (a vacuum's clean-water tank and
55190
+ * detergent, a dishwasher's salt and rinse aid) and waste it collects (a dirty
55191
+ * water tank, a dust bin). Each item carries its remaining life or fill and an
55192
+ * optional "Replaced" reset action. Device-agnostic: any provider that knows
55193
+ * its device tracks consumables registers it; the provider names each item
55194
+ * verbatim and says which `kind` it is.
55195
+ *
55196
+ * The admin UI renders it as ONE collapsible section directly under the
55197
+ * device page's hero card (`placement: 'hero'`), for every device bound to
55198
+ * this cap — never drawn by a device type's hero card itself (D915).
55142
55199
  *
55143
55200
  * Like `childLayout`, the cap is INERT until a provider sets items: no
55144
55201
  * provider populates it by guessing (no HA inference). The UI renders a
55145
55202
  * "No consumables reported" placeholder when `items` is empty.
55146
55203
  */
55204
+ /**
55205
+ * What an item IS, which decides which direction is bad:
55206
+ * - `wear` — a part that wears out (a brush, a filter); low life is bad.
55207
+ * - `supply` — something the device draws from (clean water, detergent,
55208
+ * salt, rinse aid); low or empty is bad.
55209
+ * - `waste` — something the device fills (dirty water, a dust bin); full is
55210
+ * bad.
55211
+ * Absent = `wear`.
55212
+ */
55213
+ var ConsumableKindSchema = _enum([
55214
+ "wear",
55215
+ "supply",
55216
+ "waste"
55217
+ ]);
55218
+ /**
55219
+ * What an item LOOKS like, which decides how a client draws it — independent
55220
+ * of `kind`, which decides which direction is bad:
55221
+ * - `part` — a part that wears (a brush, a filter, a mop pad): a wear bar,
55222
+ * remaining time and a reset.
55223
+ * - `tank` — a container of liquid (clean water, dirty water): a fill gauge.
55224
+ * - `product` — something bought and refilled (detergent, salt, rinse aid):
55225
+ * a stepped level and "refill".
55226
+ * - `bin` — a container that collects waste (a dust bin): a fill gauge
55227
+ * that warns when full.
55228
+ * Absent = derived from the kind ({@link consumableFormOf}).
55229
+ */
55230
+ var ConsumableFormSchema = _enum([
55231
+ "part",
55232
+ "tank",
55233
+ "product",
55234
+ "bin"
55235
+ ]);
55236
+ /** The provider's own discrete verdict on an item. */
55237
+ var ConsumableStatusSchema = _enum([
55238
+ "ok",
55239
+ "low",
55240
+ "empty",
55241
+ "full",
55242
+ "replace"
55243
+ ]);
55244
+ _enum([
55245
+ "ok",
55246
+ "low",
55247
+ "empty",
55248
+ "full"
55249
+ ]);
55147
55250
  /** Units a remaining-life counter is reported in. Closed: the panel renders
55148
55251
  * each. */
55149
55252
  var ConsumableRemainingUnitSchema = _enum([
@@ -55158,18 +55261,23 @@ var ConsumableRemainingSchema = object({
55158
55261
  unit: ConsumableRemainingUnitSchema
55159
55262
  });
55160
55263
  /** A single consumable item. Either a continuous `level` (remaining
55161
- * life %) or a discrete `status` may be known — both may be null when a
55162
- * provider only knows the item exists. `level` and `status` are not
55163
- * mutually exclusive; a provider may report both. */
55264
+ * life %, or fill % for a `supply` / `waste` item) or a discrete `status`
55265
+ * may be known — both may be null when a provider only knows the item
55266
+ * exists. `level` and `status` are not mutually exclusive; a provider may
55267
+ * report both. */
55164
55268
  var ConsumableItemSchema = object({
55165
55269
  /** Stable id, e.g. 'main-brush'. */
55166
55270
  key: string().min(1),
55167
55271
  /** Display name. */
55168
55272
  label: string().min(1),
55169
- /** Remaining life % when known (0..100). */
55273
+ /** Remaining life % (`wear`) or fill % (`supply`, `waste`) when known (0..100). */
55170
55274
  level: number().min(0).max(100).nullable(),
55171
- /** Discrete state when known (binary mode). */
55172
- status: _enum(["ok", "replace"]).nullable(),
55275
+ /** The provider's discrete verdict when known (binary mode). */
55276
+ status: ConsumableStatusSchema.nullable(),
55277
+ /** What the item is — decides whether low or full is bad. Absent = `wear`. */
55278
+ kind: ConsumableKindSchema.optional(),
55279
+ /** How the item is drawn (part, tank, product, bin). Absent = derived from `kind`. */
55280
+ form: ConsumableFormSchema.optional(),
55173
55281
  /** Ms epoch of the last replace, when known. */
55174
55282
  lastResetAt: number().nullable(),
55175
55283
  /** Whether `reset()` is meaningful for this item. */
@@ -55192,7 +55300,7 @@ var consumablesCapability = {
55192
55300
  kind: "widget",
55193
55301
  widgetId: "host/consumables-panel",
55194
55302
  tab: "consumables",
55195
- topTab: true,
55303
+ placement: "hero",
55196
55304
  label: "Consumables",
55197
55305
  order: 5
55198
55306
  } },
@@ -55253,9 +55361,37 @@ reset: method(object({
55253
55361
  */
55254
55362
  durability: "restored",
55255
55363
  /**
55256
- * History (D850): none — `items` is an array keyed by runtime ids; a history path never enters it.
55364
+ * History (D850, D917): one series per (item field, item `key`) — the item key
55365
+ * is the series scope, the item `label` names it. A vacuum tank's fill, a
55366
+ * brush's remaining life and a dishwasher's salt are each recorded the moment
55367
+ * their provider reports them; an item that appears later gets its series.
55257
55368
  */
55258
- history: "none",
55369
+ history: {
55370
+ fields: {},
55371
+ items: {
55372
+ path: "items",
55373
+ key: "key",
55374
+ label: "label",
55375
+ fields: {
55376
+ level: {
55377
+ kind: "gauge",
55378
+ unit: "%",
55379
+ deadband: 2,
55380
+ displayName: "Level"
55381
+ },
55382
+ status: {
55383
+ kind: "enum",
55384
+ displayName: "Status"
55385
+ },
55386
+ "remaining.value": {
55387
+ kind: "gauge",
55388
+ unitFrom: "remaining.unit",
55389
+ deadband: 1,
55390
+ displayName: "Remaining"
55391
+ }
55392
+ }
55393
+ }
55394
+ },
55259
55395
  /** Clocks, not content: a re-read that changed no item costs no commit. */
55260
55396
  volatileStateFields: ["lastChangedAt", "lastFetchedAt"]
55261
55397
  };
@@ -55670,8 +55806,9 @@ onStatusChanged: { data: object({
55670
55806
  volatileStateFields: ["lastChangedAt"]
55671
55807
  };
55672
55808
  /**
55673
- * Smart-dishwasher cap — program lifecycle, door / remote-start gates,
55674
- * consumable levels (salt, rinse aid) and common program options.
55809
+ * Smart-dishwasher cap — program lifecycle, door / remote-start gates and
55810
+ * common program options. Salt and rinse aid are NOT here: they are items of
55811
+ * the device's `consumables` cap, like every other device's (D915).
55675
55812
  *
55676
55813
  * Sources: native Bosch Home Connect (`dishwasher` device type). Reusable
55677
55814
  * by any integration that exposes the same program / option surface.
@@ -55719,11 +55856,6 @@ var DishwasherAvailabilitySchema = _enum([
55719
55856
  "offline",
55720
55857
  "description-missing"
55721
55858
  ]);
55722
- var DishwasherConsumableLevelSchema = _enum([
55723
- "ok",
55724
- "low",
55725
- "empty"
55726
- ]);
55727
55859
  var DishwasherStatusSchema = object({
55728
55860
  availability: DishwasherAvailabilitySchema,
55729
55861
  /** Coarse state for compact surfaces; `unavailable` whenever the appliance state is not known. */
@@ -55756,8 +55888,6 @@ var DishwasherStatusSchema = object({
55756
55888
  powerOn: boolean().nullable(),
55757
55889
  /** The raw power state (`On`, `Off`, `Standby`, …); null when not known. */
55758
55890
  powerState: string().nullable(),
55759
- saltLevel: DishwasherConsumableLevelSchema.nullable(),
55760
- rinseAidLevel: DishwasherConsumableLevelSchema.nullable(),
55761
55891
  /**
55762
55892
  * True while the appliance asks for its filter to be cleaned (smart-filter, filter-system or
55763
55893
  * combined care-and-filter reminder raised); false when every such reminder reads clear; null
@@ -64573,60 +64703,17 @@ method(_void(), array(UserSummarySchema), { auth: "admin" }), method(CreateUserI
64573
64703
  auth: "admin",
64574
64704
  access: "delete"
64575
64705
  });
64576
- /**
64577
- * Robot-vacuum cap. Models HA `vacuum.*` entities — anything with a
64578
- * cleaning lifecycle plus a return-to-base / locate surface and an
64579
- * optional fan-speed selector.
64580
- *
64581
- * State follows HA's canonical vacuum lifecycle: `idle` / `cleaning` /
64582
- * `paused` / `returning` / `docked` / `error`. `batteryLevel`
64583
- * (0..100) is nullable — some vacuums don't report a battery
64584
- * percentage. `fanSpeed` is the current speed token (provider-verbatim,
64585
- * e.g. `'standard'` / `'turbo'`) and `availableFanSpeeds` lists the
64586
- * tokens the hardware accepts so the UI renders only supported choices.
64587
- *
64588
- * The `setFanSpeed` method takes the bare `speed` token — the provider
64589
- * validates it against the vacuum's own list. `locate` triggers the
64590
- * find-me chirp; `returnToBase` sends it home.
64591
- *
64592
- * Consumable / waste tanks: `cleanWater` / `dirtyWater` / `detergent` /
64593
- * `dustBin` each carry a nullable `{ level (0..100 %), status ('ok' |
64594
- * 'low' | 'full') }` reading. Native providers (e.g. Dreame, Roborock)
64595
- * SHOULD populate whichever tanks the hardware has — leave a field `null`
64596
- * only when the device has no such tank at all, and use a `TankStatus`
64597
- * with both inner fields `null` when the tank exists but its level is
64598
- * currently unknown. HA `vacuum.*` entities expose no per-tank telemetry,
64599
- * so the HA provider leaves all four `null`.
64600
- */
64601
- var VacuumStateSchema = _enum([
64602
- "idle",
64603
- "cleaning",
64604
- "paused",
64605
- "returning",
64606
- "docked",
64607
- "drying",
64608
- "error"
64609
- ]);
64610
- /**
64611
- * One consumable / waste tank on a robot vacuum (clean-water, dirty-water,
64612
- * detergent or dust-bin). A tank can report a numeric fill `level` (0..100),
64613
- * a discrete `status` (binary-style hardware), or both. Both `null` means the
64614
- * level is currently unknown; the OWNING field being `null` means the
64615
- * hardware has no such tank at all.
64616
- */
64617
- var TankStatusSchema = object({
64618
- /** Numeric fill 0..100 when the hardware reports a percentage; null otherwise. */
64619
- level: number().min(0).max(100).nullable(),
64620
- /** Discrete state when the hardware is binary-mode; null otherwise. */
64621
- status: _enum([
64622
- "ok",
64623
- "low",
64624
- "full"
64625
- ]).nullable()
64626
- });
64627
64706
  var VacuumControlStatusSchema = object({
64628
64707
  /** Lifecycle state of the vacuum. */
64629
- state: VacuumStateSchema,
64708
+ state: _enum([
64709
+ "idle",
64710
+ "cleaning",
64711
+ "paused",
64712
+ "returning",
64713
+ "docked",
64714
+ "drying",
64715
+ "error"
64716
+ ]),
64630
64717
  /** 0..100 battery percentage. Null when the device has no battery
64631
64718
  * reading. */
64632
64719
  batteryLevel: number().min(0).max(100).nullable(),
@@ -64635,14 +64722,6 @@ var VacuumControlStatusSchema = object({
64635
64722
  fanSpeed: string().nullable(),
64636
64723
  /** Speed tokens the hardware accepts — drives the UI selector. */
64637
64724
  availableFanSpeeds: array(string()),
64638
- /** Clean-water (mop) tank. Null when the hardware has no clean-water tank. */
64639
- cleanWater: TankStatusSchema.nullable(),
64640
- /** Dirty-water (recovery) tank. Null when the hardware has no dirty-water tank. */
64641
- dirtyWater: TankStatusSchema.nullable(),
64642
- /** Detergent tank. Null when the hardware has no detergent tank. */
64643
- detergent: TankStatusSchema.nullable(),
64644
- /** Dust bin. Null when the hardware has no dust bin. */
64645
- dustBin: TankStatusSchema.nullable(),
64646
64725
  /** 0..100 cleaning-completion percentage of the current task, or null. */
64647
64726
  progressPercent: number().min(0).max(100).nullable(),
64648
64727
  /** Current error code (0 / null = no error). */
@@ -64704,35 +64783,14 @@ var vacuumControlCapability = {
64704
64783
  */
64705
64784
  durability: "session",
64706
64785
  /**
64707
- * History (D850): recorded series. Tank levels are fixed-object paths (`cleanWater.level`, ...).
64786
+ * History (D850): recorded series. The tanks moved to `consumables` (D915), whose
64787
+ * items are keyed by runtime ids and record no history.
64708
64788
  */
64709
- history: { fields: {
64710
- batteryLevel: {
64711
- kind: "gauge",
64712
- unit: "%",
64713
- deadband: 2
64714
- },
64715
- "cleanWater.level": {
64716
- kind: "gauge",
64717
- unit: "%",
64718
- deadband: 2
64719
- },
64720
- "dirtyWater.level": {
64721
- kind: "gauge",
64722
- unit: "%",
64723
- deadband: 2
64724
- },
64725
- "detergent.level": {
64726
- kind: "gauge",
64727
- unit: "%",
64728
- deadband: 2
64729
- },
64730
- "dustBin.level": {
64731
- kind: "gauge",
64732
- unit: "%",
64733
- deadband: 2
64734
- }
64735
- } }
64789
+ history: { fields: { batteryLevel: {
64790
+ kind: "gauge",
64791
+ unit: "%",
64792
+ deadband: 2
64793
+ } } }
64736
64794
  };
64737
64795
  var ValveStatusSchema = object({
64738
64796
  /** Lifecycle state of the valve. */
@@ -69126,6 +69184,12 @@ Object.freeze({
69126
69184
  addonId: null,
69127
69185
  access: "create"
69128
69186
  },
69187
+ "deviceHistory.deleteOrphanSeries": {
69188
+ capName: "device-history",
69189
+ capScope: "system",
69190
+ addonId: null,
69191
+ access: "delete"
69192
+ },
69129
69193
  "deviceHistory.getDeviceEnabled": {
69130
69194
  capName: "device-history",
69131
69195
  capScope: "system",
@@ -69144,6 +69208,12 @@ Object.freeze({
69144
69208
  addonId: null,
69145
69209
  access: "view"
69146
69210
  },
69211
+ "deviceHistory.listOrphanSeries": {
69212
+ capName: "device-history",
69213
+ capScope: "system",
69214
+ addonId: null,
69215
+ access: "view"
69216
+ },
69147
69217
  "deviceHistory.listSeries": {
69148
69218
  capName: "device-history",
69149
69219
  capScope: "system",
@@ -79149,7 +79219,7 @@ var STATE_SUMMARY_VARS = [
79149
79219
  ([...RULE_TEXT], [...COMBINED_ALARM]),
79150
79220
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
79151
79221
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
79152
- ([...RULE_TEXT], [...CONSUMABLE]),
79222
+ ([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
79153
79223
  ([...RULE_TEXT], [...TANK]),
79154
79224
  [...RULE_TEXT],
79155
79225
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
@@ -79847,4 +79917,4 @@ DEFAULT_NATIVE_LEASE_SETTINGS.admission;
79847
79917
  var MB = 1024 * 1024;
79848
79918
  1024 * MB, 3072 * MB;
79849
79919
  //#endregion
79850
- export { object as A, defineCustomActions as C, array as D, _enum as E, EventCategory as F, string as M, union as N, literal as O, unknown as P, customAction as S, isSecretMarkerLike as T, waterHeaterCapability as _, binaryCapability as a, errMsg as b, deviceAdoptionCapability as c, eventEmitterCapability as d, heatingValveCapability as f, temperatureSensorCapability as g, switchCapability as h, batteryCapability as i, record as j, number as k, dishwasherCapability as l, powerMeterCapability as m, BaseDeviceProvider as n, climateControlCapability as o, numericSensorCapability as p, DishwasherOperationStateSchema as r, connectionTestCapability as s, BaseDevice as t, enumSensorCapability as u, DeviceRole as v, isSecretMarker as w, createEvent as x, DeviceType as y };
79920
+ export { number as A, customAction as C, _enum as D, isSecretMarkerLike as E, unknown as F, EventCategory as I, record as M, string as N, array as O, union as P, createEvent as S, isSecretMarker as T, temperatureSensorCapability as _, binaryCapability as a, DeviceType as b, consumablesCapability as c, enumSensorCapability as d, eventEmitterCapability as f, switchCapability as g, powerMeterCapability as h, batteryCapability as i, object as j, literal as k, deviceAdoptionCapability as l, numericSensorCapability as m, BaseDeviceProvider as n, climateControlCapability as o, heatingValveCapability as p, DishwasherOperationStateSchema as r, connectionTestCapability as s, BaseDevice as t, dishwasherCapability as u, waterHeaterCapability as v, defineCustomActions as w, errMsg as x, DeviceRole as y };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-BUFPeAeI.js");
3
- const require_account_integration_offline = require("../account-integration-offline-BTvqsjjH.js");
2
+ const require_dist = require("../dist-8MDf5Iki.js");
3
+ const require_account_integration_offline = require("../account-integration-offline-CZ4N26Oy.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  let node_tls = require("node:tls");
6
6
  let node_zlib = require("node:zlib");
@@ -3826,8 +3826,6 @@ var COLD_DISHWASHER_STATUS = {
3826
3826
  localControlActive: null,
3827
3827
  powerOn: null,
3828
3828
  powerState: null,
3829
- saltLevel: null,
3830
- rinseAidLevel: null,
3831
3829
  filterCleaningDue: null,
3832
3830
  machineCareDue: null,
3833
3831
  machineCareRemainingRuns: null,
@@ -3885,8 +3883,6 @@ function dishwasherStatusFromFeatures(input) {
3885
3883
  localControlActive: boolOf(valueOf(input, findEntity(description, ["status"], ["LocalControlActive"]))),
3886
3884
  powerOn: powerRaw === null ? null : powerRaw === "On",
3887
3885
  powerState: powerRaw,
3888
- saltLevel: consumableFromEvents(input, ["SaltNearlyEmpty"], ["SaltEmpty", "SaltLack"]),
3889
- rinseAidLevel: consumableFromEvents(input, ["RinseAidNearlyEmpty"], ["RinseAidEmpty", "RinseAidLack"]),
3890
3886
  filterCleaningDue: reminderDue(input, [
3891
3887
  "SmartFilterCleaningReminder",
3892
3888
  "CheckFilterSystem",
@@ -3987,6 +3983,44 @@ function dishwasherOptionsFromDescription(input) {
3987
3983
  var HC_COMMAND_PAUSE = "PauseProgram";
3988
3984
  var HC_COMMAND_RESUME = "ResumeProgram";
3989
3985
  var HC_COMMAND_STOP = "AbortProgram";
3986
+ /** The dishwasher supplies, by the events that report them. */
3987
+ var DISHWASHER_SUPPLIES = [{
3988
+ key: "salt",
3989
+ label: "Salt",
3990
+ nearlyEmpty: ["SaltNearlyEmpty"],
3991
+ empty: ["SaltEmpty", "SaltLack"]
3992
+ }, {
3993
+ key: "rinseAid",
3994
+ label: "Rinse aid",
3995
+ nearlyEmpty: ["RinseAidNearlyEmpty"],
3996
+ empty: ["RinseAidEmpty", "RinseAidLack"]
3997
+ }];
3998
+ /**
3999
+ * The dishwasher's `consumables` items (D915): salt and rinse aid as `supply`
4000
+ * items, for each the appliance's description lists an event for. Their
4001
+ * status comes from those events (`consumableFromEvents`); none reported is
4002
+ * `null` (unknown), never `ok`. Neither is resettable — refilling is the reset.
4003
+ *
4004
+ * `null` while the appliance is offline or undescribed: nothing is known NOW,
4005
+ * and the `consumables` slice is restored — the last observation stays rather
4006
+ * than being overwritten with unknowns. Pure.
4007
+ */
4008
+ function dishwasherConsumablesFromFeatures(view) {
4009
+ if (availabilityOf(view) !== "available") return null;
4010
+ return DISHWASHER_SUPPLIES.flatMap(({ key, label, nearlyEmpty, empty }) => {
4011
+ if (eventStates(view, [...nearlyEmpty, ...empty]).length === 0) return [];
4012
+ return [{
4013
+ key,
4014
+ label,
4015
+ level: null,
4016
+ status: consumableFromEvents(view, nearlyEmpty, empty),
4017
+ kind: "supply",
4018
+ form: "product",
4019
+ lastResetAt: null,
4020
+ resettable: false
4021
+ }];
4022
+ });
4023
+ }
3990
4024
  //#endregion
3991
4025
  //#region src/home-connect/home-connect-child-bindings.ts
3992
4026
  /** The capability a bound child registers. */
@@ -4577,6 +4611,15 @@ var homeConnectDishwasherSchema = require_dist.object({
4577
4611
  integrationId: require_dist.string().optional()
4578
4612
  });
4579
4613
  var DISH_CAP = "dishwasher";
4614
+ var CONSUMABLES_CAP = "consumables";
4615
+ var CONSUMABLES_EMPTY = {
4616
+ items: [],
4617
+ lastChangedAt: 0,
4618
+ lastFetchedAt: 0
4619
+ };
4620
+ function sameItems(a, b) {
4621
+ return JSON.stringify(a) === JSON.stringify(b);
4622
+ }
4580
4623
  /** The option short names of the boolean setters, in the spellings an appliance uses. */
4581
4624
  var OPTION_NAMES = {
4582
4625
  halfLoad: ["HalfLoad"],
@@ -4603,6 +4646,7 @@ var HomeConnectDishwasherDevice = class extends require_dist.BaseDevice {
4603
4646
  async onActivate() {
4604
4647
  await super.onActivate();
4605
4648
  this.registerDishwasherCap();
4649
+ this.registerConsumablesCap();
4606
4650
  this.runtimeState.setCapState(DISH_CAP, COLD_DISHWASHER_STATUS);
4607
4651
  this.markOnline(false);
4608
4652
  this.#unwatch = homeConnectConnections.watch(this.#brokerId, this.#haId, (event) => this.recomputeSlice(event));
@@ -4627,13 +4671,41 @@ var HomeConnectDishwasherDevice = class extends require_dist.BaseDevice {
4627
4671
  recomputeSlice(event) {
4628
4672
  const previous = this.runtimeState.getCapState(DISH_CAP);
4629
4673
  const lastValueAt = event.kind === "feature" && !event.key.startsWith("HomeConnect.Info.") && !event.key.startsWith("HomeConnect.Network.") ? Date.now() : previous?.lastFetchedAt ?? 0;
4674
+ const view = this.view();
4630
4675
  const slice = dishwasherStatusFromFeatures({
4631
- ...this.view(),
4676
+ ...view,
4632
4677
  lastValueAt
4633
4678
  });
4634
4679
  this.runtimeState.setCapState(DISH_CAP, slice);
4680
+ this.writeConsumables(dishwasherConsumablesFromFeatures(view));
4635
4681
  this.markOnline(slice.availability !== "offline");
4636
4682
  }
4683
+ /**
4684
+ * Salt and rinse aid, as `consumables` items (D915). Written only when they
4685
+ * changed; `null` (offline / undescribed) and an empty list write nothing —
4686
+ * the slice is restored, and "nothing known now" must not erase the last
4687
+ * observation.
4688
+ */
4689
+ writeConsumables(items) {
4690
+ if (items === null || items.length === 0) return;
4691
+ const previous = this.runtimeState.getCapState(CONSUMABLES_CAP);
4692
+ if (previous !== void 0 && sameItems(previous.items, items)) return;
4693
+ const now = Date.now();
4694
+ const next = {
4695
+ items,
4696
+ lastChangedAt: now,
4697
+ lastFetchedAt: now
4698
+ };
4699
+ this.runtimeState.setCapState(CONSUMABLES_CAP, next);
4700
+ }
4701
+ registerConsumablesCap() {
4702
+ this.ctx.registerNativeCap(require_dist.consumablesCapability, {
4703
+ getStatus: async () => this.runtimeState.getCapState(CONSUMABLES_CAP) ?? CONSUMABLES_EMPTY,
4704
+ reset: async ({ key }) => {
4705
+ throw new Error(`"${key}" has no reset on a dishwasher — refilling it is the reset`);
4706
+ }
4707
+ });
4708
+ }
4637
4709
  requireClient() {
4638
4710
  const client = this.client();
4639
4711
  if (!client) throw new Error("Home Connect client unavailable — the integration is not connected");
@@ -1,5 +1,5 @@
1
- import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, N as union, O as literal, P as unknown, S as customAction, T as isSecretMarkerLike, a as binaryCapability, b as errMsg, c as deviceAdoptionCapability, d as eventEmitterCapability, j as record, l as dishwasherCapability, m as powerMeterCapability, n as BaseDeviceProvider, p as numericSensorCapability, r as DishwasherOperationStateSchema, s as connectionTestCapability, t as BaseDevice, u as enumSensorCapability, v as DeviceRole, w as isSecretMarker, x as createEvent, y as DeviceType } from "../dist-PdvgOyAy.mjs";
2
- import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-ASUhiSjp.mjs";
1
+ import { C as customAction, D as _enum, E as isSecretMarkerLike, F as unknown, I as EventCategory, M as record, N as string, O as array, P as union, S as createEvent, T as isSecretMarker, a as binaryCapability, b as DeviceType, c as consumablesCapability, d as enumSensorCapability, f as eventEmitterCapability, h as powerMeterCapability, j as object, k as literal, l as deviceAdoptionCapability, m as numericSensorCapability, n as BaseDeviceProvider, r as DishwasherOperationStateSchema, s as connectionTestCapability, t as BaseDevice, u as dishwasherCapability, w as defineCustomActions, x as errMsg, y as DeviceRole } from "../dist-Cj3fyC1J.mjs";
2
+ import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-vL6b7aqA.mjs";
3
3
  import { createHash, randomBytes } from "node:crypto";
4
4
  import { connect } from "node:tls";
5
5
  import { inflateRawSync } from "node:zlib";
@@ -3825,8 +3825,6 @@ var COLD_DISHWASHER_STATUS = {
3825
3825
  localControlActive: null,
3826
3826
  powerOn: null,
3827
3827
  powerState: null,
3828
- saltLevel: null,
3829
- rinseAidLevel: null,
3830
3828
  filterCleaningDue: null,
3831
3829
  machineCareDue: null,
3832
3830
  machineCareRemainingRuns: null,
@@ -3884,8 +3882,6 @@ function dishwasherStatusFromFeatures(input) {
3884
3882
  localControlActive: boolOf(valueOf(input, findEntity(description, ["status"], ["LocalControlActive"]))),
3885
3883
  powerOn: powerRaw === null ? null : powerRaw === "On",
3886
3884
  powerState: powerRaw,
3887
- saltLevel: consumableFromEvents(input, ["SaltNearlyEmpty"], ["SaltEmpty", "SaltLack"]),
3888
- rinseAidLevel: consumableFromEvents(input, ["RinseAidNearlyEmpty"], ["RinseAidEmpty", "RinseAidLack"]),
3889
3885
  filterCleaningDue: reminderDue(input, [
3890
3886
  "SmartFilterCleaningReminder",
3891
3887
  "CheckFilterSystem",
@@ -3986,6 +3982,44 @@ function dishwasherOptionsFromDescription(input) {
3986
3982
  var HC_COMMAND_PAUSE = "PauseProgram";
3987
3983
  var HC_COMMAND_RESUME = "ResumeProgram";
3988
3984
  var HC_COMMAND_STOP = "AbortProgram";
3985
+ /** The dishwasher supplies, by the events that report them. */
3986
+ var DISHWASHER_SUPPLIES = [{
3987
+ key: "salt",
3988
+ label: "Salt",
3989
+ nearlyEmpty: ["SaltNearlyEmpty"],
3990
+ empty: ["SaltEmpty", "SaltLack"]
3991
+ }, {
3992
+ key: "rinseAid",
3993
+ label: "Rinse aid",
3994
+ nearlyEmpty: ["RinseAidNearlyEmpty"],
3995
+ empty: ["RinseAidEmpty", "RinseAidLack"]
3996
+ }];
3997
+ /**
3998
+ * The dishwasher's `consumables` items (D915): salt and rinse aid as `supply`
3999
+ * items, for each the appliance's description lists an event for. Their
4000
+ * status comes from those events (`consumableFromEvents`); none reported is
4001
+ * `null` (unknown), never `ok`. Neither is resettable — refilling is the reset.
4002
+ *
4003
+ * `null` while the appliance is offline or undescribed: nothing is known NOW,
4004
+ * and the `consumables` slice is restored — the last observation stays rather
4005
+ * than being overwritten with unknowns. Pure.
4006
+ */
4007
+ function dishwasherConsumablesFromFeatures(view) {
4008
+ if (availabilityOf(view) !== "available") return null;
4009
+ return DISHWASHER_SUPPLIES.flatMap(({ key, label, nearlyEmpty, empty }) => {
4010
+ if (eventStates(view, [...nearlyEmpty, ...empty]).length === 0) return [];
4011
+ return [{
4012
+ key,
4013
+ label,
4014
+ level: null,
4015
+ status: consumableFromEvents(view, nearlyEmpty, empty),
4016
+ kind: "supply",
4017
+ form: "product",
4018
+ lastResetAt: null,
4019
+ resettable: false
4020
+ }];
4021
+ });
4022
+ }
3989
4023
  //#endregion
3990
4024
  //#region src/home-connect/home-connect-child-bindings.ts
3991
4025
  /** The capability a bound child registers. */
@@ -4576,6 +4610,15 @@ var homeConnectDishwasherSchema = object({
4576
4610
  integrationId: string().optional()
4577
4611
  });
4578
4612
  var DISH_CAP = "dishwasher";
4613
+ var CONSUMABLES_CAP = "consumables";
4614
+ var CONSUMABLES_EMPTY = {
4615
+ items: [],
4616
+ lastChangedAt: 0,
4617
+ lastFetchedAt: 0
4618
+ };
4619
+ function sameItems(a, b) {
4620
+ return JSON.stringify(a) === JSON.stringify(b);
4621
+ }
4579
4622
  /** The option short names of the boolean setters, in the spellings an appliance uses. */
4580
4623
  var OPTION_NAMES = {
4581
4624
  halfLoad: ["HalfLoad"],
@@ -4602,6 +4645,7 @@ var HomeConnectDishwasherDevice = class extends BaseDevice {
4602
4645
  async onActivate() {
4603
4646
  await super.onActivate();
4604
4647
  this.registerDishwasherCap();
4648
+ this.registerConsumablesCap();
4605
4649
  this.runtimeState.setCapState(DISH_CAP, COLD_DISHWASHER_STATUS);
4606
4650
  this.markOnline(false);
4607
4651
  this.#unwatch = homeConnectConnections.watch(this.#brokerId, this.#haId, (event) => this.recomputeSlice(event));
@@ -4626,13 +4670,41 @@ var HomeConnectDishwasherDevice = class extends BaseDevice {
4626
4670
  recomputeSlice(event) {
4627
4671
  const previous = this.runtimeState.getCapState(DISH_CAP);
4628
4672
  const lastValueAt = event.kind === "feature" && !event.key.startsWith("HomeConnect.Info.") && !event.key.startsWith("HomeConnect.Network.") ? Date.now() : previous?.lastFetchedAt ?? 0;
4673
+ const view = this.view();
4629
4674
  const slice = dishwasherStatusFromFeatures({
4630
- ...this.view(),
4675
+ ...view,
4631
4676
  lastValueAt
4632
4677
  });
4633
4678
  this.runtimeState.setCapState(DISH_CAP, slice);
4679
+ this.writeConsumables(dishwasherConsumablesFromFeatures(view));
4634
4680
  this.markOnline(slice.availability !== "offline");
4635
4681
  }
4682
+ /**
4683
+ * Salt and rinse aid, as `consumables` items (D915). Written only when they
4684
+ * changed; `null` (offline / undescribed) and an empty list write nothing —
4685
+ * the slice is restored, and "nothing known now" must not erase the last
4686
+ * observation.
4687
+ */
4688
+ writeConsumables(items) {
4689
+ if (items === null || items.length === 0) return;
4690
+ const previous = this.runtimeState.getCapState(CONSUMABLES_CAP);
4691
+ if (previous !== void 0 && sameItems(previous.items, items)) return;
4692
+ const now = Date.now();
4693
+ const next = {
4694
+ items,
4695
+ lastChangedAt: now,
4696
+ lastFetchedAt: now
4697
+ };
4698
+ this.runtimeState.setCapState(CONSUMABLES_CAP, next);
4699
+ }
4700
+ registerConsumablesCap() {
4701
+ this.ctx.registerNativeCap(consumablesCapability, {
4702
+ getStatus: async () => this.runtimeState.getCapState(CONSUMABLES_CAP) ?? CONSUMABLES_EMPTY,
4703
+ reset: async ({ key }) => {
4704
+ throw new Error(`"${key}" has no reset on a dishwasher — refilling it is the reset`);
4705
+ }
4706
+ });
4707
+ }
4636
4708
  requireClient() {
4637
4709
  const client = this.client();
4638
4710
  if (!client) throw new Error("Home Connect client unavailable — the integration is not connected");
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_dist = require("../dist-BUFPeAeI.js");
3
- const require_account_integration_offline = require("../account-integration-offline-BTvqsjjH.js");
2
+ const require_dist = require("../dist-8MDf5Iki.js");
3
+ const require_account_integration_offline = require("../account-integration-offline-CZ4N26Oy.js");
4
4
  let node_crypto = require("node:crypto");
5
5
  //#region src/homecom/custom-actions.ts
6
6
  var homeComActions = require_dist.defineCustomActions({
@@ -1,5 +1,5 @@
1
- import { A as object, C as defineCustomActions, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, T as isSecretMarkerLike, _ as waterHeaterCapability, b as errMsg, c as deviceAdoptionCapability, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, w as isSecretMarker, y as DeviceType } from "../dist-PdvgOyAy.mjs";
2
- import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-ASUhiSjp.mjs";
1
+ import { C as customAction, D as _enum, E as isSecretMarkerLike, I as EventCategory, N as string, T as isSecretMarker, b as DeviceType, j as object, k as literal, l as deviceAdoptionCapability, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, v as waterHeaterCapability, w as defineCustomActions, x as errMsg } from "../dist-Cj3fyC1J.mjs";
2
+ import { n as cascadeRemoveDevicesForIntegration, r as parseOAuthCallback, t as setIntegrationDevicesOnline } from "../account-integration-offline-vL6b7aqA.mjs";
3
3
  import { createHash, randomBytes } from "node:crypto";
4
4
  //#region src/homecom/custom-actions.ts
5
5
  var homeComActions = defineCustomActions({
package/dist/shc/addon.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
5
- const require_dist = require("../dist-BUFPeAeI.js");
5
+ const require_dist = require("../dist-8MDf5Iki.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  let node_https = require("node:https");
8
8
  let node_child_process = require("node:child_process");
@@ -1,4 +1,4 @@
1
- import { A as object, C as defineCustomActions, D as array, E as _enum, F as EventCategory, M as string, O as literal, S as customAction, b as errMsg, c as deviceAdoptionCapability, f as heatingValveCapability, g as temperatureSensorCapability, h as switchCapability, i as batteryCapability, k as number, n as BaseDeviceProvider, o as climateControlCapability, s as connectionTestCapability, t as BaseDevice, y as DeviceType } from "../dist-PdvgOyAy.mjs";
1
+ import { A as number, C as customAction, D as _enum, I as EventCategory, N as string, O as array, _ as temperatureSensorCapability, b as DeviceType, g as switchCapability, i as batteryCapability, j as object, k as literal, l as deviceAdoptionCapability, n as BaseDeviceProvider, o as climateControlCapability, p as heatingValveCapability, s as connectionTestCapability, t as BaseDevice, w as defineCustomActions, x as errMsg } from "../dist-Cj3fyC1J.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { randomUUID } from "node:crypto";
4
4
  import { request } from "node:https";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-bosch",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "description": "Bosch smart-home device-provider addons for CamStack — SHC, Home Connect, and HomeCom cloud integrations (scaffold)",
5
5
  "keywords": [
6
6
  "camstack",
@@ -81,6 +81,9 @@
81
81
  },
82
82
  {
83
83
  "name": "dishwasher"
84
+ },
85
+ {
86
+ "name": "consumables"
84
87
  }
85
88
  ]
86
89
  },