by Ricardo Fernández Serrata
Sounds an alarm when device is charging but battery is still draining. It also detects if the charger is connecting/disconnecting very frequently ("flickering charger").
Useful if you have a problematic charger head, cable, port (hole), wireless coil and/or an app is power-hungry.
The value at the dictionary key "current_now" (from BATTERY_CHANGED broadcast) isn't available on some devices, so I didn't use that broadcast because I wanted to increase portability. Also, that broadcast isn't reliable if the charger is "flickering".
"Why is `old` the entire range?"
Please read this: https://groups.google.com/g/automate-user/c/yoVs-ZLVMLo
Rate and review within the app in the Community section.