Commit Graph
2 Commits
Author SHA1 Message Date
shenandshen 23989f4a18 feat(battery): implement emergency safe shutdown when battery <= 5% discharging
Offline project checks / check (push) Canceled after 0s
- Add should_shutdown() check in BatteryPolicy and trigger_shutdown() in phone-battery-guard.py.
- Auto sync filesystems and invoke safe poweroff if SoC drops to 5% while on battery/discharging.
- Do not power off if external charger is actively connected and charging.
- Update openrc service command args with --shutdown-at 5.
- Add unit tests for emergency shutdown, discharging detection, and threshold validation.
2026-11-08 05:32:04 -08:00
shenandshen db9d190d7b feat(battery): enhance battery guard with thermal runaway protection and openrc service
- Add max_temp thermal protection with 3°C hysteresis to prevent high-temp battery swelling.
- Provide scripts/phone-battery-guard.openrc for automated OpenRC service management.
- Update tests/test_battery_guard.py with thermal throttling tests.
2026-11-08 05:26:21 -08:00