changesd in iot device data

master
varun 1 year ago
parent d783185e69
commit a00a33c6a8

@ -1749,7 +1749,8 @@ exports.IotDevice = async (req, reply) => {
const tank_height = parseInt(tank_height1.toFixed(0), 10); // Ensure it's an integer const tank_height = parseInt(tank_height1.toFixed(0), 10); // Ensure it's an integer
const water_level_height = tank_height - tankHeight; const water_level_height = tank_height - tankHeight;
const waterCapacityPerCm = parseInt(existingTank.waterCapacityPerCm.replace(/,/g, ''), 10); const waterCapacityPerCm = parseInt(existingTank.waterCapacityPerCm.replace(/,/g, ''), 10);
const water_level = water_level_height * waterCapacityPerCm;
const water_level = parseInt(water_level_height * waterCapacityPerCm, 10);
if (water_level >= 0) { if (water_level >= 0) {
existingTank.waterlevel = water_level; existingTank.waterlevel = water_level;

@ -271,7 +271,7 @@ module.exports = function (fastify, opts, next) {
method: "POST", method: "POST",
url: "/api/addBores/:InstallerId", url: "/api/addBores/:InstallerId",
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
description: "This is to cretae New Bore", description: "This is to cretae New Bore",
summary: "This is to Create New Bore.", summary: "This is to Create New Bore.",
params: { params: {
@ -386,7 +386,7 @@ module.exports = function (fastify, opts, next) {
fastify.get("/api/getBoresbyInstaller", { fastify.get("/api/getBoresbyInstaller", {
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
description: "This is for Get Bore Data of Installer", description: "This is for Get Bore Data of Installer",
summary: "This is for to Get Bore Data of installer", summary: "This is for to Get Bore Data of installer",
querystring: { querystring: {

@ -8,7 +8,7 @@ module.exports = function (fastify, opts, next) {
method: "POST", method: "POST",
url: "/api/addTanks/:InstallerId", url: "/api/addTanks/:InstallerId",
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
description: "This is for cretae New Tank", description: "This is for cretae New Tank",
summary: "This is for Create New Tank.", summary: "This is for Create New Tank.",
params: { params: {
@ -55,7 +55,7 @@ module.exports = function (fastify, opts, next) {
method: "PUT", method: "PUT",
url: "/api/updateTanks/:InstallerId", url: "/api/updateTanks/:InstallerId",
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
summary: "This is for update tank", summary: "This is for update tank",
params: { params: {
required: ["InstallerId"], required: ["InstallerId"],
@ -103,7 +103,7 @@ module.exports = function (fastify, opts, next) {
method: "PUT", method: "PUT",
url: "/api/deleteTank/:InstallerId", url: "/api/deleteTank/:InstallerId",
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
summary: "This is for delete tank", summary: "This is for delete tank",
params: { params: {
required: ["InstallerId"], required: ["InstallerId"],
@ -199,7 +199,7 @@ module.exports = function (fastify, opts, next) {
fastify.get("/api/getTanksofParticularInstaller", { fastify.get("/api/getTanksofParticularInstaller", {
schema: { schema: {
tags: ["Tank"], tags: ["Install"],
description: "This is to Get Tank Data of Installer", description: "This is to Get Tank Data of Installer",
summary: "This is to Get Tank Data of Installer", summary: "This is to Get Tank Data of Installer",

Loading…
Cancel
Save