* refactor(fonts): one BDF loader and one BDF rasterizer BDF faces were loaded three ways (FontManager._load_bdf_font, element_style._load_bdf, DisplayManager._load_fonts) and drawn by two copies of the same per-pixel loop (DisplayManager._draw_bdf_text and the plugin test harness's "replicated" copy), which golden images and check_plugin/dev_server previews rely on matching the panel. src/common/bdf_font.py now owns both: - load_bdf_face(path, size) -> (face, realised_px): native-strike fallback for sizes the file lacks, one bounded LRU cache keyed on path, size and mtime. FontManager, element_style and DisplayManager delegate to it; read_bdf_native_size moves here (the old names delegate). - draw_bdf_text(draw, text, x, y, face, color, clip): builds each glyph as a 1-bit mask and fills it with ImageDraw.bitmap instead of a draw.point per pixel. A blending Draw (RGB image, "RGBA" mode) keeps the point path so translucent colours still blend. Pixel-identical: 220,032 renders (every bundled BDF at native and off-strike sizes, 14 strings, 4 colours, clipped on every edge, through each old loader x rasterizer) match origin/main byte for byte. test/test_bdf_font.py keeps a lightweight version against a frozen copy of the old loop. DisplayManager._draw_bdf_text goes from 1.4-23 ms to about 0.1 ms per string (the old loop re-read FreeType's buffer as a Python list for every pixel). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(testing): harness calendar_font is sized like the panel's VisualTestDisplayManager built its 5x7 calendar_font / bdf_5x7_font as a bare freetype.Face. With no size set its ascender reads 0, so BDF text drawn with it landed 6px above where DisplayManager draws it -- entirely off the canvas at y=0 -- and get_font_height() returned 0. Golden images and check_plugin / dev_server previews showed text the panel does not. Load it through load_bdf_face at the panel's 7px, so it is the very face DisplayManager uses. Across the differential run this changes only the cases drawn with the harness's own calendar_font (968 of 220,032), which now match the panel's output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(fonts): one BDF face per thread The shared face cache now hands every loader (FontManager, element_style, DisplayManager, the harness) the same freetype.Face. FreeType does not allow two threads to use one face at once, since load_char rewrites its glyph slot, so key the cache by thread as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
65 KiB
Changelog
Notable changes to the LEDMatrix core. The version below is the value of
src.__version__, which the plugin loader reports to compatibility checks and
which plugin manifests reference via ledmatrix_min_version.
Why this file exists: the plugin monorepo bundles fallback copies of several
core modules (see docs/plugin-development/08-shared-sports-code.md in
ledmatrix-plugins). A plugin
may delete its bundled copy only when its manifest floors on the first core
release that ships the module — which requires module additions to be recorded
here, against a version number. When you add a module plugins will import via
src.*, note it in the Unreleased section and bump src/__init__.py in the
release that ships it.
Use ledmatrix_min_version in manifests, not ledmatrix_min. The loader
accepts both, but the store flags the old spelling as deprecated
(store_manager.py) and only the new one is in schema/manifest_schema.json.
Unreleased
-
FontManager.get_font()returns a BDF font at its native size when asked for a size the file doesn't contain (5x7.bdf at 8 or 10px, say). It used to return PIL's default font, a different typeface, so a plugin that relied on that will now render the font it asked for. -
src.wifi_manager.get_wifi_status_path()— where WiFi status messages for the display are written (config/wifi_status.json). -
src.device_location— a blankLocationfield on a Starlark (Tidbyt) app now renders at the device's City / State / Country (geocoded once via Open-Meteo and cached) instead of the app author's hard-coded default, usually San Francisco. A location saved on the app still wins. With no device city set, or when the lookup fails or finds no match, the app keeps its own default (a failed lookup is retried after 30 minutes). Clearing an app's location in the web UI now actually clears it; the save used to drop the blank field, so the old value stayed. -
src.common.bdf_font—load_bdf_face(path, size)(a cachedfreetype.Faceplus the pixel size it really renders at, falling back to the file's native strike) anddraw_bdf_text(draw, text, x, y, face, color).DisplayManager,FontManager,element_styleand the plugin test harness now all load and draw BDF text through it; the panel's pixels are unchanged and BDF text draws 10-250x faster. The plugin test harness'scalendar_font/bdf_5x7_fontnow has the panel's 7px size set: it used to be an unsized face, so in golden images andcheck_plugin/dev_serverpreviews its text sat 6px above where the panel draws it (off the canvas entirely near the top) andget_font_height()returned 0. -
The web UI's Fonts tab has a Used by column: the loaded plugins that registered each font with
FontManager.register_manager_font(), published by the display service to the shared cache (src/font_usage.py) and merged intoGET /api/v3/fonts/catalogasused_by. Deleting a font a plugin uses now names those plugins in the confirmation (it is not blocked).FontManager.forget_manager_fonts()is new; unloading a plugin calls it.
Deprecated, removed in 3.7.0 (each logs a warning on first use; see
docs/PLUGIN_API_REFERENCE.md#deprecated-apis for replacements). Nothing in
core, the monorepo or the registry's third-party plugins calls them:
CacheManager:has_data_changed,update_cache,setup_persistent_cache,get_sport_live_interval,get_sport_key_from_cache_key,get_background_cached_data,is_background_data_available,record_cache_hit,record_cache_miss,record_fetch_time,get_cache_metrics,log_cache_metrics,get_memory_cache_stats.DisplayManager:draw_weather_icon,draw_sun,draw_cloud,draw_rain,draw_snow,draw_text_with_icons,get_scrolling_stats.FontManager:set_override,remove_override,get_overrides,add_font,remove_font,validate_font,get_font_catalog,get_available_fonts,get_size_tokens,get_performance_stats,get_manager_fonts,get_detected_fonts,get_plugin_fonts,unregister_plugin_fonts.PluginManager.get_enabled_plugins.
Config writes
- A power cut or crash mid-save can no longer leave
config/config.jsontruncated.ConfigManager.save_config()wrote the file in place; it,save_config_atomic(),save_raw_file_content()and backup rollback now share one writer (atomic_write_textinsrc/config_manager_atomic.py) that fsyncs a temp file, renames it into place and fsyncs the directory. save_config_atomic()no longer rewritesconfig_secrets.jsonon every save, only when its content changes, and rotating backups no longer re-reads every backup. The backups themselves are unchanged:config/backups/config.json.backup.<version>plus its paired secrets backup, five newest kept.- A save by the root-run display service keeps the file's previous owner
instead of handing
config.jsonto root, and an install path with "secrets" in a directory name no longer makesconfig.jsonmode 0640.
New names in existing modules (no new modules; a plugin importing these must floor on the release that ships them):
src.common.api_helper:USER_AGENT,DEFAULT_HTTP_HEADERS(read-only).src.logo_downloader:fetch_logo,save_png_atomically,shared_downloader.src.common.sports_card.unshare_element_fontstakes an optional third argument,element_for_font(default: the module'sELEMENT_FOR_FONT, so existing calls are unchanged).
Sports twins
- The
SportsCoreSharedMixinhelpers that behave identically to theirsports_cardtwins (_card_option,_vs_text,_format_game_time,_coerce_rgb,_crisp_size,_unshare_element_fonts, the colour/month/ weekday/font-grid tables) are now thin wrappers over thesports_cardfunctions, and_format_game_date/_schema_font_sizeshare its formatting body and schema parser. No method was removed or renamed and nothing renders differently:test/test_sports_twins.pychecks each pair against the same inputs, and the old and new mixin agree on every input there. The pairs that do differ -- favourite-result colours on nested payloads, the weekday's timezone, the element-name map, per-mode colours -- are left as they are and pinned in that test.
Logo downloads
download_missing_logo/LogoDownloader.download_logo(the path the scoreboard plugins use) now stream the logo with a 10 MB cap, accept only animage/*response that Pillow can decode, and move the finished RGBA PNG into place atomically. A failed, oversized or non-image download no longer leaves a partial file behind, and no longer replaces a logo already on disk.LogoHelper._download_logogoes through the same code. Signatures and return values are unchanged; saved files are pixel-identical to before.download_missing_logoreuses one downloader (onerequests.Session) per thread instead of building a new one for every logo.- Placeholder logos are written atomically, without the
test_write.tmpprobe file.
HTTP headers
- The logo downloader and the background data service send the real
LEDMatrix/1.0 (+https://github.com/ChuckBuilds/LEDMatrix)User-Agent instead of ayourusername/contact@example.complaceholder, and no longer setAccept-Encoding: ... brby hand (brotli is not installed, so abrresponse could not be decoded); requests picks the encodings.
Plugin error reporting
/api/v3/errors/summaryand/api/v3/errors/plugin/<id>report the errors the display service recorded. They used to read the web process's own error aggregator, which never records anything, so they always answered "no errors". The display service now publishes a bounded snapshot to the shared cache (plugin_error_snapshot, at most every 10 seconds and only on change;src/error_aggregator.py, started fromDisplayController.__init__). Responses keep their shape and addsnapshot_available,generated_atandclear_pending; exception text has credentials redacted.POST /api/v3/errors/clearrecords a request (plugin_error_clear_request) the display service applies within about 5 seconds; reads hide the cleared errors at once. It accepts"all": true, andcleared_countcan benullwhen the count is only known to the display service.- The Logs tab has a Plugin errors panel: per-plugin counts, repeating errors and a Clear button.
- Credential redaction in exception text (
src/redaction.py) takes time proportional to the text, not its square. Two patterns were quadratic: URLuser:password@, on a long unbroken run of letters or digits (a hex digest, an ID), andAuthorization:followed by a long run of whitespace. Either used to stall every thread of the display service for up to seconds each time the snapshot was published: about 0.5s for 20k characters of hex, 8s for 20k spaces. What gets redacted is unchanged.
Removed
- The skin system. Skins never rendered with the current scoreboard
plugins, so they are gone rather than "not supported yet":
src/skin_system/,skins/,scripts/validate_skin.py,GET /api/v3/skins, the store's"type": "skin"handling anddocs/SKIN_SYSTEM.md/docs/CREATING_SKINS.md. Askinorskin_optionskey left in a plugin's saved config still loads and saves without a validation error; it is ignored, and the next save of that plugin's settings removes it (unless the plugin's own schema declares the key). src/base_classes/(SportsCore, the sport and mode classes,CelebrationMixin, the rotation strategies,data_sources,api_extractors). No known plugin imports it. A plugin that does must usesrc.commonor its own copy of the code.
3.5.0
New modules a plugin may import via src.* (floor on 3.5.0):
src/common/sports_helpers.py— the helpers the scoreboards'sports.pycarry byte-identical copies of:clamp_window,clamp_seconds,logo_needs_refresh,spread_weighted_order(+MIN_WINDOW_DAYS,MAX_WINDOW_DAYS), andSportsHelpersMixinwith_mode_customization,_setting_int,_reset_dwell_on_reentry,_next_switch_index,_spread_weighted_order,_odds_color,_upcoming_date_and_time_textunder the plugins' names and signatures, plus the_favorite_keyoverride point. Constructor-free; keeps lazy state on its host (see the module docstring, which also gives the host contract). A new module rather than more methods onsports_shared: a plugin that deletes a copy and leans on an older module having grown the method fails at runtime withAttributeError, which no load-time check sees, while a missing module fails at load. Nothing in core uses it yet.test/test_common_is_hardware_free.py—src/commonmust import withoutrgbmatrixand never importsrc.base_classes,src.display_managerorsrc.plugin_systemat module level.src/common/espn_dates.py—fetch_espn_scoreboard,fetch_espn_date_chunks,espn_date_chunks,clamp_espn_limit,ESPN_MAX_LIMIT: fetch an ESPN scoreboard date range now that ESPN rejects ranges (see Sports data below). Plugins bundle a copy of it.
Config saves and plugin config preparation
- A JSON
POST /api/v3/config/mainchanges only the keys it sends. The MQTT bridge's brightness slider used to turn offdisable_hardware_pulsing,inverse_colors,show_refresh_rateanduse_short_date_format, and a timezone- or location-only save turned off web-UI autostart and weekly automatic updates. Missing checkboxes still save as unchecked for the settings forms (they now send a hidden__form_sectionfield) and for form-encoded posts. - A partial JSON
POST /api/v3/plugins/configmerges onto the plugin's stored settings instead of resetting everything it didn't send to the schema defaults, and keeps a submittedskin,skin_options,vegas_width_pct,vegas_overfloworvegas_max_width_screens(they were silently dropped). - Plugin sections posted to
/config/mainare validated and prepared exactly like/plugins/config; a value that endpoint rejects is rejected here too, and nothing is saved. - Legacy boolean settings (#588) are read as
{"enabled": ...}objects everywhere, not just when the plugin loads:GET /plugins/configreturns the object, posting it back saves, and hot reload hands plugins the same shape (schema defaults included) they were constructed with.schema_manager.prepare_plugin_configis the one implementation. - A plugin's settings tab shows schema defaults for options its saved config
doesn't have yet. A boolean added with
"default": truein a plugin update (geochron 1.2.0'sshow_dateandshow_date_line) used to render unchecked, and the next save of that tab stored it asfalse. Enum dropdowns likewise showed their first option instead of the default. The partial now runs the stored section throughprepare_plugin_configlikeGET /plugins/config(secrets are still masked, after the merge), and the form falls back to a field's owndefaultinside objects that declare a default of their own. scripts/dev_server.py,check_plugin.py,render_plugin.pyand the plugin harness build configs the way a device does: nested defaults are included, a schemaenabled: falseno longer beats the forcedenabled: truein the dev server, and nested overrides such as{"nhl": {"enabled": true}}keep the other defaults of that section.- Clearing Vegas "Min/Max Cycle Time" no longer rejects the whole Display save,
and those fields no longer add junk entries to
display.display_durations. - Turning automatic updates on from the Raw JSON editor finishes their setup like the General tab does, instead of waiting for the next display restart.
POST /config/scheduleand/config/dim-scheduleaccept the per-daydays.<day>.{enabled,start_time,end_time}shape their GETs return, as well as the flat form keys.- The startup check no longer warns that
auto_updateordim_scheduleis "enabled but not found in plugins directory", and plugin ids that collide with any core config section are flagged: the last private copies of the core-key list now usesrc/core_config_keys.py.
Sports data
- Since 2026-09-15 ESPN answers
dates=YYYYMMDD-YYYYMMDDscoreboard queries with400 Bad Requestfor every sport, so season schedules, the weeks window and today's games all failed ("400 Client Error" from the NFL/NCAAFB managers andsrc.background_data_service). A rejected range is now re-fetched as whole months (dates=YYYYMM) plus the leftover days at each end, which cover the window exactly: a football season is 8 requests. A month that returns exactly 500 events is truncated and is re-fetched day by day. - Scoreboard requests send
limit=500at most. Above 500 ESPN silently returns a short list: college football gave 25 of 68 games for one Saturday at thelimit=1000everything used to send. BackgroundDataService.handles_espn_date_rangesisTrue. Plugins check it to decide whether to submit a season range to the service or fetch it themselves on an older core.- A league with no live games no longer backs its poll off past the next
kickoff. The escalation counted empty looks and nothing else, so a league
three hours before kickoff was indistinguishable from one out of season and
both reached
live_idle_max_interval: measured gaps of up to 928 seconds, and a rig that sat for a quarter of an hour with eight NFL games in progress without noticing any of them. The wait is now clamped so it cannot run past the earliest start still ahead, which the live fetch already downloads, so it costs no extra request. Just after a kickoff the live cadence is held for a grace window, because a provider that has not yet flipped the status would otherwise read as another empty check and escalate the back-off again. - ESPN date chunks are fetched six at a time (
ESPN_CHUNK_WORKERS) in two passes: months and edge days first, then the days of any month that came back at the cap. A cold college-baseball season is about 130 requests, and they went out one at a time; March and April measured on a Pi 4 (63 requests, 3101 events) went from 11.2s to 1.6s. Merged events still followespn_date_chunksorder, so the payload does not depend on which request won the race, and a capped month's payload is dropped before its days are fetched, which keeps the peak memory of a four-capped-month fetch to about 16 MB over the sequential path rather than 43 MB —docs/LOW_MEMORY_BOARDS.mdputs a 1 GB Pi 3B+ at under 200 MB of headroom. ESPNDataSource.fetch_standingsasks each league the endpoint that league actually publishes. It tried/standingsfirst whatever the league and fell back to/rankingsonly on a 404, but college leagues answer/standingswith a 200 that carries no poll, so the fallback never fired: the rank badge simply never appeared and anything keyed off rankings quietly did nothing. Endpoints are now ordered by whether the league publishes a poll, and a 200 that lacks the key counts as a miss, so a league answering both still ends up with whichever carries the poll. Only a 404 is routine — that is how a league says it has none; a connection error, a timeout or an unparseable body is logged as an error again, and a bug raised while inspecting the payload is no longer swallowed as a missing poll. This is the implementation the football, baseball and hockey boards already ship; core was the last copy on the old one.
Scrolling
- Scoreboard scroll speed no longer changes with the General tab's "Scroll
Frame Rate" (
target_fps). Scoreboards onsrc.common.sports_scrollcomputed their speed for that rate while the panel kept presenting at its real refresh, so on a 100 Hz panel 60 ran a 50 px/s scoreboard at 100 px/s and 200 ran it at 25 px/s. Speed now comes fromscroll_speedand the panel refresh only. The field is labelled legacy: nothing in core scrolling reads it. Anyone who lowered it will see scoreboards scroll slower than before -- at the speed they configured. scripts/scroll_speeds.py --measure/--demoopen the panel with the display service's own options (DisplayManager.apply_matrix_options), sodisplay.runtime.gpio_slowdown,rp1_rio,panel_typeand orientation are honoured; the script used to readgpio_slowdownfromdisplay.hardware. Its closing advice now gives thescroll_speed+scroll_delaypair instead ofscroll_pixels_per_second, which the resolver ignores whenever the pair is present.- The frame-stats log no longer opens a scroll with a one-frame window for
scrollers that never call
reset_scroll(). - Removed dead scroll code: the optional scipy import (
HAS_SCIPY),ScrollHelper._last_integer_positionandframe_time_target.ScrollHelper.target_fps/set_target_fps()remain, documented as informational. - Docs describe the fixed-step scroll model:
PLUGIN_API_REFERENCE.mddocumentsset_scrolling_state(..., frame_hold)(omitting the hold runs a scrollframe_holdtimes too fast),SCROLL_PERFORMANCE.mdno longer reads a held 20 ms frame as missed refreshes, and Vegasframe_based_scrolling/scroll_delayare described as the speed clamp they are rather than frame stepping. Scoreboardscroll_delayis documented as ignored for pacing.
Web interface
- The plugin settings form honours
"x-display": "hidden"in config schemas: the property gets no control at any depth (top level, nested objects, array rows, Advanced Settings), and saving the form never changes its stored value. JSON API saves are unaffected. Lets plugins keep deprecated or internal keys declared, e.g. countdown's rowidand weather'sapi_key/radar_zoom. Seedocs/widget-guide.md. - Display settings no longer silently cut values on save: columns were capped
at 128, chain length at 24 and PWM LSB nanoseconds at 500. Columns have no
upper limit, chain length is 1–255 and rows must be even and 8–64 (see
"Display hardware settings the library refuses" below);
parallel is 1–3 and PWM dither bits 0–2, matching the library. A stored GPIO
slowdown, PWM dither bits or refresh-rate cap of 0 no longer shows (and
re-saves) as 3, 1 or 120, and the refresh cap accepts 0 (no cap). The config
API rejects out-of-range or non-integer
rows,cols,chain_length,parallel,brightness,scan_mode,pwm_bits,pwm_dither_bits,pwm_lsb_nanoseconds,limit_refresh_rate_hz,row_address_type,multiplexingandgpio_slowdownwith a 400 (JSONtrueor5.5used to save as 1 or 5) instead of saving a config the matrix refuses to start with. - Display setting help tips and README / config-reference entries corrected
and completed:
panel_typeandrp1_rioare documented,show_refresh_rateprints to the console rather than drawing on the panel, PWM dither bits raise the refresh rate rather than lowering it, and every numeric setting states its range. - Row Address Type offers 5, the SM5368 / B707 row shift register. The
Waveshare 96x48 V2 panel (back silkscreen
24S-A1) needs it with RGB sequence BGR and, on a Pi 4, a GPIO slowdown of 6–8. Panels with FM6124 column drivers need no Panel Type. - On a Raspberry Pi 5 the pinned rgbmatrix library can drive only row address
types 0 and 2, parallel 1–3 and the standard mappings. For anything else it
returns no matrix, which the Python binding doesn't catch, so the display
service crashed and restarted every 10 seconds.
DisplayManagernow refuses those settings before creating the matrix (logged, reported by/api/v3/hardware/status, fallback mode), the config API rejects them, and the Display form offers only row address types 0 and 2 on a Pi 5. The rule lives insrc/pi5_matrix_support.pyand must be re-checked when the submodule is bumped. - The Plugin Config Warning no longer lists core settings as plugins that are
"in config but not installed" (seen as
auto_updateon 3.4.0, where the advice would have deleted the weekly-update setting). Core top-level config keys now live in one list,src/core_config_keys.py, which reconciliation uses and tests pin toconfig.template.jsonand the settings save endpoint. A stored warning is also dropped once its entry is no longer a plugin in config, so an old verdict clears without a restart. - Check & Update All no longer sends installed Starlark apps
(
starlark:<app_id>entries in/plugins/installed) to the plugin updater, which answered each with a 500 "plugin not found".POST /plugins/updatenow answers astarlark:id with a 400 saying it is a Starlark app. A request that gets no HTTP answer (e.g. the web service restarting mid-run) is re-sent with backoff instead of being counted as failed and skipped — that is how a disabled plugin with an update waiting was silently left out. - Three routes consulted the web process's plugin manifests without
discovering plugins first, so they misbehaved from every
ledmatrix-webrestart until something else ran a discovery — in practice until someone opened the dashboard, measured at over three minutes on one rig.POST /display/on-demand/startandPOST /plugins/toggleanswered 404 "Plugin not found", andPOST /config/maindid not recognise a plugin section, so it skipped secret separation and wrote the plugin's API key toconfig.jsonin plain text instead ofconfig_secrets.json. The routes now discover when nothing has been discovered yet, and rescan once when a specific plugin id (or, for on-demand by mode, a mode) is not found, so a plugin installed since the last scan is found too.
Security (request paths and inline handlers, siblings of #561)
POST /api/v3/plugins/assets/upload,GET .../assets/listandPOST .../assets/deletevalidateplugin_idwithsrc/common/path_safetyand answer 400 otherwise. Aplugin_idof../../configused to create anuploads/directory outsideassets/plugins, write images and.metadata.jsonthere, list it, and delete whatever file a metadata entry named. Delete now unlinks only a path that resolves inside that plugin's uploads directory (any other entry is dropped without touching a file).PluginManager.get_plugin_directory()returnsNonefor anything but a plain name, soPOST /api/v3/plugins/actioncan no longer run a manifest script from a directory outside the plugins directory (../elsewhere); the route also rejects such ids with 400.- Plugin Store, saved-repository and custom-registry buttons escape registry
values for their inline
onclickhandlers (jsStringAttrinplugins_manager.js). An entry id containing'used to close the attribute and add its own script. The store's View button opens onlyhttp(s)links. - The uploaded-images list escapes each file's original name, path and ids; a
name like
<img src=x onerror=...>.pngwas inserted as markup.
Display hardware settings the library refuses
- The rgbmatrix library answers several settings with no matrix or
abort()rather than an error, on every board, so the display service crash-looped instead of falling back: rows above 64,chain_lengthabove 255 (the Python binding stores it in one byte; this was documented as "no upper limit"), a misspelledhardware_mapping, andparallel2–3 on a mapping with one output (adafruit-hat,adafruit-hat-pwm,regular-pi1,classic-pi1) — the last one reachable from the Display form on the default mapping. The config API now refuses them with a 400 naming the setting, andDisplayManagerrefuses a hand-edited one before creating the matrix: logged, fallback mode, reported by/api/v3/hardware/status. The rules, including the Pi 5 ones, live insrc/matrix_support.pyand must be re-checked when the submodule is bumped. /api/v3/hardware/statusaddscause:"settings"when LEDMatrix refused the config,"library"when the library failed. The Display tab banner and the fallback log line give the Pi 5 rebuild hint only for a library failure; they used to follow every failure with it and with GPIO slowdown advice.- The Display form offers the
classicandclassic-pi1mappings and the90/270orientations, and renders any other stored mapping selected with a warning. With no option selected the browser posted the first one, so one unrelated save rewrote those settings. The API accepts orientation90and270, whichDisplayManageralready applied. - The display size the web preview, Starlark magnify default and
scripts/dev/vegas_audit.pycompute (src/display_geometry.py) now appliesorientationandpixel_mapper_configas the library does:Rotate:90swaps width and height,U-mapperfolds the chain. - One Raspberry Pi 5 GPIO slowdown recommendation everywhere: 1–3 in PIO mode, starting at 1. README and the config reference now describe the template values as the defaults; the "code default" values they listed never apply, because config migration fills missing keys from the template.
Plugin system
- A plugin no longer starts with a schema warning and a degraded flag because
config.json still holds a boolean where its schema now has an object with an
enabledproperty (news'global.dynamic_duration: true). The loader reads the boolean as{"enabled": <bool>}before merging schema defaults and validating, the same rule the settings form already applies (legacy_bool_as_objectinsrc/plugin_system/schema_manager.py). Nothing is written at load; the next save of that plugin's settings stores the object. Other type mismatches still warn.
Core
ConfigManager.load_config()no longer raises on a host without the POSIX ownership APIs. The self-heal that chgrp'sconfig_secrets.jsonto the shared group (added in #416) looked upos.geteuidunguarded; that name does not exist on Windows, and the resultingAttributeErroris not anOSError, so it escaped the helper's own "best-effort" handling and every caller's. Any Windows checkout with aconfig/config_secrets.jsongot aConfigErrorfrom every config load and could notimport web_interface.appat all.ensure_shared_group_ownership()now returns immediately whenos.geteuidoros.chownis missing. No behaviour change on the Pi.- Restoring a backup on Windows no longer fails over files that already exist.
The restore carries each replaced file's owner across with
os.chown, which does not exist on Windows; theAttributeErrorescaped the per-file error handling, so the restore stopped atconfig.jsonwith nothing restored. The ownership step is now skipped whereos.chownis missing. No behaviour change on the Pi.
Cache permissions
- The web interface can read what the display service caches again.
ledmatrix-web.servicecarriedCacheDirectory=ledmatrix, and systemd re-owns/var/cache/ledmatrixand its contents to the unit'sUser=whenever the directory's owner differs, which erased theroot:ledmatrixsetgid layout the installers set up: every file the root display service wrote afterwards wasroot:root0660 and unreadable by the web interface (392 unreadable files on one rig, with display status, on-demand state and plugin health empty). Since #547 the web unit is rendered from its template on every install, so every fresh install hit this.DiskCache.setnow gives each file the directory's group (when that directory is group-writable) and 0660 on the open descriptor before the rename, independent of setgid, which also closes a window where a fresh file was visible as mkstemp's 0600.DiskCache.share_existing_filesrepairs files an older version left behind, once per process, throughO_NOFOLLOWdescriptors, skipping hard links and other users' files. Existing installs only ever receivegit pull, so that repair is the fix for them; new installs also dropCacheDirectory=andCacheDirectoryMode=from the web unit. install_web_service.shreplaces an existing cache directory's group whenever the installing user is not in it. It used to replace only root's, so aroot:ledmatrixdirectory belonging to a user outside that group was left alone and everything root wrote there stayed unreadable./display/on-demand/statusand the current-display status read the display service's keys withmemory_ttl=0, as every other cross-process reader already does. They served the first copy the web process had read for the full 120smax_age, so on-demand reported "active" for over 100 seconds after the file on disk said "idle".
Automatic updates and Update Code
- An update that changes
web_interface/requirements.txtis no longer rolled back on every auto-updating device.safe_pip_install.shallowed only the rootrequirements.txt, so the install Update Code and the health check run for the web requirements was refused, and the health check rolls back any update whose dependencies failed (Install Base Requirements failed the same way). The wrapper now allows both core requirement files; a core requirement file symlinked out of the project is refused. - The automatic update's local-change check and Update Code now count changes
the same way (
auto_update.local_changes): permission-only changes and anything underplugins/orplugin-repos/don't count, and a core path that merely containsplugins/does. Such edits used to pass the check and then be stashed by the pull and never restored, despite "will not stash your changes". The pull's--autostashnow carries them across. Update Code still stashes other edits; the automatic update refuses instead. - When the automatic update's own rollback fails (a partial pull, or a health check that never started), plugins are no longer updated and the display is not restarted, as the 3.4.0 notes promised.
- The health check's dependency reinstall no longer retries pip failures or timeouts with a second bash path, and all reinstalls share a 10-minute budget, so a rollback finishes inside the unit's 30-minute limit instead of being killed mid-way.
Installers
- The generated
ledmatrix_websudoers rules are parsed before they are installed. Both installers built the drop-in fromwhichlookups and copied it into/etc/sudoers.dwithout ever checking it, and a malformed file there makes sudo refuse every command for every user — on a headless Pi, that is unrecoverable over SSH.first_time_install.shnow runsvisudo -con the generated file and, if it does not parse, prints what visudo said and leaves the installed file untouched instead of replacing it with a broken one;configure_web_sudo.shdoes the same before offering the rules for confirmation.first_time_install.shalso built that file at a fixed/tmppath as root;mktempnow picks the name.
Small fixes (update-all, plugin system settings, scripts)
- Check & Update All counts a plugin that had nothing to update as
"already up to date" instead of "updated". ZIP-installed monorepo plugins
(most official ones) already at the registry version were called "updated
successfully" on every run.
POST /plugins/updatenow returnsdata.update_status(updated,up_to_date,local_only). - An update request that got an HTTP error answer without an
error_code, or a body that is not JSON (e.g. a reverse proxy's 502 page), is no longer classified asNETWORK_ERRORand re-sent five times. Only a request that got no HTTP answer is retried; the rest areAPI_ERRORwith the HTTP status. - The General tab no longer shows Auto Discover Plugins, Auto Load Enabled
Plugins or Development Mode. Nothing read
plugin_system.auto_discover,auto_load_enabledordevelopment_mode: every enabled plugin was always discovered and loaded. Stored values are kept, and saving the General tab no longer rewrites them tofalse. BackgroundDataServiceshares the 6-hour "ESPN rejects date ranges" memo withfetch_espn_scoreboard, so a background season fetch no longer spends a doomed range request first once either path has seen a rejection.scripts/install_plugin_dependencies.shinstalls from the configuredplugin_system.plugins_directory(defaultplugin-repos, where the Plugin Store installs) and also scansplugins/for dev symlinks. It used to scan onlyplugins/and find nothing. A failedpip installis now reported as a failure instead of being hidden bytee.scripts/verify_installation.shno longer fails a healthy install: it checked for the removedweb_interface_v2.pyand port 5001. It andscripts/verify_web_ui.shnow check port 5000, where the web interface listens.scripts/install/install_service.sh --helpprints usage and exits without changes. It used to ignore the flag and reinstall and restart every service. Unknown arguments are rejected before anything runs.scripts/diagnose_web_ui.sh,scripts/diagnose_web_interface.shandscripts/debug/debug_web_manual.pyapply the launcher's own autostart rule (only an explicitweb_display_autostart: falsekeeps the web interface down), so a missing key no longer shows as disabled. The shell scripts also checkweb_interface/blueprints/api_v3/, which became a package, instead of reportingapi_v3.pyas missing.
Docs and developer tools
docs/REST_API_REFERENCE.mdrechecked against every handler: request fields that made documented calls fail (repo_url,action_id/params,files/image_id,font_file+font_family,?font=, cachekey,auto_enable_ap_mode, plugin limit keys) and response shapes are fixed, the removed font-override endpoints are gone, and the 26 undocumented routes (backup, git/auto-update, WiFi radio, Starlark editor, MQTT bridge, status endpoints, skins) are listed. Store search is/plugins/store/list?query=.FONT_MANAGER.mdno longer tells plugins to readdisplay_manager.font_manager, which does not exist; useplugin_manager.font_manager/BasePlugin._get_font_manager().- Plugin docs,
DisplayManagerdocstrings and the bundledstarlark-appsplugin now all read the display size fromdisplay_manager.width/height, which works in fallback mode wherematrixisNone. scripts/dev/dev_plugin_setup.sh link-github <name>links the plugin from a clone of theledmatrix-pluginsmonorepo (per-pluginledmatrix-<name>repositories no longer exist).dev_plugins.jsonhonoursgithub_user,plugins_repoandplugins_branch;dev_plugins.json.exampleships anddev_plugins.jsonis git-ignored.update/statushandle monorepo links, andstatusno longer exits 1 when nothing is broken.- Rewritten for current behaviour: plugin dependency installation (web service
runs as the installing user and installs through
safe_pip_install.sh),PLUGIN_CONFIG_ARCHITECTURE.md,MULTI_ROOT_WORKSPACE_SETUP.md; staleapp.pyline numbers,api_v3.pypaths, StreamManager method names, nonexistent version-bump scripts andledmatrixservice user references removed.
3.4.0
Plugin-facing changes since 3.3.0 (tag v3.3.1) not covered further down:
BasePlugin.get_update_interval()(#555) — return seconds to override the manifest'supdate_intervalat runtime (e.g. poll fast only while a game is live), orNoneto keep it. Clamped to at least 5 seconds; a raising or non-numeric return is ignored. Called every scheduling tick, so keep it cheap. Older cores never call it. Seedocs/PLUGIN_API_REFERENCE.md.src.common.scroll_config(#523) — turns a plugin's scroll config into a configuredScrollHelperin one place, replacing per-plugin resolution that disagreed between tickers, and warns when a speed won't advance whole pixels per panel refresh. Floor on 3.4.0 to import it.- Skins are marked unsupported. No current scoreboard plugin builds on
src.base_classes, so the skin hook (SportsCore._render_game) never runs. The web UI no longer shows the Visual Skin dropdown, the store hides and refuses"type": "skin"entries, andGET /api/v3/skinsreports"supported": false. Savedskinconfig values still load and save.src/skin_system/is unchanged. - Web preview size now comes from
src/display_geometry.py, the same computationDisplayManageruses: double-sided setups preview one screen, and a missingchain_lengthdefaults to 2 everywhere (the Starlark magnify default and the sync handshake used 1). The module is core-internal: plugins keep readingdisplay_manager.width/height. src.common.font_layout(#539, #565) —load_truetype()isImageFont.truetypewith the layout engine pinned, so text lays out the same whether or not the host's Pillow was built with libraqm;crisp_size()andFONT_PIXEL_GRIDgive the size a bundled face renders on whole pixels at (sports_cardstill re-exports them);resolve_asset_path()resolvesassets/fonts/...against the install root, not the working directory. Floor on 3.4.0 to import it. Relatedly,DisplayManagernow draws text 1-bit (#521), so golden images recorded against 3.3.x may need regenerating.
Install and updates
Weekly automatic updates (#581), off by default. Switching on
Automatically check for and install updates once a week on the General tab
(or first_time_install.sh --enable-auto-update / LEDMATRIX_AUTO_UPDATE=1)
updates the core and then every installed plugin once a week, preferably 2–5 AM
local time. It follows the branch the checkout tracks — main on a standard
install — so a device gets whatever has merged there, not only tagged releases.
See docs/WEB_INTERFACE_GUIDE.md.
- The core step is skipped, with the reason shown, when the checkout has local edits or commits, a rebase or merge is in progress, the branch has no upstream, less than 300 MB is free, or that commit was already rolled back.
- After pulling,
ledmatrix-update-verify.servicerestarts the services and requires the web interface to answer and the display to stay up. If they don't, or the new requirements fail to install, it resets to the previous commit, reinstalls its requirements and restarts again. Anything but success shows under the toggle and as a banner on Overview. - Plugins update through the Plugin Store even when the core step is skipped,
fails or is rolled back. A plugin version whose
ledmatrix_min_versionis above the device's core is held back, not installed. When the core did update, plugins wait for its health check, and are left alone if that check never reports or the rollback fails. - No SSH is needed: switching the toggle on restarts the display service, which
installs the health-check units (
src/auto_update_setup.py, core-internal and not a plugin API).
Installer and service fixes:
- rgbmatrix builds on ARMv6 boards (Pi Zero, Pi 1); an existing checkout is moved forward to the new pin and no longer left root-owned (#577).
first_time_install.shgrants the web usersafe_pip_install.sh, asconfigure_web_sudo.shalready did, so plugin requirements install where the display service can see them (#579).- The web interface starts when
web_display_autostartis missing orconfig.jsonis unreadable; only an explicitfalsekeeps it down (#556). - Installers render every systemd unit from its
systemd/template, so the boot-time unit-drift warning can clear, non-root installs included (#547).
Scrolling
- Frame pacing (#523). The loop waits only for the rest of each panel refresh instead of a flat 8 ms: 44–46 fps → 100 fps, and slow frames 14% → 0.02%, on a 2×128×64 chain. Sub-pixel blending is off by default again (it shimmered on pixel fonts; Vegas mode still opts in).
- Whole-pixel steps (#545). At a speed
scroll_configcan render in whole pixels, every frame advances by exactly the same amount, removing about six hitches a second. A loop that can't keep up now scrolls slightly slow rather than jumping. - The eight sports scoreboards scroll through
scroll_configtoo (#542): the default 50 px/s holds each frame for two refreshes instead of alternating 0 px and 1 px steps. - Frame stats ignore the pause between scrolls (#582). The
Scroll frame statslog line counted the idle wait before each scroll as one frame, inflatingmaxand the stall rate.docs/SCROLL_PERFORMANCE.mdnow describes the line actually logged.
Plugins
FontManagerregisters the bundledtom_thumbfont, so plugins no longer need a private loader (#534).- The test harness's
set_scrolling_state()acceptsframe_hold, asDisplayManager's does (#534). - A
display()with nothing to draw should returnFalse, the only value the controller skips on; starlark-apps now does, rather than holding a black panel (#534). - Starlark apps may set
render_width/render_heightin theirconfig.jsonto render at their own canvas size instead of Pixlet's 64×32 (#552). scripts/render_plugin.py --display-mode <mode>renders one mode of a multi-mode plugin; scoreboards previously rendered blank (#522).- Scoreboards resolve their own directory under the real plugin loader
(declare
_PLUGIN_DIR), so 4x6 text snaps to its 7px grid instead of rendering a pixel narrow, and an unreadable schema is logged (#519, #520).DisplayManagerloads 4x6 on that grid too (#565). - The 5x7 BDF face reports a real height, so rows stacked by
get_font_height()no longer overlap (#539). LogoHelperremembers a missing logo instead of warning every rotation (#548), and the decoded sports logo cache is bounded (#559).
Web interface
- Installed Plugins has search, All / Enabled / Disabled / Updates filters and sort (#540).
- Hardened and polished per the September 2026 audit (#568): utility classes
such as
.hiddenactually exist, focus rings, labels and modal focus trapping, dark theme throughout, no overflow at phone width, and background streams pause when hidden, with first-load JS/CSS down from 1358 KB to 291 KB. - WiFi Connect works from the LEDMatrix-Setup hotspot: the page is answered before the hotspot drops, and reopening it shows why an attempt failed (#571).
- Pixlet install, the Starlark app store and app toggles work again (#535, #537); the store uses the configured GitHub token and reports a rate limit instead of drawing a blank grid (#541).
- Plugin config: geochron and news saves no longer always fail (#575), the page survives stored values the schema outgrew (#578), the form uses the full page height (#573), and file-manager widgets show the script's error (#574).
- The live status stream reports real disk usage and available memory (#558);
a system action refused for want of passwordless sudo says so and names
configure_web_sudo.sh(#560).
Tools and security
- CodeQL triage (#561): 129 of 134 alerts fixed. Three were exploitable
path-handling flaws in the web interface and are closed; web UI escapers now
escape quotes, and URL fields refuse script schemes. Path checks share
src/common/path_safety.py(core-internal). - Home Assistant MQTT bridge (
integrations/mqtt_bridge, #538): mode select, stop, power and brightness over MQTT Discovery. - Tools tab manages the MQTT bridge and the Pixlet editor (#554); the
editor stays on loopback when
PIXLET_EDITOR_HOSTsays so.
Fixes
- Updating a plugin whose directory is named for its manifest id (leaderboard, music, stocks, weather) silently did nothing (#536).
- Plugin reconciliation no longer reports working plugins as stale or replaces their config with a stub, and the Overview banner advises each case correctly (#557).
- Two config saves in the same second no longer share one backup, so rollback restores the version asked for (#564).
- On-demand: a second request is honoured without a restart (#534), a pinned request stays on its mode, and restarting mid-session loads every plugin again (#538).
/healthand/display/currentreport real state, and the preview no longer freezes on a leftover snapshot temp file (#534).
Per-element display customization
Per-element display customization, and the last mile of it into the web UI. A user can set the font, size, colour, position, visibility and alignment of individual display elements per plugin -- and, where a plugin has display modes, separately per mode.
New public API a plugin may import via src.* (floor on the release that
ships this):
src.element_style.layout_offset(config, element, axis, default, mode)andelement_color(config, element, default, mode)— the stateless reads the scoreboard helpers share. There were three copies of the offset read and two of the colour read; these are the one implementation, and they carry the element-name aliasing and the per-mode lookup.src.element_style.alias_keys(element)— the names one element may be stored under. The style block names elementsscore_textwhile the layout block saysscore, andrecords/recordandstatus_text/statussplit seven to two across the published schemas. A lookup tries the exact name first, so this is inert for a config that already matches.src.element_style.element_visible(config, element, default, mode),element_align(...)andelement_scale(...)— the stateless reads for the three knobs the resolver already understood but no draw path consumed, so an element could be marked hidden in the web UI and still render.SportsCoreSharedMixin._draw_text_with_outline(..., element="score_text")— naming the element resolves its colour by name and honours its visibility toggle. Without a name the colour is inferred from font-object identity, which cannot separate two elements sharing a face; that is the case every bitmap font is in, because afreetype.Facecannot be re-instantiated, and it is how a BDF-rendered element silently lost a configured colour. Shared faces now resolve when exactly one sharer has a colour set.LogoHelper.load_logo(..., scale=)— applies a user's image scale, and keys the cache on the scaled box so two elements scaled differently cannot be served each other's image.src.element_style.native_bdf_size(font)— the one pixel size a bitmap font can render at, or None for a scalable one. The web UI needs this to know whether a size control can take effect at all.ElementStyleResolver(config, defaults, mode=...)plusvisible,alignandscaleonElementStyle. The mode binds to the resolver rather than being passed per call, so a plugin with one instance per mode makes every existing lookup mode-aware by setting one class attribute.BasePlugin.styles/styles_for(mode)/STYLE_MODE— the accessor every plugin inherits, so adopting this is no longer a guarded import plus schema discovery plus resolver invalidation in each plugin.SportsCoreSharedMixin._get_layout_offset— promoted from the plugins' bundled copies. Each still carries its own, which wins by MRO, so adopting it is a deletion.
Schema and web UI:
- A
customizationblock is now rendered by a composite style editor: one row per element rather than nested accordions, with a tab per declared mode. Plugins that hand-wrote their style blocks get it without a plugin release;x-style-elementsandx-style-modesdeclare it compactly. - Font fields become a real picker rather than a hardcoded
enum, so a font the user uploads is selectable. Bitmap fonts taller than the element's declared size ceiling are filtered out, because a bitmap font ignoresfont_sizeand renders at its own size. /static/plugin-widgets/<plugin>/<widget>.jsserves a plugin's own web-UI widgets. The client half and the docs already existed; nothing served them.
Fixed:
- A bitmap font asked for a size it has no strike for fell back to PressStart2P — a different typeface — rather than to its own native size. 32 of the 35 shipped fonts are bitmap, so this was reachable for most font choices.
- The plugin config form read
config_schema.jsondirectly while the save route read it throughSchemaManager. Only the latter expands a compactx-style-elementsdeclaration, so a plugin using that form had a customization section that rendered as empty space. unshare_element_fontsrebuilt faces through bareImageFont.truetype, bypassing the layout enginesrc/common/font_layout.pypins. These were the only two call sites insrc/doing so.- The form parser compared a schema type to a bare string, so a nullable field
(
["array", "null"]) never had its indexed colour inputs recombined, and a blank one became[]rather than null.
Removed:
- The Fonts tab's "Element Font Overrides" panel and its three endpoints. They
reported success and saved nothing, and the element keys the panel offered
(
nfl.live.score,clock.time) are read by no plugin, so wiring them to the realFontManagermethods would still have changed nothing on the panel. Per-element font choice now lives in each plugin's own config editor. - "Detected Manager Fonts", which listed every installed font with a hardcoded usage count.
- Two dead client-side config-form renderers in
app-shell.js(~580 lines) and the legacyplugins/config_manager.js, superseded by server-side rendering.
3.3.0
Historical note: tags v3.3.0 and v3.3.1 both report __version__ "3.3.0" and both ship src/common/sports_shared.py, so a "3.3.0" floor always means a core with sports_shared.
The release the sports scoreboards floor on to delete their bundled copies.
3.2.0 shipped the unified sports library and made ledmatrix_min_version
enforceable; this ships the last three shared modules and completes the store
gate, so a scoreboard can now floor here and carry no fallback at all.
New modules a plugin may import via src.* and floor on 3.3.0 for:
src/common/sports_card.py— settings, colour, font and date helpers for a scoreboard'sgame_renderer.py. Free functions takingconfig/fontsexplicitly, so nothing about the caller's class is assumed.src/common/sports_game_renderer.py—SportsGameRendererMixin: scroll/Vegas card geometry (centre gap, logo slot and cache key, layout offsets, the upcoming-card date and time layout). No__init__and no state, so adoption is one line on the class statement.src/common/sports_shared.py—SportsCoreSharedMixin,SportsLiveSharedMixin,SportsRecentSharedMixin: thesports.pybodies byte-identical in all eight lineage-sharing scoreboards.
All three sit under src/common/ rather than src/base_classes/sports/,
deliberately: importing that package pulls core.py → DisplayManager →
rgbmatrix, and these are pure logic. Plugins importing them must not acquire a
hardware dependency.
Three notes for anyone adopting sports_shared:
SportsRecentSharedMixindefines__init__. Its baresuper()binds to the mixin, so it reaches the host only when the mixin is listed first in the bases. Reversing that order silently skips the host constructor.- Methods that resolve the plugin's
config_schema.jsonuse_plugin_dir(), which walks the MRO rather than reading__file__—__file__is nowsrc/common/. It walks becauseSportsCoreis an ABC: a subclass built withtype(name, bases, ns)reports__module__as"abc". _get_timezone,_extract_game_detailsand_fetch_dataare byte-identical across the eight but stay in the plugins. The first binds a per-plugin timezone module whose contents differ; the other two are the abstract stubs that define the sport.
The store's compatibility gate is now on every registry-managed route. 3.2.0
gated install_plugin. This release gates the git-pull update path and
install_from_url, so a plugin whose floor the core cannot meet is refused
after download with no partial directory left behind.
Fixed
- ESPN 403s.
site.apibegan rejecting the User-Agent strings this repo sent on 2026-08-04; every shared-data-source scoreboard returned403 Forbidden. Requests now send an identifying token with a project URL — browser-style strings and bare custom tokens are both refused. - Low-memory boards becoming unreachable under load while still answering pings and serving the web UI. Fetched payloads are released after delivery rather than pinned on the completed request for up to an hour, malloc arenas are capped, and log volume and SD writes are reduced. Available memory is now reported in Tools diagnostics.
- A failed logo download pinning a team to a grey box: the placeholder was written under the real logo's filename, so later attempts found a file and reported success without retrying.
- A plugin enabled but never loaded is retried rather than staying absent
with
error = null. ttlnow controls cache expiry; abandoned cache writes no longer leave temp files; one cache-cleanup thread per directory rather than per manager.- Odds are fetched for the games displayed, not the whole schedule window, and a stalled ESPN no longer stalls the whole plugin update.
- Array-item secrets are no longer wiped or logged.
- A restored backup matches the device it was taken from.
- The web UI reports the real error instead of "unknown", rejects non-finite JSON numbers, and stops checkbox groups posting back hidden options.
Added
display.hardware.orientationfor panels mounted upside down.- Vegas keeps live content in the ticker rather than being preempted by it.
- Schemas can label enum dropdown options.
3.2.0
The first release shipping the unified sports library. This is the version
a sports plugin floors ledmatrix_min_version at before deleting its bundled
copy of sports.py, scroll_display.py, data_sources.py or
base_odds_manager.py — the sunset rule in
docs/plugin-development/08-shared-sports-code.md keys on exactly this number.
Adoption is deliberately staged: the modules below ship here, plugins adopt them behind guarded imports, and only then do the bundled copies go away. Nothing in this release changes what an existing plugin loads.
This is also the first release that enforces ledmatrix_min_version.
Before it, the floor was advisory — the loader logged a warning and continued,
and the plugin store never compared the core version at all, so an update could
deliver a plugin that could not run. From 3.2.0 the store refuses such an
install. That matters for the sunset rule: a plugin may only delete its bundled
fallback once the cores in the field actually enforce the floor, which means
waiting for 3.2.0 to be widely installed rather than merely released. See
docs/SPORTS_UNIFICATION.md, phase B6.
One deliberate exception: a core reporting a version below 2.0.0 is treated as
unknown rather than old and is never blocked. The v3.1.0 release ships
__version__ = "1.0.0" (the tag was cut before the string was bumped), and
nearly every published manifest floors at 2.0.0 — so blocking on that number
would lock those users out of the plugin store entirely.
Added
-
src/element_style.py— per-element style resolver backing thex-style-elementsconfig-schema extension. Already consumed (behind guarded imports with classic fallbacks) by theof-the-day,ledmatrix-music, andfootball-scoreboardplugins. -
Core unit-test CI job enrolling the previously unenrolled suites (skin system, data sources, API extractors, scroll helper, adaptive layout, loader compatibility warning) plus new characterization tests for
src/base_classes/sports.pyahead of the shared sports-code unification. -
src/base_classes/sports/—sports.pyis now a package (core.py+modes.py). The import path is unchanged:from src.base_classes.sports import SportsCorestill works. -
Nine methods promoted onto the sports base classes from the plugins' bundled copies, plus the override points
_favorite_key,_config_schema_pathand_font_rootand the class attributesFINAL_PERIOD/CLOCK_COUNTS_DOWN. Seedocs/SPORTS_UNIFICATION.md. A plugin may start calling these once its manifest floorsledmatrix_min_versionat the release that ships them. -
src/base_classes/sports/capabilities/— opt-in capabilities for the sports scoreboards, composed by inheritance rather than gated by config branches inside the base classes:CelebrationMixin— the score/win takeover, merging the goal and score dialects behind thescore_phrase()/win_phrase()hooks, theCOALESCE_SCORING_SEQUENCEclass attribute and the_favorite_keyseam. Reads both thecelebrate_opponent_goalsandcelebrate_opponent_scoresconfig spellings. Sports that do not mix it in have none of this code in their MRO.RotationStrategy+ a name registry (swrr,weighted,simple, plusregister_rotation_strategyfor plugin-supplied orderings). Each built-in is verified against a verbatim transcription of the plugin implementation it replaces. An unknown name degrades tosimple.
-
src/common/sports_scroll.py—SportsScrollDisplayandSportsScrollDisplayManager, the shared scroll orchestration layer for the sports scoreboards, plus native support forglobal_config['target_fps'](the bundled plugin copies hardcode ~100 FPS viascroll_delayand never consult the global target). Content building (prepare_scroll_content,_load_separator_icons) is per-sport and stays an override point — seedocs/SPORTS_UNIFICATION.mdfor where the line falls and why. -
src/plugin_system/compatibility.py— the single place that answers "can this plugin run on this core?", shared by the loader (advisory, at load time) and the store (blocking, at install/update time) so the two cannot drift. Reads every spelling published manifests use, including the deprecatedversions[].ledmatrix_min. It does not yet evaluatecompatible_versions, which is the schema-required field and can express upper bounds; closing that is tracked indocs/SPORTS_UNIFICATION.mdbefore B6. -
scripts/check_release_version.pyand aRelease version checkworkflow — assert that a tag, the newest CHANGELOG heading andsrc.__version__agree, on pushedv*tags and published releases. Runnable viaworkflow_dispatchto check a tag before creating it. Added becausev3.1.0was tagged six weeks beforesrc/__init__.pywas bumped to match, which is why devices installed from that release report1.0.0.
Changed
src/__init__.pybumped to 3.2.0 — the number the sunset rule keys on.- The plugin store refuses an incompatible install.
StoreManager.install_pluginnow checks the downloaded manifest's declared floor againstsrc.__version__and refuses when the plugin needs a newer core. The check sits ininstall_pluginbecause_reinstall_with_rollbackcalls it, so a refused update restores the version the user already had. Refusal requires evidence: an undeclared floor, an unparseable version on either side, or an untrustworthy core version all allow the install. - A failed install no longer destroys the plugin it replaced.
install_pluginpreviously deleted the existing plugin directory before downloading, so any later failure — a dropped connection, a malformed manifest, or the new compatibility refusal — left the user with nothing. The existing copy is now set aside and restored if the install fails, matching the protection_reinstall_with_rollbackalready gave the update path. web_interface.__version__re-exportssrc.__version__instead of carrying its own hardcoded"3.0.0", which had drifted two majors from the core.- Live games are no longer dropped when the feed omits a game clock.
SportsLive._is_game_really_overpreviously (in the baseball and UFC plugin lineages) coerced a missing or non-string clock to the literal"0:00"and then treated the game as finished onceperiod >= 4. Baseball has no game clock andperiodis the inning, so live MLB games disappeared from the scoreboard from the 5th inning onward; UFC was affected the same way. The clock check is now skipped when the clock is unusable, and the period threshold is the per-sportFINAL_PERIOD(hockey ends in P3). Sports whose clocks count up — soccer, AFL, NRL — setCLOCK_COUNTS_DOWN = Falseand never run the check at all, since0:00there means kickoff rather than expiry.
Fixed
- Plugin updates could hang the web request thread. The per-plugin reinstall
locks were non-reentrant, and
_reinstall_with_rollbackholds one across its call toinstall_plugin— which now takes the same lock to protect the set-aside/restore above. That nesting deadlockedupdate_plugin → _reinstall_with_rollback → install_plugin, the standard path for every monorepo plugin update. The locks are nowRLocks. FontManagerresolvesassets/fontsagainst the core install root instead of the process working directory, so font loading works when the process starts elsewhere (e.g. the plugin safety harness on CI).- Hockey events whose competitors carry no
statisticsarray are no longer discarded. The extractor readcompetitor["statistics"]unguarded, so aKeyErrorinside the generator dropped the entire event despite valid scores and status; shot counts now fall back to0. - Live baseball events that populate status only at the competition level are
no longer discarded. The extractor read the event top-level
game_event["status"]for the inning; real ESPN events duplicate it, but MiLB events synthesized from the MLB Stats API do not, so the lookup raised a bareKeyError. It now reads the already-validated competition-level status. SportsLive._is_game_really_overno longer crashes the live-update pass when a feed sends an explicit nullperiod.None >= FINAL_PERIODraisedTypeError, and the only caller (_detect_stale_games) has notry/except— the same failure shape as the already-fixed nullperiod_text.- An expired clock spelled
"00:00"now ends the game. The check compared the colon-stripped clock against a hand-listed set of literals, which"0000"is not a member of, so a finished game with a two-digit-minute clock stayed on the scoreboard indefinitely. The comparison is now numeric. SportsCore._load_fontsresolvesassets/fontsthrough the_font_root()seam instead of the process working directory. Started outside the install root, every scoreboard font silently degraded to PIL's default bitmap face.SportsCore._should_logno longer raisesAttributeErroron the first warning of a run;_last_warning_timeis initialized in__init__rather than lazily by an unrelated method.SportsCore._resolve_project_pathresolved relative logo directories against<root>/srcinstead of the repo root aftersports.pybecame a package — the class bodies moved byte-identically but__file__gained a directory. Both it and_font_rootnow derive from one_INSTALL_ROOTconstant.
3.1.0
Baseline for this changelog. Highlights already shipped at this version: skin system for sports scoreboards (#419), Vegas continuous-scroll overhaul (#423), plugin update surfacing (#421).