Skip to content

Commit

Permalink
Prepare for demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeHartnell committed Sep 9, 2016
1 parent e0a21ee commit 5e25e92
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 35 deletions.
3 changes: 0 additions & 3 deletions packages/app/devices/components/properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ <h4>Properties</h4>
{{#if state}}
<p>State: <em>{{state}}</em></p>
{{/if}}
<!-- {{#if true}}
<p>Message: <em>Hello world</em></p>
{{/if}} -->
{{/with}}
<hr/>
</template>
2 changes: 1 addition & 1 deletion packages/app/devices/components/sensors_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<li class="sensor">
<h4>{{name}}
{{#if device.onlineSince}}
<span class="pull-right small">{{> OptionsComponent}}</span>
<!-- <span class="pull-right small">{{> OptionsComponent}}</span> -->
{{else}}
<em class="pull-right small">Offline</em>
{{/if}}
Expand Down
10 changes: 5 additions & 5 deletions packages/app/devices/display.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template name="DeviceDisplayComponent">
<div class="row dashboard">
<div class="col-lg-12">
{{#with device.thing}}
{{#with device.thing}}
<h2>{{name}}
{{#if $not device.onlineSince}}
<em class="state">Not Online</em>
Expand All @@ -18,10 +18,10 @@ <h2>{{name}}
</li>
</ul>
</span>
</h2>
<p>{{description}}</p>
{{/with}}
<hr/>
</h2>
<p>{{description}}</p>
{{/with}}
<hr/>
</div>
<div class="col-lg-6">
{{#with device.thing}}
Expand Down
52 changes: 26 additions & 26 deletions packages/app/devices/list_item.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
class DeviceListItemComponent extends CommonComponent {
onCreated() {
super.onCreated();
// onCreated() {
// super.onCreated();

let device = Template.currentData();
// let device = Template.currentData();

this.autorun(computation => {
let deviceUuid = device.uuid;
if (!deviceUuid) { return; }
// this.autorun(computation => {
// let deviceUuid = device.uuid;
// if (!deviceUuid) { return; }

this.subscribe('Device.one', deviceUuid);
// this.subscribe('Device.one', deviceUuid);

this.subscribe('Data.points', deviceUuid);
// this.subscribe('Data.points', deviceUuid);

return this.dataPoint = () => {
let dataPoint = Data.documents.findOne(
{'device._id': device._id}
, {
'sort': {
'insertedAt': -1
}
});
if (!_.isUndefined(dataPoint)) {
return dataPoint.data;
}
};
});
}
// return this.dataPoint = () => {
// let dataPoint = Data.documents.findOne(
// {'device._id': device._id}
// , {
// 'sort': {
// 'insertedAt': -1
// }
// });
// if (!_.isUndefined(dataPoint)) {
// return dataPoint.data;
// }
// };
// });
// }

currentValue() {
return this.dataPoint();
}
};
// currentValue() {
// return this.dataPoint();
// }
}

DeviceListItemComponent.register('DeviceListItemComponent');
2 changes: 2 additions & 0 deletions packages/app/environments/new_device.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Environment.NewDeviceComponent = class NewDeviceComponent extends CommonComponen
});
}

// TODO: this is a bit redundant.
// The user will have already selected new device in the environment they want to put it in.
claimDevice(event) {
event.preventDefault();

Expand Down

0 comments on commit 5e25e92

Please sign in to comment.