gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Feature request: Get battery state

Open elvarb opened this issue 6 years ago • 4 comments
trafficstars

Is your feature request related to a problem? Please describe. I have in the past used https://github.com/distatus/battery to get battery status on laptops but that is only for getting battery information. To add that feature here would mean fewer dependencies.

Describe the solution you'd like Similar features as distatus/battery but in line with the formatting of gopsutil

Describe alternatives you've considered Only thing I have found is distatus/battery

elvarb avatar Jun 14 '19 17:06 elvarb

Sure it would be a logical step compared to what OS statistics gopsutil is already able to return, but I think we already have a large API and few contributors to support it so adding this one (while this other package is well maintained) might not be so wise…

Lomanic avatar Jun 15 '19 09:06 Lomanic

Makes sense, I was just checking out Gotop and saw that it uses distatus/battery, so that package is very well known. Would it be possible to way forward to just add that package to gopsutil for this feature? just mainly to unify the api access

elvarb avatar Jun 16 '19 21:06 elvarb

Implementing new battery-related functions (in host package probably, like the SensorsTemperatures functions), while offloading implementation to distatus/battery, is doable indeed.

Lomanic avatar Jun 17 '19 19:06 Lomanic

As @Lomanic said, we have a few contributors and actually, I am very tough schedule in these months. (I always thank @Lomanic ) But, if you make a PR which implement battery in host package, we can merge it. A contribution is always welcome!

shirou avatar Jun 27 '19 14:06 shirou