indigo-matter-bridge 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,7 +12,7 @@ Home and SmartThings are untested and unclaimed.
12
12
  > no discovery, and no idea what an Indigo device is. It is one half of a pair:
13
13
  > the plugin decides *what* to export and the node makes it a Matter accessory.
14
14
  > Install the Indigo plugin; it installs and manages this package for you, via
15
- > its own **Plugins ▸ Matter ▸ Install/update the Matter export bridge** menu
15
+ > its own **Plugins ▸ Matter ▸ Install/update the Matter bridge** menu
16
16
  > item and a launchd LaunchAgent it writes.
17
17
 
18
18
  ## Why it is a separate process
@@ -95,6 +95,38 @@ faults worth catching here (a role factory that builds but writes the wrong
95
95
  attribute; a bridged child publishing the wrong manufacturer) cannot fail against
96
96
  a stub.
97
97
 
98
+ ## Releasing
99
+
100
+ The package is publish-ready by construction: `files` is limited to `dist`,
101
+ `main` is `dist/main.js` (what the plugin's `bridge_agent.DEFAULT_BRIDGE_ENTRY`
102
+ expects), `engines.node` is `>=22.13.0`, and a `prepublishOnly` script runs
103
+ `clean` then `build` so a stale `dist` can never ship. (`npm pack --dry-run`
104
+ also includes `README.md` — npm always ships it regardless of `files`.)
105
+
106
+ ```sh
107
+ npm login # the package owner's npm account
108
+ npm test # publishing an untested build is the one unrecoverable mistake
109
+ npm publish --access public
110
+ ```
111
+
112
+ **Every release bumps two versions in step**: `package.json`'s `version` here,
113
+ and `bridge_agent.DEFAULT_INSTALL_SPEC` in the plugin. `test_bridge_agent.py`
114
+ only asserts the pin is never *ahead* of `package.json` (a trailing pin is
115
+ legal — installs just keep pulling the older release), so the in-step bump is
116
+ manual discipline, not something the suite enforces.
117
+
118
+ **Testing an unreleased node** (dev workaround, *not* the shipped default): the
119
+ on-disk layout the LaunchAgent expects is reproduced by a local install —
120
+
121
+ ```sh
122
+ npm install --prefix ~/indigo-matter /path/to/indigo-matter/bridge-node
123
+ ```
124
+
125
+ which puts the package at `~/indigo-matter/node_modules/indigo-matter-bridge`
126
+ exactly where `LaunchAgent._server_entry()` looks for it (`npm link` works
127
+ too). The plugin's install menu still tries the registry spec — the local
128
+ install covers everything else.
129
+
98
130
  ## Licence
99
131
 
100
132
  MIT. Not affiliated with Perceptive Automation, the Connectivity Standards
@@ -165,6 +165,31 @@ export interface EndpointRecord {
165
165
  * version note below, which is why this stays version 2.
166
166
  */
167
167
  numberVoid?: true;
168
+ /**
169
+ * Set by {@link EndpointMapStore.forget} (issue #219, this half only —
170
+ * the re-adopt UI itself lands separately): the device was un-exported,
171
+ * so the entry must not be rebuilt by {@link EndpointMapStore.restorable}
172
+ * — but unlike the pre-#219 behaviour, `role`/`label` are KEPT rather
173
+ * than deleted, because they are the only evidence a future re-adopt UI
174
+ * could match a recreated device against. Cleared the moment
175
+ * {@link EndpointMapStore.check} sees the same `UniqueID` live again
176
+ * (`noteRestorable`) — a live device is by
177
+ * definition not orphaned, and re-exporting the same accessory must not
178
+ * leave it permanently excluded from the next boot's pre-seeding. Absent
179
+ * on every ordinary entry, same convention as `numberVoid`.
180
+ */
181
+ orphaned?: true;
182
+ /**
183
+ * Set by {@link recordFor}/{@link noteRestorable} (issue #220): the live
184
+ * endpoint this entry witnesses was built with PowerSource. **Add-only,
185
+ * like {@link numberVoid}/{@link orphaned}** — never written `false` and
186
+ * never cleared once `true`, mirroring the wire rule (BRIDGE_PROTOCOL §4.1:
187
+ * a battery loss is "no evidence right now", not a removal). Absent on
188
+ * every ordinary entry and on every pre-#220 file, so an old build reading
189
+ * a file that has it never looks at the key — same inert-extra-key
190
+ * tolerance as the other two, and the same reason the schema stays 2.
191
+ */
192
+ battery?: true;
168
193
  }
