- 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.
19 lines
582 B
Plaintext
Executable File
19 lines
582 B
Plaintext
Executable File
#!/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"
|
|
}
|