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 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(),
|
||||||
|
|
|
@ -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}} °C</p>
|
<p>{{temperature}} °C</p>
|
||||||
<p>Water is <span class="{{waterClass}}">{{waterStatus}}</span></p>
|
<p>Water is <span class="{{waterClass}}">{{waterStatus}}</span></p>
|
||||||
|
|
Loading…
Reference in New Issue