Skip to content

Commit 568b4b2

Browse files
committed
Reduce walk
1 parent 98365da commit 568b4b2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

app/controllers/ngsi-ld/animal.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ async function getAnimals(req, res) {
2020
},
2121
headers
2222
);
23+
if(animals && animals.features){
24+
animals.features.forEach((animal) => {
25+
animal.properties.id = animal.id;
26+
});
27+
delete animals['@context'];
28+
}
2329

24-
animals.features.forEach((animal) => {
25-
animal.properties.id = animal.id;
26-
});
27-
28-
delete animals['@context'];
2930
return res.send(animals);
3031
}
3132

iot-devices/models/devices.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,12 @@ function sendTractorReadings() {
272272
function addAndTrim(value, add, weather) {
273273
let newValue;
274274
if (weather === 'sunny') {
275-
newValue = add ? parseFloat(value) + 0.003 : parseFloat(value) - 0.003;
275+
newValue = add ? parseFloat(value) + 0.0007 : parseFloat(value) - 0.0007;
276276
} else {
277-
newValue = add ? parseFloat(value) + 0.001 : parseFloat(value) - 0.001;
277+
newValue = add ? parseFloat(value) + 0.0003 : parseFloat(value) - 0.0003;
278278
}
279279

280-
return Math.round(newValue * 1000) / 1000;
280+
return Math.round(newValue * 10000) / 10000;
281281
}
282282

283283
function randomWalk(state, deviceId, lng, lat) {

0 commit comments

Comments
 (0)