Commit ed3df3e9 by Martin Kotula

Adjusted to sensor contract

parent 14eab3de
...@@ -18,14 +18,14 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post ...@@ -18,14 +18,14 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post
console.debug("Mqtt message received: " + message.toString()); console.debug("Mqtt message received: " + message.toString());
var messageBody = JSON.parse(message.toString()); var messageBody = JSON.parse(message.toString());
if(messageBody.object === undefined || if(messageBody.object === undefined ||
messageBody.object.sensorid === undefined || messageBody.object.sensorId === undefined ||
messageBody.object.isbusy === undefined ){ messageBody.object.isBusy === undefined ){
throw "InvalidMessageFormat"; throw "InvalidMessageFormat";
} }
var model = { var model = {
id: messageBody.object.sensorid, id: messageBody.object.sensorId,
isOccupied: messaegeBody.object.isbusy, isOccupied: messaegeBody.object.isBusy,
timestamp: new Date() timestamp: new Date()
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment