From c23350400cb7d988b06270576d266afdb5497931 Mon Sep 17 00:00:00 2001 From: Ignace Date: Sat, 15 Aug 2026 16:22:11 +0200 Subject: [PATCH] bug background --- ups2rrd.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ups2rrd.py b/ups2rrd.py index 3c19de2..55f70c4 100644 --- a/ups2rrd.py +++ b/ups2rrd.py @@ -72,6 +72,11 @@ REMOTE_SHUTDOWN_RUNTIME_SECONDS = 5 * 60 LOCAL_SHUTDOWN_RUNTIME_SECONDS = 200 BATTERY_CHARGE_MEAN_SAMPLES = 10 +GRAPH_COLOR_ARGS = [ + "--color", "BACK#F7F5EFFF", + "--color", "CANVAS#FFFFFFFF", +] + GRAPH_DIR = "/var/www/html/ups" HTML_FILE = os.path.join(GRAPH_DIR, "index.html") WEEKLY_HTML_FILE = os.path.join(GRAPH_DIR, "week.html") @@ -695,6 +700,7 @@ def graph_status(): [ "graph", GRAPH_STATUS, + *GRAPH_COLOR_ARGS, "--start", str(now - 90 * 86400), @@ -762,6 +768,7 @@ def graph_battery_1y(): [ "graph", GRAPH_BATTERY_1Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 365 * 86400), @@ -813,6 +820,7 @@ def graph_battery_5y(): [ "graph", GRAPH_BATTERY_5Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 5 * 365 * 86400), @@ -868,6 +876,7 @@ def graph_runtime_1y(): [ "graph", GRAPH_RUNTIME_1Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 365 * 86400), @@ -919,6 +928,7 @@ def graph_runtime_5y(): [ "graph", GRAPH_RUNTIME_5Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 5 * 365 * 86400), @@ -970,6 +980,7 @@ def graph_load(): [ "graph", GRAPH_LOAD, + *GRAPH_COLOR_ARGS, "--start", str(now - 90 * 86400), @@ -1024,6 +1035,7 @@ def graph_power_1y(): [ "graph", GRAPH_POWER_1Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 365 * 86400), @@ -1069,6 +1081,7 @@ def graph_power_5y(): [ "graph", GRAPH_POWER_5Y, + *GRAPH_COLOR_ARGS, "--start", str(now - 5 * 365 * 86400), @@ -1116,6 +1129,7 @@ def graph_weekly_status(): run_rrdtool( [ "graph", GRAPH_STATUS_1W, + *GRAPH_COLOR_ARGS, "--start", str(now - 7 * 86400), "--end", str(now), "--width", "1000", @@ -1153,6 +1167,7 @@ def graph_weekly_metric( now = int(time.time()) command = [ "graph", output_file, + *GRAPH_COLOR_ARGS, "--start", str(now - 7 * 86400), "--end", str(now), "--width", "1000",