<!DOCTYPE html>
<html lang="en">

<head>
	<% include layout.ejs %>

</head>

<body>

<% include ../public/html/header.html %>
<% include ../public/html/navbar.html %>

<div class="container">
<br>
<h1 class="text-center">ESP8266 Temperature Sensors</h1>

<p><span class="colorRed">Note:</span> I am still experimenting with these sensors. It seems that the sensors will have a bad reading every once in while. 
For example the low every day for the Grand Meadow sensor is 33.8. From observing the data, it randomly jumps to 33.8 one out of about every few hundred readings or so. 
I will continue to investigate this problem when I can get my hands on the sensor as it is currently in my home town.
</p>

<hr>
	<% for (var i = 0; i < query.length; i++){ %>
		<div class="col-lg-4">
			<h3><%=query[i]._id%></h3>
			<h4>Temperature: <%=query[i].temperature%>°F </h4>
			
			<% if (query[i].humidity != null) { %>
				<h4>Humidity: <%=query[i].humidity%>%</h4>
			<%}%>

			<span>Updated: <%=query[i].lastUpdate%></span>
			<br>
			<% if (query[i].connected){ %>
			<span class="colorGreen">Connected</span>
			<%} else {%>
			<span class="colorRed">Disconnected</span>
			<%}%>
			<br>
			<br>
			<a href="<%=query[i].info_link%>"><button class="btn btn-default">View Graph</button></a>
		</div>
	<%}%>

</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<footer class="blog-footer">
	<p>Site created and managed by Mitchell Gerber</p>
	<span>©2015</span>
	<br>
	<span>Glyphicons provided by</span><br>
	<a href="http://glyphicons.com/" target="_blank"><span>glyphicons.com</span></a>
</footer>

</body>

	

	
	<% include layoutBottom.ejs %>

</html>

