While on battery (AC0/online=0), sends escalating Pushover alerts at 25/20/15% and at 10% sends a final alert then `systemctl poweroff` (after shutdown_grace so the alert flushes first). Edge-triggered per discharge episode; re-arms when mains returns; plug-out already-low collapses to a single alert (no burst). Pushover token+user live only in /etc/van-battery/pushover.json (0600), seeded from pushover.json.example on first deploy and never committed. Missing/ placeholder creds disable sending but NOT the shutdown — running flat must always power down safely. Publishes /run/van-battery/state.json. Stdlib only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
10 lines
261 B
JSON
10 lines
261 B
JSON
{
|
|
"poll_interval": 30,
|
|
"ac_path": "/sys/class/power_supply/AC0/online",
|
|
"battery_path": "/sys/class/power_supply/BAT0",
|
|
"warn_levels": [25, 20, 15],
|
|
"shutdown_level": 10,
|
|
"shutdown_grace": 8,
|
|
"credentials_path": "/etc/van-battery/pushover.json"
|
|
}
|