mqtt-devices-parser 1.0.7 → 1.0.8

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,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.8
4
+ - removes port from link to update fw devices
5
+
3
6
  ## 1.0.7
4
7
  - config/index: changes local IP
5
8
  - src/db/firmware: changes query to get latest fw release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mqtt-devices-parser",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -84,7 +84,7 @@ var self = module.exports = {
84
84
  await $.db_device.updateTech(uid,payload);
85
85
  }else if(topic.endsWith("fw_version")){
86
86
  let fw_version = await $.db.getFieldFromDeviceId(project_name,device.id,"fw_version");
87
- if(fw_version == payload)
87
+ if(fw_version != payload)
88
88
  await $.db_data.update(project_name,device.id,"fota_tries",1); // ! 0 is not working..
89
89
  }else if(topic.endsWith("app_version")){
90
90
  let app_version = await $.db.getFieldFromDeviceId(project_name,device.id,"app_version");
@@ -110,7 +110,7 @@ var self = module.exports = {
110
110
  return;
111
111
 
112
112
  let mqtt_prefix = `${project_name}/${uid}`;
113
- let link = `${$.config.web.protocol}${$.config.web.domain}:${$.config.web.port}${$.config.web.fw_path}${new_firmware.filename}/download?token=${new_firmware.token}`;
113
+ let link = `${$.config.web.protocol}${$.config.web.domain}${$.config.web.fw_path}${new_firmware.filename}/download?token=${new_firmware.token}`;
114
114
 
115
115
  if(new_firmware != null && semver.lt(fw_version, new_firmware.fw_version)) {
116
116
  console.log(`updating firmware of ${uid} to ${new_firmware.fw_version}`);