169
194
  /** The on-disk shape (v2). */
170
195
  export interface EndpointMapFile {
@@ -189,6 +214,14 @@ export interface LiveEndpointNumber {
189
214
  */
190
215
  role?: string;
191
216
  label?: string;
217
+ /**
218
+ * Issue #220 — whether the LIVE endpoint carries PowerSource. Optional for
219
+ * the same reason `role`/`label` are: a caller with no live set to report
220
+ * (the seed path) must not be forced to assert `false` and have that
221
+ * silently overwrite a `true` {@link EndpointRecord.battery} already on
222
+ * disk — see {@link noteRestorable}'s add-only handling.
223
+ */
224
+ battery?: boolean;
192
225
  }
193
226
  /** An entry complete enough for `node.ts` to reconstruct before going online. */
194
227
  export interface RestorableEndpoint {
@@ -196,6 +229,8 @@ export interface RestorableEndpoint {
196
229
  endpointNumber: number;
197
230
  role: string;
198
231
  label: string;
232
+ /** Issue #220 — `true` only when the persisted entry has ever seen one. */
233
+ battery?: true;
199
234
  }
200
235
  /** The outcome of reading the file: absent, usable, or present-but-broken. */
201
236
  export interface EndpointMapLoad {
@@ -278,10 +313,27 @@ export declare class EndpointMapStore {
278
313
  * check} that follows `server.start()` is what reconciles the map to
279
314
  * whatever number came back. Excluding void entries here would only widen
280
315
  * the online-and-empty window issue #141 already closed, for no benefit.
316
+ *
317
+ * **`orphaned` IS part of this filter (issue #219).** A {@link forget}en
318
+ * entry now keeps its `role`/`label` as re-adopt evidence rather than
319
+ * losing them, so the orphan marker is what still keeps it out of the
320
+ * pre-attach rebuild — exactly the churn {@link forget}'s own doc comment
321
+ * exists to prevent, unaffected by role/label now surviving alongside it.
281
322
  */
282
323
  restorable(): RestorableEndpoint[];
283
324
  /**
284
- * A device was **un-exported**: keep its number, drop what would rebuild it.
325
+ * True when the map is non-empty and EVERY entry in it is
326
+ * {@link EndpointRecord.orphaned} — issue #222's distinction for
327
+ * `node.ts`'s `restoreEndpoints()`: a map in this state is the *correct*
328
+ * "nothing to rebuild" outcome (every device was deliberately un-exported
329
+ * and the next restart will NOT restore them), which is a different fact
330
+ * from a map that simply has no `role`/`label` recorded yet (a v1 file,
331
+ * or one written before the first attach) — and the two must not share
332
+ * one log message.
333
+ */
334
+ allOrphaned(): boolean;
335
+ /**
336
+ * A device was **un-exported**: keep its number AND its role/label, mark it orphaned.
285
337
  *
286
338
  * The other half of {@link restorable}, and without it the restore is a bug
287
339
  * rather than a fix. `check` only ever *adds* and *refreshes*, so once an
@@ -293,13 +345,18 @@ export declare class EndpointMapStore {
293
345
  * devices the user had already told us to stop exporting, and it regresses
294
346
  * XAC7's "un-exported accessories are gone".
295
347
  *
296
- * **The number stays.** §3.3 retains the allocation on purpose, so re-adding
297
- * the same device gets the same endpoint number back and paired ecosystems
298
- * see the accessory they already know rather than a new one. Deleting the
299
- * entry outright would throw that away to save three fields. Clearing only
300
- * the restoration half makes the entry non-restorable — {@link restorable}
301
- * filters on `role` **and** `label` — while leaving the identity intact, and
302
- * one re-export refills it through the ordinary {@link check}.
348
+ * **The number AND the role/label stay (issue #219).** §3.3 already retained
349
+ * the number on purpose, so re-adding the same device gets the same endpoint
350
+ * number back and paired ecosystems see the accessory they already know
351
+ * rather than a new one. Deleting `role`/`label` too — the pre-#219
352
+ * behaviour — threw away the only evidence a future re-adopt UI could match
353
+ * a *recreated* device (a factory-reset accessory that comes back with a new
354
+ * `UniqueID`) against the endpoint it used to occupy. Instead the entry is
355
+ * marked {@link EndpointRecord.orphaned}, which is what keeps it out of
356
+ * {@link restorable}'s pre-attach rebuild — the actual thing #141 needed —
357
+ * without destroying anything. `check`'s `noteRestorable` clears the marker
358
+ * the moment the same `UniqueID` is live again, so a plain re-export is
359
+ * unaffected.
303
360
  *
304
361
  * **Only a caller that watched a specific endpoint go may call this.** An
305
362
  * empty live set is not evidence of anything: a node that has never attached
@@ -310,8 +367,9 @@ export declare class EndpointMapStore {
310
367
  * caller: `erase()` wipes matter.js's endpoints, but the user un-exported
311
368
  * nothing and the plugin's re-attach re-creates the same set.
312
369
  *
313
- * Returns how many entries actually lost something, so a no-op costs no
314
- * disk write.
370
+ * Returns how many entries were newly marked orphaned, so a no-op — no
371
+ * record at all, already orphaned, or nothing worth protecting because the
372
+ * entry never carried a `role`/`label` to begin with — costs no disk write.
315
373
  */
316
374
  forget(uniqueIds: readonly string[]): number;
317
375
  /**
@@ -170,6 +170,15 @@ function readRecord(value) {
170
170
  if (candidate.numberVoid === true) {
171
171
  record.numberVoid = true;
172
172
  }
173
+ // Same tolerance, same reason: an old-format record simply lacks it.
174
+ if (candidate.orphaned === true) {
175
+ record.orphaned = true;
176
+ }
177
+ // Same tolerance again (issue #220): anything other than a literal `true`
178
+ // is simply not evidence of a battery, never a reason to reject the entry.
179
+ if (candidate.battery === true) {
180
+ record.battery = true;
181
+ }
173
182
  return record;
174
183
  }
175
184
  /**
@@ -255,6 +264,12 @@ function recordFor(entry) {
255
264
  if (entry.label !== undefined) {
256
265
  record.label = entry.label;
257
266
  }
267
+ // Add-only, like every other call site that touches this field (issue
268
+ // #220) — an entry is never MINTED with `battery: false`; it simply omits
269
+ // the key, the same convention `numberVoid`/`orphaned` already use.
270
+ if (entry.battery === true) {
271
+ record.battery = true;
272
+ }
258
273
  return record;
259
274
  }
260
275
  /**
@@ -265,6 +280,13 @@ function recordFor(entry) {
265
280
  * would strip a perfectly good entry of the very fields that make it
266
281
  * restorable. Returns whether anything changed, so a steady state still costs
267
282
  * no disk write.
283
+ *
284
+ * **Also un-orphans (issue #219).** `entry` being here at all means the
285
+ * `UniqueID` is live right now, which a {@link EndpointMapStore.forget}en
286
+ * entry — by definition, no longer live at the moment it was forgotten — is
287
+ * not. A re-export must not stay permanently excluded from the next boot's
288
+ * {@link EndpointMapStore.restorable} pre-seeding just because it was once
289
+ * un-exported.
268
290
  */
269
291
  function noteRestorable(record, entry) {
270
292
  let changed = false;
@@ -276,6 +298,18 @@ function noteRestorable(record, entry) {
276
298
  record.label = entry.label;
277
299
  changed = true;
278
300
  }
301
+ // Add-only (issue #220): a live entry that HAS a battery sets the marker;
302
+ // one that does not is silently no evidence either way, matching the wire
303
+ // rule (BRIDGE_PROTOCOL §4.1) rather than clearing what a previous live
304
+ // pass already recorded.
305
+ if (entry.battery === true && !record.battery) {
306
+ record.battery = true;
307
+ changed = true;
308
+ }
309
+ if (record.orphaned) {
310
+ delete record.orphaned;
311
+ changed = true;
312
+ }
279
313
  return changed;
280
314
  }
281
315
  /** Why {@link EndpointMapStore.check} is writing, for the log line. */
@@ -415,11 +449,17 @@ export class EndpointMapStore {
415
449
  * check} that follows `server.start()` is what reconciles the map to
416
450
  * whatever number came back. Excluding void entries here would only widen
417
451
  * the online-and-empty window issue #141 already closed, for no benefit.
452
+ *
453
+ * **`orphaned` IS part of this filter (issue #219).** A {@link forget}en
454
+ * entry now keeps its `role`/`label` as re-adopt evidence rather than
455
+ * losing them, so the orphan marker is what still keeps it out of the
456
+ * pre-attach rebuild — exactly the churn {@link forget}'s own doc comment
457
+ * exists to prevent, unaffected by role/label now surviving alongside it.
418
458
  */
419
459
  restorable() {
420
460
  const restorable = [];
421
461
  for (const [uniqueId, record] of this.#endpoints) {
422
- if (record.role === undefined || record.label === undefined) {
462
+ if (record.role === undefined || record.label === undefined || record.orphaned) {
423
463
  continue;
424
464
  }
425
465
  restorable.push({
@@ -427,12 +467,30 @@ export class EndpointMapStore {
427
467
  endpointNumber: record.number,
428
468
  role: record.role,
429
469
  label: record.label,
470
+ // Issue #220: add-only, so `restore-on-start` (`node.ts`)
471
+ // rebuilds the accessory with the same cluster set it had —
472
+ // the one thing that stops every battery accessory losing
473
+ // PowerSource on the very next restart.
474
+ ...(record.battery ? { battery: true } : {}),
430
475
  });
431
476
  }
432
477
  return restorable;
433
478
  }
434
479
  /**
435
- * A device was **un-exported**: keep its number, drop what would rebuild it.
480
+ * True when the map is non-empty and EVERY entry in it is
481
+ * {@link EndpointRecord.orphaned} — issue #222's distinction for
482
+ * `node.ts`'s `restoreEndpoints()`: a map in this state is the *correct*
483
+ * "nothing to rebuild" outcome (every device was deliberately un-exported
484
+ * and the next restart will NOT restore them), which is a different fact
485
+ * from a map that simply has no `role`/`label` recorded yet (a v1 file,
486
+ * or one written before the first attach) — and the two must not share
487
+ * one log message.
488
+ */
489
+ allOrphaned() {
490
+ return this.#endpoints.size > 0 && [...this.#endpoints.values()].every(record => record.orphaned === true);
491
+ }
492
+ /**
493
+ * A device was **un-exported**: keep its number AND its role/label, mark it orphaned.
436
494
  *
437
495
  * The other half of {@link restorable}, and without it the restore is a bug
438
496
  * rather than a fix. `check` only ever *adds* and *refreshes*, so once an
@@ -444,13 +502,18 @@ export class EndpointMapStore {
444
502
  * devices the user had already told us to stop exporting, and it regresses
445
503
  * XAC7's "un-exported accessories are gone".
446
504
  *
447
- * **The number stays.** §3.3 retains the allocation on purpose, so re-adding
448
- * the same device gets the same endpoint number back and paired ecosystems
449
- * see the accessory they already know rather than a new one. Deleting the
450
- * entry outright would throw that away to save three fields. Clearing only
451
- * the restoration half makes the entry non-restorable — {@link restorable}
452
- * filters on `role` **and** `label` — while leaving the identity intact, and
453
- * one re-export refills it through the ordinary {@link check}.
505
+ * **The number AND the role/label stay (issue #219).** §3.3 already retained
506
+ * the number on purpose, so re-adding the same device gets the same endpoint
507
+ * number back and paired ecosystems see the accessory they already know
508
+ * rather than a new one. Deleting `role`/`label` too — the pre-#219
509
+ * behaviour — threw away the only evidence a future re-adopt UI could match
510
+ * a *recreated* device (a factory-reset accessory that comes back with a new
511
+ * `UniqueID`) against the endpoint it used to occupy. Instead the entry is
512
+ * marked {@link EndpointRecord.orphaned}, which is what keeps it out of
513
+ * {@link restorable}'s pre-attach rebuild — the actual thing #141 needed —
514
+ * without destroying anything. `check`'s `noteRestorable` clears the marker
515
+ * the moment the same `UniqueID` is live again, so a plain re-export is
516
+ * unaffected.
454
517
  *
455
518
  * **Only a caller that watched a specific endpoint go may call this.** An
456
519
  * empty live set is not evidence of anything: a node that has never attached
@@ -461,23 +524,25 @@ export class EndpointMapStore {
461
524
  * caller: `erase()` wipes matter.js's endpoints, but the user un-exported
462
525
  * nothing and the plugin's re-attach re-creates the same set.
463
526
  *
464
- * Returns how many entries actually lost something, so a no-op costs no
465
- * disk write.
527
+ * Returns how many entries were newly marked orphaned, so a no-op — no
528
+ * record at all, already orphaned, or nothing worth protecting because the
529
+ * entry never carried a `role`/`label` to begin with — costs no disk write.
466
530
  */
467
531
  forget(uniqueIds) {
468
532
  let forgotten = 0;
469
533
  for (const uniqueId of uniqueIds) {
470
534
  const record = this.#endpoints.get(uniqueId);
471
- if (record === undefined || (record.role === undefined && record.label === undefined)) {
535
+ if (record === undefined ||
536
+ record.orphaned ||
537
+ (record.role === undefined && record.label === undefined)) {
472
538
  continue;
473
539
  }
474
- delete record.role;
475
- delete record.label;
540
+ record.orphaned = true;
476
541
  forgotten += 1;
477
542
  }
478
543
  if (forgotten > 0) {
479
- this.persist(`cleared the role/label of ${forgotten} un-exported endpoint(s), keeping their ` +
480
- "numbers so a re-export returns the same accessory");
544
+ this.persist(`marked ${forgotten} un-exported endpoint(s) orphaned, keeping their role/label ` +
545
+ "as re-adopt evidence and their numbers so a re-export returns the same accessory");
481
546
  }
482
547
  return forgotten;
483
548
  }
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint-map.js","sourceRoot":"","sources":["../src/endpoint-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoEG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAmB,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAmB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,eAAe,CAAC,KAA4B;IACxD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC;IACnF,CAAC;IACD,OAAO,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC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AM,aAAa,CAAC,KAAK,CAAC,IAAI;gBACtE,+DAA+D,CAAC;YACpE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;YAClB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;YAC1C,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ"}
@@ -15,15 +15,25 @@
15
15
  *
16
16
  * Two kinds of role live here, and they use different machinery:
17
17
  *
18
- * * **Attribute-driven** roles (everything E3 built, plus every sensor and the
19
- * thermostat) report ecosystem intent through {@link WatchSpec}s on the
20
- * cluster attributes an ecosystem writes.
21
- * * **Invocation-driven** roles (`doorLock`, `windowCovering`) cannot: their
18
+ * * **Attribute-driven** roles (every sensor and the thermostat) report
19
+ * ecosystem intent through {@link WatchSpec}s on the cluster attributes an
20
+ * ecosystem writes — there is no other surface for them to speak through.
21
+ * * **Invocation-driven** roles — `doorLock`, `windowCovering`, and, as of
22
+ * #143, the whole light/plug family (`onOff`, `levelControl` and
23
+ * `colorControl` together) — cannot rely on attributes: their
22
24
  * ecosystem-facing surface is *commands*, and matter.js's stock servers
23
- * answer those by writing the state themselves. Both are overridden here so
24
- * the write never happens — see {@link IndigoDoorLockServer} and
25
- * {@link IndigoWindowCoveringServer} — and they reach their `command` sink
26
- * through {@link COMMAND_SINKS}.
25
+ * answer those by writing the state themselves. Every one of them is
26
+ * overridden here so the write never happens — see
27
+ * {@link IndigoDoorLockServer}, {@link IndigoWindowCoveringServer},
28
+ * {@link IndigoOnOffServer}, {@link IndigoLevelControlServer} and
29
+ * {@link IndigoColorControlServer}/{@link IndigoColorTemperatureControlServer}
30
+ * — and they reach their `command` sink through {@link COMMAND_SINKS}.
31
+ *
32
+ * The `WATCH_*` specs for `onOff`/`levelControl`/`colorControl` still exist
33
+ * (§2.5 of the #143 design keeps them as producerless **backstops**, not
34
+ * because anything here still writes through them) — see their own docs for
35
+ * why a duplicate frame from a defunct watcher is worth keeping over deleting
36
+ * the regression detector.
27
37
  */
28
38
  import { Endpoint } from "@matter/main";
29
39
  import { Thermostat } from "@matter/main/clusters/thermostat";
@@ -64,6 +74,14 @@ export declare const MIREDS_MIN = 153;
64
74
  export declare const MIREDS_MAX = 500;
65
75
  /** Matter `CurrentHue` spans 0-254 for a full 0-360° turn. */
66
76
  export declare const HUE_DEGREES_MAX = 360;
77
+ /**
78
+ * The scale `currentX`/`currentY` are carried on the wire at: matter.js's own
79
+ * `ColorControlServer`'s `x`/`y` convenience getters divide by this exact
80
+ * value (`#returnAsXyValue`, `ColorControlServer.js:1449`), which is why
81
+ * {@link IndigoColorControlServer.moveToColorLogic} divides by it too before
82
+ * handing a CIE fraction to `xyToHsv`.
83
+ */
84
+ export declare const CIE_XY_SCALE = 65536;
67
85
  /**
68
86
  * Indigo 0-100 → Matter 0-254 (§4.2). 0 maps to 0 exactly, so "off" survives
69
87
  * the conversion rather than becoming the dimmest on-level.
@@ -71,13 +89,32 @@ export declare const HUE_DEGREES_MAX = 360;
71
89
  export declare function percentToMatter(percent: number): number;
72
90
  /** Matter 0-254 → Indigo 0-100. Inverse of {@link percentToMatter} for all 101 inputs. */
73
91
  export declare function matterToPercent(level: number): number;
92
+ /**
93
+ * PowerSource's `batPercentRemaining`, in half-percent units (0-200), so 100%
94
+ * is 200 and the attribute can express a half-percent Indigo itself cannot.
95
+ */
96
+ export declare const BATTERY_REMAINING_MAX = 200;
97
+ /**
98
+ * §4.2 `batteryLevel` (1-100) → `batPercentRemaining` (0-200, half-percent
99
+ * units — 24% is 48). The clamp is load-bearing, not defensive: `endpoint.set`
100
+ * with a raw 201 throws a Matter `Constraint` error at 0.17.8 (measured, §0),
101
+ * and that would fail the whole `set_state`/`createEndpoint` write over one
102
+ * out-of-range battery reading rather than the residual state alongside it.
103
+ */
104
+ export declare function percentToBatteryRemaining(percent: number): number;
74
105
  /**
75
106
  * The value actually written to `currentLevel`.
76
107
  *
77
- * The Lighting feature constrains `currentLevel` to 1-254 on all four lighting
78
- * device types (verified against the 0.17.8 device definitions, which `alter`
79
- * the attribute to `min: 1`), so a literal 0 fails validation. Writing 1
80
- * instead is lossless at the protocol boundary: {@link matterToPercent}(1) is 0.
108
+ * The Lighting feature constrains `currentLevel` to 1-254 on every role this
109
+ * bridge builds — not because of a per-device-type `alter` (the three
110
+ * converted roles use a bare `.with("Lighting", "OnOff")`, which drops
111
+ * whatever `currentLevel` alter the stock device definitions carry), but
112
+ * because `LevelControlServer` itself derives `minLevel` as `1` whenever the
113
+ * Lighting feature is enabled and enforces `currentLevel` against it at
114
+ * construction (probed: matter.js 0.17.8 refuses anything else with "The
115
+ * minLevel value of 0 is invalid according to Matter specification"). So a
116
+ * literal 0 still fails validation, and writing 1 instead is still lossless
117
+ * at the protocol boundary: {@link matterToPercent}(1) is 0.
81
118
  *
82
119
  * Note that this does **not** also write OnOff false: {@link levelPatch} never
83
120
  * touches the OnOff cluster. Turning a light off at 0% is the plugin's call —
@@ -319,7 +356,7 @@ export declare function rejectedStateKeys(role: RoleValue, states: Record<string
319
356
  * running), so a newer plugin sending a key this bridge does not know yet
320
357
  * alongside keys it does must still apply the ones it understands.
321
358
  */
322
- export declare function applyStates(endpoint: Endpoint, role: RoleValue, states: Record<string, unknown>): Promise<void>;
359
+ export declare function applyStates(endpoint: Endpoint, role: RoleValue, states: Record<string, unknown>, hasBattery: boolean): Promise<void>;
323
360
  /** §3.5 / PRD §5.3 — `Reachable` tracks the Indigo device's enabled state. */
324
361
  export declare function applyReachable(endpoint: Endpoint, reachable: boolean): Promise<void>;
325
362
  /** §4.1 — `NodeLabel` follows the export's display name. */