From 009443f519da44b07cdc5599c66ce7e5b97906c2 Mon Sep 17 00:00:00 2001 From: Mike Cifelli <1836280-mike-cifelli@users.noreply.gitlab.com> Date: Fri, 10 Feb 2023 08:48:05 -0500 Subject: [PATCH] Show hostname on webpage --- main.py | 2 ++ www/index.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index f53fd2b..06d6495 100644 --- a/main.py +++ b/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(), diff --git a/www/index.html b/www/index.html index 778179b..4b03860 100644 --- a/www/index.html +++ b/www/index.html @@ -1,7 +1,7 @@ - Pico W + {{hostname}}