Files
msm8916-openwrt/packages/configs-mifi/files/hotplugs/50-battery-show
T
Miguel Fuertes 104145900b Add battery monitoring and LED control features
- Implemented a battery-monitor service to track battery capacity and charging status, controlling LEDs accordingly.
- Created a battery status page in LuCI to display voltage, status, health, and estimated capacity.
- Added hotplug scripts to trigger battery status updates on power button presses and modem interface changes.
- Developed LED control scripts for modem and WiFi status indicators.
- Configured UCI defaults to enable WiFi and set up a modem interface with appropriate settings.
- Introduced a utility script for LED control with various actions (on, off, blink).
- Added a power button script for double-click shutdown functionality.
2025-10-22 11:30:28 +02:00

15 lines
427 B
Bash

#!/bin/sh
# /etc/hotplug.d/button/50-battery-show
[ "$BUTTON" = "power" ] || exit 0
[ "$ACTION" = "pressed" ] || exit 0
charging=$(cat /sys/class/power_supply/pm8916-lbc-chgr/online 2>/dev/null || echo 0)
if [ "$charging" = "0" ]; then
[ -f /var/run/battery-monitor.pid ] && {
kill -USR1 $(cat /var/run/battery-monitor.pid) 2>/dev/null
logger -t button-battery "SIGUSR1 sent to battery-monitor"
}
fi