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.
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/sbin/openrc-run
|
||||
description="Platina battery health and anti-swelling daemon (maintains 50-65% SoC)"
|
||||
command="/usr/local/sbin/platina-battery-guard"
|
||||
command_user="root:root"
|
||||
command_args="--low ${low:-50} --high ${high:-65} --max-temp ${max_temp:-45} --interval ${interval:-60}"
|
||||
command_background="yes"
|
||||
pidfile="/run/platina-battery-guard.pid"
|
||||
output_log="/var/log/platina-battery-guard.log"
|
||||
error_log="/var/log/platina-battery-guard.log"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after udev-trigger
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --file --mode 0640 --owner root:root "$output_log"
|
||||
}
|
||||
Reference in New Issue
Block a user