Detecting when charging and discharging
#1
I tried using /sys/class/power_supply/axp20x-battery/status to deduce whether my phone was in charging or discharging mode. My goal is to write a script that can notify me when electricity is out. However, it seems that status goes to Discharging when it reaches 100%. Is there another way I can detect if I have a power cable with electricity plugged in to my device that works better than checking the status on the battery as I do above?
  Reply


Messages In This Thread
Detecting when charging and discharging - by phobios - 12-04-2023, 01:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  /dev and etcher not detecting pinephone for writing pineuser0 2 2,423 09-13-2021, 03:10 PM
Last Post: pineuser0

Forum Jump:


Users browsing this thread: 1 Guest(s)