Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug! JSON output text strings should use double quotes, not single #11

Open
Chewie9999 opened this issue Apr 14, 2021 · 3 comments
Open
Assignees
Labels

Comments

@Chewie9999
Copy link

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!

@dodo5522 dodo5522 changed the title Bug? JSON output text strings should use double quotes, not single Bug! JSON output text strings should use double quotes, not single Apr 14, 2021
@dodo5522 dodo5522 self-assigned this Apr 14, 2021
@dodo5522
Copy link
Owner

@Chewie9999 Oh... thanks... I'll fix it!

@dodo5522
Copy link
Owner

dodo5522 commented Apr 18, 2021

@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"
}

@dodo5522 dodo5522 assigned Chewie9999 and unassigned dodo5522 Apr 18, 2021
@Chewie9999
Copy link
Author

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants