In the select_job function, set M.method to a string representing the method used to collect information (nil if none of them work), so that in the health module, you could do something like
local method = require("battery.battery").method
if method then
ok("Battery info retrieval method: " .. method)
else
error("No battery info retrieval method")
end
(
lua/battery/health/health.lua
line 8)Possible implementation:
In the
select_job
function, setM.method
to a string representing the method used to collect information (nil
if none of them work), so that in the health module, you could do something like