mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-04 22:35:08 +00:00
fix(web): schedule saves, restart_required, health and current-status agree with the rig
- POST /config/schedule and /config/dim-schedule accept a disabled per-day schedule with every day off (config.template.json's own shape); a day that is off keeps its posted times. - POST /config/main sets restart_required from what the save changed: brightness, mode durations and plugin sections are applied live. - /health is degraded (display_loop: stopped) when the service is inactive, the socket does not answer and there is no live heartbeat. - /display/current-status no longer serves a stopped display's cached state when the socket and heartbeat both say it is gone (display_gone). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,7 @@ def get_health():
|
||||
# the only signal, as it always was.
|
||||
# The display reports the same beat's age over the control socket's
|
||||
# state stream, measured in memory; the file is the fallback.
|
||||
snapshot = None
|
||||
try:
|
||||
snapshot = display_state.read_state()
|
||||
if snapshot is not None:
|
||||
@@ -132,6 +133,25 @@ def get_health():
|
||||
'error': 'see logs for details'
|
||||
}
|
||||
|
||||
# A stopped display service. The heartbeat's absence alone says
|
||||
# nothing (the dev server, the emulator and Windows write none), so
|
||||
# the overall status stayed "healthy" with the display down. Together
|
||||
# the three signals are definite: systemd says the service is not
|
||||
# active, the control socket does not answer, and there is no live
|
||||
# heartbeat (display_state.display_gone, which is never true where
|
||||
# the platform has no socket or it is switched off).
|
||||
try:
|
||||
if (not display_service_status.get('active')
|
||||
and display_state.display_gone(snapshot)):
|
||||
health_status['checks']['display_loop'] = {
|
||||
'status': 'stopped',
|
||||
'note': 'The display service is not running',
|
||||
'source': 'service',
|
||||
}
|
||||
except Exception:
|
||||
logger.warning("Health check could not tell whether the display is stopped",
|
||||
exc_info=True)
|
||||
|
||||
# Check hardware connectivity (if display manager available)
|
||||
try:
|
||||
snapshot_path = display_preview.SNAPSHOT_PATH
|
||||
|
||||
Reference in New Issue
Block a user