Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increased battery usage when using the update.sh diff #132

Open
avhm opened this issue Sep 26, 2024 · 0 comments
Open

Increased battery usage when using the update.sh diff #132

avhm opened this issue Sep 26, 2024 · 0 comments

Comments

@avhm
Copy link
Contributor

avhm commented Sep 26, 2024

Not entirely sure where the bug lies here, but using the provided update.sh diff to append the current battery level to the webhook causes the battery life of the kindle to be cut in half (at minimum).

This happens for me on two different kindles (both PW4), both with new batteries.

...
if [ 1 -eq $CONNECTED ]; then
-     if wget -q $IMAGE_URI -O $TMPFILE; then
+     batteryLevel=`/usr/bin/powerd_test -s | awk -F: '/Battery Level/ {print substr($2, 0, length($2)-1) - 0}'`
+     isCharging=`/usr/bin/powerd_test -s | awk -F: '/Charging/ {print substr($2,2,length($2))}'`
+     if wget -q "$IMAGE_URI?batteryLevel=$batteryLevel&isCharging=$isCharging" -O $TMPFILE; then
        mv $TMPFILE $SCREENSAVERFILE
        logger "Screen saver image updated"
...

I'm unclear if this is an issue with my particular KUAL cocktail, but I'm curious if anyone else is seeing this issue?

If so, updating once per day or similar might be a good balance, reading/storing the 'sent' state in an env variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant