When I run the battery.GetAll() function, it gives me the following error:
panic: [{ChargeRate:read /sys/class/power_supply/BAT1/power_now: no such device}]
While I was tinkering, I found out that the ls command did show a file named power_now but opening it with cat gives the same error as above. On the other hand, I found out that there is another file called capacity which gives the battery level.
I am on Arch Linux and using go 1.21.6.
When I run the
battery.GetAll()function, it gives me the following error:While I was tinkering, I found out that the
lscommand did show a file namedpower_nowbut opening it withcatgives the same error as above. On the other hand, I found out that there is another file calledcapacitywhich gives the battery level.I am on Arch Linux and using
go 1.21.6.