Low-battery monitoring now ignores a 0% reading. A batteryLevel of 0 (or any non-positive value) is an invalid/no-data value — a node with no battery wired or a misconfigured node — not a genuinely critical battery, so it must not produce a ⚠️ battery low alert. Genuinely-low readings (1–20%) still alert exactly as before.
Code
src/battery/battery.service.ts — one-line guard in shouldAlert added right after the existing undefined check:
if(node.batteryLevel===undefined)returnfalse;// no battery reported — skip
if(node.batteryLevel<=0)returnfalse;// 0/invalid reading — no battery wired or misconfigured node, not a real low-battery alert
The threshold <=, cooldown, and single-batched-broadcast behavior are all unchanged.
Tests
Three new specs in the check threshold block of src/battery/battery.service.spec.ts:
a 0% node is excluded from the batch (a 5% node in the same batch still alerts);
a lone 0% reading sends no broadcast at all;
a 1% node (lowest valid value) is still alerted.
Existing check threshold / cooldown / end-to-end specs still pass.
Verification
npm run build → exit 0
npm test → 15 files / 183 tests passed (up from 180)
Version
v0.21.11 → v0.21.12 (patch); CHANGELOG.md entry added at the top.
## What changed
Low-battery monitoring now **ignores a 0% reading**. A `batteryLevel` of 0 (or any non-positive value) is an invalid/no-data value — a node with no battery wired or a misconfigured node — not a genuinely critical battery, so it must not produce a `⚠️ battery low` alert. Genuinely-low readings (1–20%) still alert exactly as before.
### Code
- `src/battery/battery.service.ts` — one-line guard in `shouldAlert` added right after the existing `undefined` check:
```ts
if (node.batteryLevel === undefined) return false; // no battery reported — skip
if (node.batteryLevel <= 0) return false; // 0/invalid reading — no battery wired or misconfigured node, not a real low-battery alert
```
The threshold `<=`, cooldown, and single-batched-broadcast behavior are all unchanged.
### Tests
Three new specs in the `check threshold` block of `src/battery/battery.service.spec.ts`:
- a **0%** node is excluded from the batch (a 5% node in the same batch still alerts);
- a **lone 0%** reading sends no broadcast at all;
- a **1%** node (lowest valid value) is still alerted.
Existing `check threshold` / cooldown / end-to-end specs still pass.
## Verification
- `npm run build` → exit 0
- `npm test` → 15 files / 183 tests passed (up from 180)
## Version
v0.21.11 → v0.21.12 (patch); `CHANGELOG.md` entry added at the top.
A 0% batteryLevel is an invalid/no-data value (no battery wired or
misconfigured node), not a genuinely critical battery, so it must not
produce a "⚠️ battery low" alert. Add a non-positive guard to
shouldAlert after the undefined check: 0 (and any non-positive) now
skips, while 1-20 still alert and >20 still doesn't. Threshold/cooldown/
batching unchanged.
Tests: 3 new specs in the check-threshold block (0% excluded from the
batch, lone 0% sends nothing, 1% still alerts). 180 -> 183.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What changed
Low-battery monitoring now ignores a 0% reading. A
batteryLevelof 0 (or any non-positive value) is an invalid/no-data value — a node with no battery wired or a misconfigured node — not a genuinely critical battery, so it must not produce a⚠️ battery lowalert. Genuinely-low readings (1–20%) still alert exactly as before.Code
src/battery/battery.service.ts— one-line guard inshouldAlertadded right after the existingundefinedcheck:<=, cooldown, and single-batched-broadcast behavior are all unchanged.Tests
Three new specs in the
check thresholdblock ofsrc/battery/battery.service.spec.ts:Existing
check threshold/ cooldown / end-to-end specs still pass.Verification
npm run build→ exit 0npm test→ 15 files / 183 tests passed (up from 180)Version
v0.21.11 → v0.21.12 (patch);
CHANGELOG.mdentry added at the top.A 0% batteryLevel is an invalid/no-data value (no battery wired or misconfigured node), not a genuinely critical battery, so it must not produce a "⚠️ battery low" alert. Add a non-positive guard to shouldAlert after the undefined check: 0 (and any non-positive) now skips, while 1-20 still alert and >20 still doesn't. Threshold/cooldown/ batching unchanged. Tests: 3 new specs in the check-threshold block (0% excluded from the batch, lone 0% sends nothing, 1% still alerts). 180 -> 183.