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

TCORE-234 Back Clean up #87

Merged
merged 4 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/mysql/src/Database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ export async function setupKnex(this: DatabaseModule, config: Config) {
try {
this.showMessage("info", "Testing connection");

if (!config.main_read_host && !config.main_read_port) {
return;
}

setupConnections(config);

await testDatabaseConnection();
Expand Down
9 changes: 7 additions & 2 deletions plugins/network-helium/src/Services/uplink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ async function uplinkService(
const downlinkString = deviceParams.find(
(param) => param.key === "downlink_string",
);

if (!downlinkString) {
deviceParams.push({
key: "downlink_string",
Expand All @@ -100,8 +101,12 @@ async function uplinkService(
});

core.setDeviceParams(device.id, deviceParams);
} else if (downlinkString.value !== data.downlink_string) {
downlinkString.value = data.downlink_string as string;
} else if (
downlinkString.value !== data.downlink_string ||
downlinkString.value !== data.downlink_url
) {
downlinkString.value =
(data.downlink_string as string) || (data.downlink_url as string);
core.setDeviceParams(device.id, deviceParams);
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/nodered/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ To install Node-RED on your machine, follow this tutorial that Node-RED provided

## Install Node TagoIO out on Node-RED:

To install TagoIO out node on Node-RED, click in `more options`, `manage pallet`, abd search for `TagoIO out` on the `Install”` tab and click in install. When installing is finished, the TagoIO out node will appear on the “Nodes” tab.
To install TagoIO out node on Node-RED, click in `more options`, `manage pallet`, and search for `node-red-tagocore` on the `Install”` tab and click in install. When installing is finished, the TagoIO out node will appear on the “Nodes” tab.

You can check the full process in the [Node-RED documentation](https://Node-RED.org/docs/user-guide/runtime/adding-nodes).

Expand Down
4 changes: 4 additions & 0 deletions plugins/postgres/src/Database/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ async function setupKnex(this: DatabaseModule, config: Config) {
try {
this.showMessage("info", "Testing connection");

if (!config.main_read_host && !config.main_read_port) {
return;
}

setupConnections(config);

await testDatabaseConnection();
Expand Down
13 changes: 11 additions & 2 deletions plugins/rabbitmq/src/consume-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@ function consumeData(msg: ConsumeMessage | null): void {
return;
}

const data = JSON.parse(msg.content.toString());
const deviceID = msg.properties.messageId;
let deviceID: string;
let data: any;

try {
data = JSON.parse(msg.content.toString());
deviceID = msg.properties.messageId;
} catch (e) {
console.error(`ERROR: ${e.message}`);
consumer.reject(msg, false);
return;
}

core
.addDeviceData(deviceID, data, { forceDBInsert: true })
Expand Down
Loading