psutil icon indicating copy to clipboard operation
psutil copied to clipboard

Exclude external batteries from sensors_battery

Open RodoMa92 opened this issue 2 years ago • 2 comments

Summary

  • OS: Linux
  • Bug fix: yes
  • Type: core

Description

The single check for battery in power_supply was causing sometimes to grab external device battery statuses since they have the form of hid_<mac>_battery, which match the bat filter.

However they do not have an ACPI path to the system itself.

This takes into account that detail and properly exclude them from being included as an internal battery.

RodoMa92 avatar Sep 13 '23 09:09 RodoMa92

@RodoMa92 @giampaolo if this only requires signing the commit, can we get this pushed through?

jardon avatar Aug 21 '24 13:08 jardon

@RodoMa92 @giampaolo if this only requires signing the commit, can we get this pushed through?

I'm not sure if this will not break under other platforms like arm, so it should be properly tested before a merge. Might not behave like on x86, but I do not have such hardware available to me.

RodoMa92 avatar Aug 24 '24 13:08 RodoMa92