Added humidity sensor data handling
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
if (Meteor.isClient) {
|
||||
|
||||
Template.display.helpers({
|
||||
temperatures: function () {
|
||||
return Temperatures.find({}, {sort: {created_at: -1}})
|
||||
sensorDataCollection: function () {
|
||||
return SensorData.find({}, {sort: {created_at: -1}})
|
||||
}
|
||||
});
|
||||
|
||||
Template.display.events({
|
||||
});
|
||||
|
||||
Template.temperature.helpers({
|
||||
Template.sensorData.helpers({
|
||||
created_at_formatted: function() {
|
||||
return moment(this.created_at).format("DD.MM.YYYY, hh:mm")
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template name="display">
|
||||
<ul>
|
||||
{{#each temperatures}}
|
||||
{{> temperature}}
|
||||
{{#each sensorDataCollection}}
|
||||
{{> sensorData}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<template name="temperature">
|
||||
<li>{{owner}} / <strong>{{value}}°C</strong> / {{created_at_formatted}}</li>
|
||||
</template>
|
||||
Reference in New Issue
Block a user