Closed tenox7 closed 1 year ago
That would require all output to be radically different, having unit in separate field (or column, depending on output type). While it is perfectly doable, it would break compatibility for everyone already using iSMC outputs for whatever reason..
sorry I just added this to my original comment as well :)
ok so maybe we can have two values, one as string, for compatibility and a new one as other type?
"PMU vbuck5": {
"key": "",
"type": "hid",
"value": "16.15 V", // unchanged
"float": 16.15, // new
"unit": "V" // new
},
this would not break existing schema / clients
parsing "28.20 °C" in Go while unmarshalling Json is absolutely hideous, requires 10 lines of code, you need to split it in to fields by space then go through strconv.ParseFloat(slice[0]), error check each step 😭
Done in https://github.com/dkorunic/iSMC/releases/tag/v0.7.0, closing.
Thank you!
could you please make
-o json
return values in float or int (for rpm) instead all string? it's really troubling to parse string in to float from supposed to be better than ascii format... :)in addition, instead of
the °C or V or RPM should be another field in json, for example "unit"
thank you!