fleetmap-reports 1.0.975 → 1.0.976
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/package.json +1 -1
- package/src/trip-report.js +10 -6
package/package.json
CHANGED
package/src/trip-report.js
CHANGED
|
@@ -180,12 +180,16 @@ async function processDevices (from, to, devices, data, userData, traccar) {
|
|
|
180
180
|
|
|
181
181
|
if (userData.includeTemperature) {
|
|
182
182
|
const tripRoute = deviceRoute.filter(p => trip.startTime <= p.fixTime && trip.endTime >= p.fixTime && p.attributes.temp1 !== 175)
|
|
183
|
-
trip.maxTemp = tripRoute.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
183
|
+
trip.maxTemp = tripRoute.length > 0
|
|
184
|
+
? tripRoute.reduce((a, b) => {
|
|
185
|
+
return a && a > b.attributes.temp1 ? a : b.attributes.temp1
|
|
186
|
+
})
|
|
187
|
+
: 0
|
|
188
|
+
trip.minTemp = tripRoute.length > 0
|
|
189
|
+
? tripRoute.reduce((a, b) => {
|
|
190
|
+
return a && a < b.attributes.temp1 ? a : b.attributes.temp1
|
|
191
|
+
})
|
|
192
|
+
: 0
|
|
189
193
|
trip.avgTemp = tripRoute.length > 0
|
|
190
194
|
? (tripRoute.reduce((a, b) => {
|
|
191
195
|
return a + b.attributes.temp1
|