Open Chewie9999 opened 3 years ago
@Chewie9999 Oh... thanks... I'll fix it!
@Chewie9999 Sorry! I want to make this python driver to return all status with dict
object. I've added example code to parse as JSON into README like below. I want you to agree with the spec.
$ python -c "from tsmppt60_driver import *; import json; print(json.dumps(SystemStatus('192.168.1.20').get()))" | jq '."Battery Voltage"'
{
"group": "Battery",
"value": 28.6,
"unit": "V"
}
@Chewie9999 Sorry! I want to make this python driver to return all status with
dict
object. I've added example code to parse as JSON into README like below. I want you to agree with the spec.$ python -c "from tsmppt60_driver import *; import json; print(json.dumps(SystemStatus('192.168.1.20').get()))" | jq '."Battery Voltage"' { "group": "Battery", "value": 28.6, "unit": "V" }
That's fine with me! I've not started using it in other programs yet. Thank you!
I just tried to parse the output with "jq", and it doesn't like single quotes around the text strings. According to the JSON Specification, they should be double quotes. This is probably something I can fix myself easily, I just thought I should let you know. Thanks!