Show hostname on webpage
This commit is contained in:
parent
2494b3b928
commit
009443f519
2
main.py
2
main.py
|
@ -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(),
|
||||
|
|
|
@ -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}} °C</p>
|
||||
<p>Water is <span class="{{waterClass}}">{{waterStatus}}</span></p>
|
||||
|
|
Loading…
Reference in New Issue