Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few tweaks to sMAP Direct #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions python/smap/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,15 @@
});

function latest(r) {
if (!r.length) {
return undefined;
}
return r.slice(-1)[0][1];
}
function latestts(r) {
if (!r.length) {
return undefined;
}
return r.slice(-1)[0][0];
}
function resetUpdater() {
Expand Down Expand Up @@ -174,8 +180,8 @@
function makeTimeseries(path, meta) {
console.log(meta);
if (meta['Actuator'] === undefined) {
return latest(meta["Readings"]) +
meta ["Properties"]["UnitofMeasure"];
return latest(meta["Readings"]) + " " +
meta["Properties"]["UnitofMeasure"];
} else if (meta['Actuator']['Model'] == 'binary') {
return makeBinaryActuator(path, meta);
} else if (meta['Actuator']['Model'] == 'discrete') {
Expand Down