Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pi.hub
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
iot
pi.hub
Commits
6b0f3413
Commit
6b0f3413
authored
Jul 07, 2017
by
Martin Kotula
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sensor config adjustments
parent
3daa756b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
8 deletions
+8
-8
Pi.Hub.Api/Controllers/StatusController.cs
+1
-2
UI.Web.Dashboard/src/app/sensors.config.js
+4
-3
UI.Web.Dashboard/src/services/mqttListener.js
+1
-1
UI.Web.Dashboard/wwwroot/index.html
+2
-2
UI.Web.Dashboard/wwwroot/scripts.js
+0
-0
No files found.
Pi.Hub.Api/Controllers/StatusController.cs
View file @
6b0f3413
...
@@ -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
...
...
UI.Web.Dashboard/src/app/sensors.config.js
View file @
6b0f3413
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
:
1
0
//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
UI.Web.Dashboard/src/services/mqttListener.js
View file @
6b0f3413
...
@@ -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
()
};
};
...
...
UI.Web.Dashboard/wwwroot/index.html
View file @
6b0f3413
...
@@ -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?1499
344294490
"
>
<link
rel=
"stylesheet"
href=
"css.css?1499
432824415
"
>
<script
src=
"scripts.js?1499
344294491
"
></script>
<script
src=
"scripts.js?1499
432824415
"
></script>
</head>
</head>
<body>
<body>
...
...
UI.Web.Dashboard/wwwroot/scripts.js
View file @
6b0f3413
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment