Skip to content

Instantly share code, notes, and snippets.

@ericpulvino
Created September 26, 2016 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericpulvino/8196a057493dec94d0f48c495ad5f706 to your computer and use it in GitHub Desktop.
Save ericpulvino/8196a057493dec94d0f48c495ad5f706 to your computer and use it in GitHub Desktop.
Template for window_open.py flask app...
<!doctype html>
<html>
<title>Window Open?</title>
<head>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
{% if window_open %}
<font size="20" color="green">OK to Leave the Window Open!</font><br>
{% else %}
<font size="20" color="red">DO NOT LEAVE THE WINDOW OPEN!</font><br>
{% endif %}
<br><br>
<table>
<tr>
<th>Next {{ evaluate_hours }} Hours</th>
<th>Conditions</th>
<th>Feels Like (F)</th>
<th>Humidity %</th>
</tr>
{% for row in full_output: %}
<tr>
<td>{{ row.time }}</td>
<td>{{ row.conditions }}</td>
<td>{{ row.temp|float|round(2) }}</td>
<td>{{ row.humidity }}</td>
</tr>
{% endfor %}
<tr>
<td></td>
<td><strong>Rain? = {{ rain }}</strong></td>
<td><strong>Max Temp = {{ max_temp }}</strong></td>
<td><strong>Max Humidity = {{ max_humidity }}</strong></td>
</tr>
</table>
<h1>Nest set to {{current_temp|round(2)}}F</h1>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment