Skip to content

Commit 782532e

Browse files
committed
luci-mod-battstatus: Add photonicat2 support
Add photonicat2 support with kmod-photonicat-pm Signed-off-by: Jason Zou <jasonforhise@outlook.com>
1 parent b4ac9a6 commit 782532e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

modules/luci-mod-battstatus/root/usr/libexec/rpcd/luci.battstatus

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ case "$1" in
2626
json_add_string message "Need pcat-mgr"
2727
fi
2828
;;
29+
ariaboard,photonicat2)
30+
if [ -d /sys/class/power_supply/battery ]; then
31+
json_add_boolean valid 1
32+
json_add_boolean charging $(cat /sys/class/power_supply/charger/online)
33+
json_add_int percentage $(cat /sys/class/power_supply/battery/capacity)
34+
else
35+
json_add_boolean valid 0
36+
json_add_string message "Need kmod-photonicat-pm"
37+
fi
38+
;;
2939
hootoo,ht-tm05)
3040
if [ -f /usr/sbin/i2cset ] && [ -f /usr/sbin/i2cget ]; then
3141
json_add_boolean valid 1

0 commit comments

Comments
 (0)