Commit 6b0f3413 by Martin Kotula

Sensor config adjustments

parent 3daa756b
...@@ -6,7 +6,6 @@ using System.Threading.Tasks; ...@@ -6,7 +6,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json; using Newtonsoft.Json;
using uPLibrary.Networking.M2Mqtt; using uPLibrary.Networking.M2Mqtt;
using uPLibrary.Networking.M2Mqtt.Messages;
namespace Pi.Hub.Api.Controllers namespace Pi.Hub.Api.Controllers
{ {
...@@ -38,7 +37,7 @@ namespace Pi.Hub.Api.Controllers ...@@ -38,7 +37,7 @@ namespace Pi.Hub.Api.Controllers
// client.Connect(Guid.NewGuid().ToString()); // client.Connect(Guid.NewGuid().ToString());
Client.Publish(topic, Encoding.UTF8.GetBytes(serialized)); Client.Publish(topic, Encoding.UTF8.GetBytes(serialized));
// client.Disconnect(); // client.Disconnect();
Console.WriteLine(serialized);
return new return new
{ {
Echo = obj Echo = obj
......
define({ define({
"Sensor 1": { "5C:CF:7F:AE:14:03": {
name: "Chill room" name: "Chill room"
}, },
__default__: { __default__: {
minReadingsCount: 3, minReadingsCount: 1,
readingExpiry: 3 * 60, //in seconds readingExpiry: 3 * 60, //in seconds
lastReadings: 10 //number of last readings taken into account when calculating isOccupied lastReadings: 1 //number of last readings taken into account when calculating isOccupied
} }
}); });
\ No newline at end of file
...@@ -24,7 +24,7 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post ...@@ -24,7 +24,7 @@ define(["app/config", "app/events", "mqtt", "lodash", "knockout", "knockout-post
var model = { var model = {
id: messageBody.sensorId, id: messageBody.sensorId,
isOccupied: messageBody.isBusy, isOccupied: messageBody.isBusy === "1",
timestamp: new Date() timestamp: new Date()
}; };
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>OccupancySensorDashboard</title> <title>OccupancySensorDashboard</title>
<link rel="stylesheet" href="css.css?1499344294490"> <link rel="stylesheet" href="css.css?1499432824415">
<script src="scripts.js?1499344294491"></script> <script src="scripts.js?1499432824415"></script>
</head> </head>
<body> <body>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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