-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add/unify decentlab devices #76
Conversation
Hello @decentlab, thank you for opening a Pull Request to add a public decoder. We appreciate your effort and contribution to the TagoIO IoT community. We will review your PR as soon as possible. |
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.
There are a few points that need to be corrected or improved:
- The images should have a transparent background.
- The
description.md
file serves as the subtitle displayed on the devices' screen.
a. This field is searchable. (When a user searches for a device on the platform, they use these words).
b. It is recommended thatdescription.md
be clear and focus on the specific capabilities and features of the device. - The new decoders added must be made in TypeScript and also add type annotation. E.g:
a. When changing the payload to TypeScript, don't forget to edit theconnector.jsonc
file topayload.ts
.
function toTagoFormat(object_item: {}, group: number, prefix: string = "") {
//...
}
- Each decoder must have unit tests. Here is an example of a unit test you can use.
a. If you can add a unit test for the payload parser, that would be great.
import { describe, test, expect } from "vitest";
import { decoderRun } from "../../../../../src/functions/decoder-run";
const file_path = "decoders/connector/your-path/payload.js" as const;
describe("Shall not be parsed", () => {
let payload = [{ variable: "shallnotpass", value: "04096113950292" }];
payload = decoderRun(file_path, { payload });
test("Output Result", () => {
expect(Array.isArray(payload)).toBe(true);
});
test("Not parsed Result", () => {
expect(payload).toEqual([{ variable: "shallnotpass", value: "04096113950292" }]);
});
});
Thanks for the review. We followed the existing payload decoders that were added by TagoIO. It would have been more efficient if we knew the different requirements before creating these decoders. Would it be possible to add the decoders now as it is, and we improve them iteratively? Some questions:
|
Thanks for considering to approve the decoders as they are now. We have added unit tests for the payload parsers. |
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.
Please remove the sensor name from all description.md files.
Additionally, ensure that the install_text contains only factual information about the device, avoiding any subjective phrases.
@Freddyminu, these have been done by TagoIO and we followed exactly how it was. Would it be possible if you approve this PR now, and we improve iteratively? Thanks. |
Decoder Description
Added all Decentlab device (connector) decoders from TTN repository.
Type of change
Decoder Information and Payload to test and review
Checklist for Adding a New Decoder
network.jsonc
orconnector.jsonc
file that follows the structure defined in./schema/
../decoders/network/
or./decoders/connector/
with the name of your decoder.manifest.jsonc
files for each version.Additional Notes
The existing decoders have been reverted back to the original TTN device repo version. This simplifies creating the decoders and makes sure that they uniformly work as expected over many platforms. Besides, the modifications made by TagoIO was mainly cosmetic, and there was no logic change.
We intentionally keep the decoders' syntax such that they're supported on most platforms with a minimal change.