mqtt-devices-parser 1.0.22 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.23
4
+ src/device/device: fix tech, version and app_version db update
5
+ npm warn audit Updating websocket-stream to 5.3.0, which is a SemVer major change.
6
+
3
7
  ## 1.0.22
4
8
  Adds SSL and SASL support for kafka
5
9
  mqtt.parseMessages removed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mqtt-devices-parser",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -308,14 +308,14 @@ async function parseMqttMessage(client, project_name, device, topic, payload, re
308
308
  return;
309
309
  break;
310
310
  case "tech":
311
- if (device?.tech && payload != device.tech) {
311
+ if (payload != null && payload != device?.tech) {
312
312
  $.db_device.update(device.id, "tech", payload);
313
313
  $.db_device.addLog(device.id,"tech",payload);
314
314
  }
315
315
  return;
316
316
  break;
317
317
  case "version":
318
- if (device?.version && payload != device.version) {
318
+ if (payload != null && payload != device?.version) {
319
319
  $.db_device.addLog(device.id,"version",payload);
320
320
  $.db_device.update(device.id, "version", payload);
321
321
  handleFotaSuccess(device.id);
@@ -323,7 +323,7 @@ async function parseMqttMessage(client, project_name, device, topic, payload, re
323
323
  return;
324
324
  break;
325
325
  case "app_version":
326
- if (device?.app_version && payload != device.app_version) {
326
+ if (payload != null && payload != device?.app_version) {
327
327
  $.db_device.addLog(device.id,"app_version",payload);
328
328
  $.db_device.update(device.id, "app_version", payload);
329
329
  handleFotaSuccess(device.id);