mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 23:05:10 +00:00
fix(display): Vegas resumes after live priority, and six smaller runtime fixes (#644)
- Vegas: a live-priority pause was only lifted from inside run_frame(), which returns before that check while paused, so the ticker never came back until a restart. run_iteration() now resumes it (the controller only calls it when nothing preempts Vegas); start()/stop() clear the pause state. Iteration length is timed with the monotonic clock. - Dim schedule: a per-day disabled day now updates the minute-gate cache, so brightness no longer flips back to dim within each minute. - On-demand: a second request no longer overwrites the rotation resume index with the first request's mode. - Render pipeline: reset() drops the prepared group and deferred queue, and a prefetch in flight across a reset discards its result. - Sync: stop() removes the status file (and the controller's cleanup now calls it), standalone removes a stale one at startup, and writes use a unique mkstemp temp file. - render_gate.swap_releases_gil() delegates to frame_timing. - Stale docstrings/comments corrected. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,31 @@ class TestPinSurvivesARestart:
|
||||
assert set(c.on_demand_modes) == {'app_a', 'app_b', 'app_c'}
|
||||
|
||||
|
||||
class TestASecondRequestKeepsTheResumePoint:
|
||||
"""Clearing returns to where the normal rotation was, not the last request.
|
||||
|
||||
A second start while on-demand was showing overwrote the saved resume
|
||||
index with the first request's mode, so stopping resumed rotation there.
|
||||
"""
|
||||
|
||||
def test_clear_resumes_the_original_rotation(self, test_display_controller):
|
||||
c = test_display_controller
|
||||
_plugin_with_modes(c, 'clock', ['clock'])
|
||||
_plugin_with_modes(c, 'weather', ['weather'])
|
||||
_plugin_with_modes(c, 'stocks', ['stocks'])
|
||||
c.available_modes = ['clock', 'weather', 'stocks']
|
||||
c.current_mode_index = 0
|
||||
c.current_display_mode = 'clock'
|
||||
|
||||
c._activate_on_demand({'plugin_id': 'weather', 'mode': 'weather'})
|
||||
c._activate_on_demand({'plugin_id': 'stocks', 'mode': 'stocks'})
|
||||
assert c.current_display_mode == 'stocks'
|
||||
|
||||
c._clear_on_demand(reason='requested-stop')
|
||||
assert c.current_mode_index == 0
|
||||
assert c.current_display_mode == 'clock'
|
||||
|
||||
|
||||
class TestRestartDoesNotStarveTheOtherPlugins:
|
||||
"""Restarting mid-on-demand used to load only the on-demand plugin.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user