monitoring: tune stat text sizing for climate and ups

This commit is contained in:
Brad Stein 2026-04-12 20:30:17 -03:00
parent 4b78e67036
commit 66bd705971
5 changed files with 56 additions and 8 deletions

View File

@ -803,6 +803,8 @@ def stat_panel(
wide_layout=None,
graph_mode="area",
justify_mode="center",
title_size=None,
value_size=None,
):
"""Return a Grafana stat panel definition."""
defaults = {
@ -845,6 +847,12 @@ def stat_panel(
panel["options"]["orientation"] = orientation
if wide_layout is not None:
panel["options"]["wideLayout"] = wide_layout
if title_size is not None or value_size is not None:
panel["options"]["text"] = {}
if title_size is not None:
panel["options"]["text"]["titleSize"] = title_size
if value_size is not None:
panel["options"]["text"]["valueSize"] = value_size
if legend and len(panel["targets"]) == 1:
panel["targets"][0]["legendFormat"] = legend
if instant:
@ -1478,6 +1486,8 @@ def build_overview():
description="Per-UPS live snapshot: draw, discharge runtime, and status.",
orientation="vertical",
wide_layout=True,
title_size=12,
value_size=20,
)
)
panels.append(
@ -1518,6 +1528,8 @@ def build_overview():
description="Current tent values: Temp °C, Temp °F, Humidity, Pressure.",
orientation="vertical",
wide_layout=True,
title_size=18,
value_size=36,
)
)
panels.append(
@ -3517,6 +3529,8 @@ def build_power_dashboard():
],
orientation="vertical",
wide_layout=True,
title_size=12,
value_size=20,
description=(
"Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status."
),
@ -3558,6 +3572,8 @@ def build_power_dashboard():
],
orientation="vertical",
wide_layout=True,
title_size=18,
value_size=36,
description="Current tent values: Temp °C, Temp °F, Humidity, Pressure.",
)
)

View File

@ -1181,7 +1181,11 @@
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 12,
"valueSize": 20
}
},
"links": [
{
@ -1357,7 +1361,11 @@
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 18,
"valueSize": 36
}
},
"links": [
{

View File

@ -115,7 +115,11 @@
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 12,
"valueSize": 20
}
},
"description": "Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status."
},
@ -278,7 +282,11 @@
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 18,
"valueSize": 36
}
},
"description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure."
},

View File

@ -1190,7 +1190,11 @@ data:
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 12,
"valueSize": 20
}
},
"links": [
{
@ -1366,7 +1370,11 @@ data:
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 18,
"valueSize": 36
}
},
"links": [
{

View File

@ -124,7 +124,11 @@ data:
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 12,
"valueSize": 20
}
},
"description": "Per-UPS live snapshot: draw, discharge runtime, and charging/discharging status."
},
@ -287,7 +291,11 @@ data:
},
"textMode": "name_and_value",
"orientation": "vertical",
"wideLayout": true
"wideLayout": true,
"text": {
"titleSize": 18,
"valueSize": 36
}
},
"description": "Current tent values: Temp \u00b0C, Temp \u00b0F, Humidity, Pressure."
},