Closed roele closed 2 years ago
Looks good, but let's merge this after I finish up adding M1 HID sensors support, I'm halfway there.
Will keep improving the change meanwhile. I will try to add more tests etc.
quickly tested @roele's branch on my M1 Air, works like a charm!
This is a first draft to add support for multiple output formats via new output (
--o
) flag.The interface
Output
defines groups for sensors which need to be implemented. TheTableOutput
andJSONOutput
implement the interface. Thesmc
package returns information in form of amap[string]interface{}
for each specific group (instead of printing them directly). Finally the commands pass the output flag value into a factory method which returns the matching output on which the methods for printing are called.