Show hostname on webpage

This commit is contained in:
Mike Cifelli 2023-02-10 08:48:05 -05:00
parent 2494b3b928
commit 009443f519
2 changed files with 4 additions and 2 deletions

View File

@ -9,6 +9,7 @@ from net import ntp
from net import Server
from net import templates
from net import util
from net.config import config
from sensors import MCP9808
from sensors import WaterSensor
@ -66,6 +67,7 @@ class SensorServer(Server):
return templates.render(
f'www/{path or self.default_path}',
hostname=config['hostname'],
datetime=util.datetime(),
temperature=self.temperatureTextValue(),
waterStatus=self.waterTextValue(),

View File

@ -1,7 +1,7 @@
<html>
<head>
<title>Pico W</title>
<title>{{hostname}}</title>
<meta http-equiv="refresh" content="500">
<style>
body {
@ -28,7 +28,7 @@
</head>
<body>
<h2>Pico W</h2>
<h2>{{hostname}}</h2>
<p>{{datetime}}</p>
<p>{{temperature}} &#176;C</p>
<p>Water is <span class="{{waterClass}}">{{waterStatus}}</span></p>