Ignore 0% battery readings in low-battery alerting
CI / build + unit (pull_request) Successful in 1m18s

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.
This commit is contained in:
2026-10-06 08:02:37 +00:00
parent 84915fe314
commit 7ec97a06d2
4 changed files with 47 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "mesh-bot",
"version": "0.21.11",
"version": "0.21.12",
"description": "",
"author": "",
"private": true,