From c0068da1047e6a4ad7df600a2fbbe313d54a8176 Mon Sep 17 00:00:00 2001 From: Teemu Peltonen Date: Thu, 1 Feb 2018 13:05:23 +0200 Subject: [PATCH] Fix HFP trains --- app/action/realTimeClientAction.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/action/realTimeClientAction.js b/app/action/realTimeClientAction.js index 9bd4781aea..e607e4bb90 100644 --- a/app/action/realTimeClientAction.js +++ b/app/action/realTimeClientAction.js @@ -1,5 +1,9 @@ import moment from 'moment'; +const modeTranslate = { + train: 'rail', +}; + // getTopic // Returns MQTT topic to be subscribed // Input: options - route, direction, tripStartTime are used to generate the topic @@ -50,7 +54,7 @@ function parseMessage(topic, message, actionContext) { parsedMessage.oday && parsedMessage.oday !== 'XXX' ? parsedMessage.oday : moment().format('YYYYMMDD'), - mode, + mode: modeTranslate[mode] ? modeTranslate[mode] : mode, delay: parsedMessage.dl, next_stop: nextStop, stop_index: parsedMessage.stop_index,