direc85 / harbour-batterybuddy

Battery level alert for Sailfish OS
GNU General Public License v3.0
8 stars 8 forks source link

Implement battery temperature and health #42

Closed direc85 closed 3 years ago

direc85 commented 3 years ago

Verify functionality on different devices:

direc85 commented 3 years ago

Work started in #40

direc85 commented 3 years ago

@nephros tested the file with Xperia X10, I tested it with Xperia XA2 (Ultra) - ticked two boxes more.

nephros commented 3 years ago

@nephros tested the file with Xperia X10, I tested it with Xperia XA2 (Ultra) - ticked two boxes more.

Nice! I develop on Xperia 10, so that should usually work. I can also test on Gemini, but as that doesn't have the charge control feature AFAIK that's of little use.

nephros commented 3 years ago

possibility to check box number 3 in #43

nephros commented 3 years ago

Just leaving a note here so I don't forget:

On Xperia10 there is /sys/class/power_supply/bms (Battery Management/Monitoring System??), which has these:

temp_cold
temp_cool
temp_hot
temp_warm

Which seem to set the thresholds for the "health" reporting. Could be used (they are writable), but I'm not sure it's smart to expose them to users.

Anyway, they do help with testing the health alert :)

direc85 commented 3 years ago

It really is not a good idea to let users set the tresholds, but nice to know those exist :)

direc85 commented 3 years ago

The health and temperature files fortunately are in the same location across my devices (Jolla, X, XA2) and X10, too! Release gets closer and closer :)

The bad news is that Notification.setSound doesn't exist in only in SFOS 4.0 and later, so I'll have to create a separate branch for the older releases. I'm considering SFOS 3.0, because I just can't get the app sdk installing SFOS 2.2 build engine any more...

direc85 commented 3 years ago

Well, I ended up using defines and conditional compiling to reach that goal. I decided to use the legacy code path for SFOS 4 releases, too, since it still works fine (although I still feel it's a bit of a hack...)

Released in commit 1dd00da