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

View File

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

View File

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

View File

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

View File

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