Open Mistikan opened 1 year ago
That reading a file causes charging to stop seems like a odd design choice...
That being said, right now we naively try to open all files and I don't get why.. https://github.com/prometheus/procfs/blob/master/sysfs/class_power_supply.go#L142 I've asked on the PR that implemented this functionality.
@discordianfish Please correct me if I'm wrong but I believe even after fixing https://github.com/prometheus/procfs/pull/178#discussion_r1012799750, i.e., not opening a file that's not read, we'd still have to figure out a way to extract this information somehow.
Charge issues after a read-only operation is indeed a strange design by all means.
Host operating system: output of
uname -a
node_exporter version: output of
node_exporter --version
and
node_exporter command line flags
node_exporter log output
Are you running node_exporter in Docker?
No.
What did you do that produced an error?
What did you expect to see?
Node exporter read files StartCharging_Test, StopCharging_Test in a directory /sys/class/power_supply/battery/. This caused the charging to start and stop on my device Xiaomi Santoni (postMarketOS)
Dmesg log
Battery directory
What did you see instead?
Node exporter will not read these files, thus it will not switch the charging mode.
Temporary solution
Disable powersupplyclass with option
--no-collector.powersupplyclass
Links
Kernel StopChargingTest