diff --git a/src/index.js b/src/index.js index 0c5edf1ba27ad381ff99a802e3b2a55d3f0e7d1a..61d8d58499b1e939b8a55838379d7346ef046d47 100644 --- a/src/index.js +++ b/src/index.js @@ -93,11 +93,12 @@ async function getData(response) { throw new Error(errors.VENDOR_DOWN) } } + function format(response) { - const data = response.resultatRetour.map(value => { + const data = response.resultatRetour.slice(1).map((value, index) => { return { time: moment(value.DateReleve, moment.ISO_8601).format('YYYY-MM-DD'), - load: value.ValeurIndex, + load: value.ValeurIndex - response.resultatRetour[index].ValeurIndex, type: value.TypeAgregat } })