mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-10-08 22:46:41 +00:00
fix(monitor): round the temperature in alerts and tidy the #408 follow-ups
This commit is contained in:
@@ -122,10 +122,9 @@ class CommandDescriptionsTests(unittest.TestCase):
|
||||
"temperatureIncomplete", "temperatureUnavailableCount",
|
||||
):
|
||||
temporary["storage"].setdefault(key, catalog("en")["storage"][key])
|
||||
# The temperature alert fallback is new English-only runtime
|
||||
# text until locale migration. Seed only its four new keys
|
||||
# in this disposable steady-state catalog; shipped locales
|
||||
# remain unchanged and runtime fallback is tested separately.
|
||||
# Every shipped locale carries the temperature alert fallback
|
||||
# keys; the seed only guards a catalog that lacks them. The
|
||||
# runtime fallback is tested separately.
|
||||
source_fallback = catalog("en")["runtime"]["notifications"]["fallback"]
|
||||
fallback = temporary["runtime"]["notifications"]["fallback"]
|
||||
for key in ("temperatureAlertTitle", "temperatureAlertBody",
|
||||
|
||||
@@ -6987,7 +6987,7 @@
|
||||
}
|
||||
},
|
||||
"temperature": {
|
||||
"sampleSpan": "Las muestras elevadas abarcan {duration}."
|
||||
"sampleSpan": "Lecturas altas registradas a lo largo de {duration}."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1574,7 +1574,8 @@ class HealthMonitor:
|
||||
duration_str = f'{actual_minutes}m {actual_seconds}s' if actual_minutes > 0 else f'{actual_seconds}s'
|
||||
|
||||
status = 'WARNING'
|
||||
reason = f'Sensor temperature {max_temp}°C >80°C; high samples span {duration_str}'
|
||||
shown_temp = round(max_temp, 1) # as the widget shows it
|
||||
reason = f'Sensor temperature {shown_temp}°C >80°C; high samples span {duration_str}'
|
||||
|
||||
# Record the existing dismissable error contract
|
||||
health_persistence.record_error(
|
||||
@@ -1583,8 +1584,8 @@ class HealthMonitor:
|
||||
severity='WARNING',
|
||||
reason=reason,
|
||||
details={
|
||||
'temperature': max_temp, 'duration': actual_duration,
|
||||
'dismissable': True, 'value': max_temp, 'threshold': 80,
|
||||
'temperature': shown_temp, 'duration': actual_duration,
|
||||
'dismissable': True, 'value': shown_temp, 'threshold': 80,
|
||||
'details': f'High samples span {duration_str}.',
|
||||
# Explicit provenance for render-time localization;
|
||||
# older/manual detail strings remain verbatim.
|
||||
|
||||
Reference in New Issue
Block a user