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

Handle charge_full and energy_full not available #2

Merged
merged 1 commit into from Jan 29, 2021

Conversation

sdgathman
Copy link
Contributor

This just handles a specific device, pine64. What really needs to happen is to make the charge_full a configured item for devices that don't supply the information. The battery driver supplies percentage of charge remaining in capacity, but no charge_full or energy_full.

This just handles a specific device, pine64.  What really needs to happen is to make the charge_full a configured item for devices that don't supply the information.
@sdgathman
Copy link
Contributor Author

I tested and found the battery window entirely accurate with this patch on my pine64. Of course, since charge_full is hardwired to 10000, it has limited utility on other devices triggering the condition.

@sdgathman
Copy link
Contributor Author

sdgathman commented Aug 12, 2019

Is this really a bug in the battery driver? Maybe charge_full is something that should be provided in the device tree for ARM devices?

Otherwise, I can manually edit ~/.config/lxpanel/LXDE/panels and add ChargeFull to the batt plugin and code to batt.c to read it. Someone else can add it to the gui - although if only a few devices are like this, it might be clutter in the gui. The config_settings seem to be for the GUI only, however. It seems like mixing levels to add ChargeFull there.

@LStranger
Copy link
Member

Looks fine. Let hope it will not break other laptops indication.
Thank you very much. Going to merge it.

@LStranger LStranger merged commit 233c65c into lxde:master Jan 29, 2021
@sdgathman
Copy link
Contributor Author

sdgathman commented Jan 30, 2021

I put the battery status logic in a python cli script, which I run on half a dozen devices to ensure it works on them all (all with slightly different data available from hardware driver). Does it seem worthwhile to try to update lxpanel to support the additional devices? I only run LXDE on one device currently (a Pinebook with only 2G ram).

On other devices, I just run the script in a panel applet that displays the output of a command.

https://github.com/sdgathman/batt

@sdgathman sdgathman deleted the patch-1 branch January 30, 2021 16:02
@sdgathman
Copy link
Contributor Author

sdgathman commented Jan 30, 2021

So with the additional testing coverage from the python script above, hardwiring 10000mAh is not a good idea. We need to provide a config entry. For the time being, it can be just for that value. I did discover that some models do not provide charge_full_design, but do provide energy_full_design. (And calculating one from the other requires some voltage data, hence the need for voltage_max and voltage_min.)

@LStranger
Copy link
Member

LStranger commented Jan 31, 2021 via email

@sdgathman
Copy link
Contributor Author

Fun. HP Elitebook does not provide current_now. You have to keep a history of charge_now and estimate it yourself. So the applet is going to have to have state. Possibly in memory is good enough.

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

Successfully merging this pull request may close these issues.

None yet

2 participants