-
Notifications
You must be signed in to change notification settings - Fork 11
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
Remove empty "object" variable from payload.js #89
Conversation
Can you provide the JSON of the Chirpstack payload you're proposing to fix with this PR ? |
"object":{"Bat_V":3.312,"DATALOG":"[5.99],[5.99],[0.00],[0.00],"}
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like object can be sent as customized payload from Chirpstack.
I'd rather prefer to parse the Object parameter with the toTagoFormat,
if (chirpstack_payload.object) {
vars_to_tago = vars_to_tago.concat(toTagoFormat(chirpstack_payload.object, serie));
delete chirpstack_payload.object;
}
Also, as you're updating this connector, also ensure to update the "serie" to "group"
… generate new variables.
Decoder Description
Adding removal of the empty "object" key. An empty object key is generated by the toTagoFormat function whenever chirpstack sends a multi leveled json of decoded data from their CODEC.
Added the removal of the object key if its value is empty since this causes connectors to fail.
Type of change
Decoder Information and Payload to test and review
Checklist for Adding a New Decoder
./decoders/network/
or./decoders/connector/
with the name of your decoder.network.jsonc
orconnector.jsonc
file that follows the structure defined in./schema/
.manifest.jsonc
files for each version.Additional Notes
Please add any other information that you think is important.