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

View File

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