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

"tuya-cli get" produces a json string that does not conform to standard #153

Open
timo12357 opened this issue Feb 2, 2023 · 2 comments
Open

Comments

@timo12357
Copy link

timo12357 commented Feb 2, 2023

When using tuya-cli to read status of zigbee sensors behind a gateway like this:

tuya-cli get --ip 192.168.0.114 --id bf82mostofitremoved --key 322fmostofitremoved --cid a4c1mostofitremoved --protocol-version 3.3

it produces an output like this:

{ '1': 173, '2': 249, '4': 100 }

JSON does only allow double quotes. And so does the JSONPath Online Evaluation.

https://www.json.org/json-en.html#:~:text=wrapped%20in%20double%20quotes

It seems like the tuya-cli output would benefit from using double quotes, too?

@codetheweb
Copy link
Member

Yes, happy to accept a PR to fix this.

@duanemay
Copy link

duanemay commented Dec 3, 2024

sed -e "s/'/\"/g;s/,\([ \n]*\)}$/\1}/;s/}\"/}/"

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

No branches or pull requests

3 participants