feat: partial refresh support via py-opendisplay 7.11.1#57
Merged
Conversation
Adds "partial" as a refresh mode for upload_image and drawcustom. A PartialState per config entry tracks the last uploaded frame + etag; partial refreshes diff against it and update flicker-free via the 0x76 protocol, while full/fast refreshes re-baseline the state so the next partial diffs against the frame actually on the panel. All panel handling lives in the library: automatic fallback to a full upload when partial is not possible, automatic full-frame region expansion on panels that require it (partial_update_support=2, OpenDisplay/Firmware#80), and identical frames skip the transfer entirely. Legacy numeric refresh_type 2/3 map to partial. Also fixes the compression gate for streaming-decompression-only configs (bit 0x01 without ZIP): such panels uploaded every frame uncompressed. Requires py-opendisplay 7.11.1 (partial support, compression gates, and the epaper-dithering 5.0.8 tone=auto NaN fix without which bilevel drawcustom frames render all-black).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements partial refresh for
upload_imageanddrawcustom, superseding the approach in #47 now that py-opendisplay ships native support (thanks @jonasniesner for the groundwork — the per-entry state pattern follows your PR).refresh_mode/refresh_type:partialdiffs against the entry'sPartialStateand updates flicker-free via 0x76;full/fastre-baseline the state (doubling as the periodic deghosting refresh). Legacy numeric2/3map to partial.partial_update_support: 2panels (Partial refresh (0x76) erases all content outside the rect on EP426 — white-fill at partial START relies on panel-LUT behavior that EP426 doesn't have Firmware#80) — nocompute_partial_regionmonkeypatch, no separatepartial_fullmode — and identical frames skip the BLE transfer entirely.py-opendisplay==7.11.1: brings partial support (#116), the streaming-only compression gate fixes (#114, also applied to this repo'sprepare_imagegate), and epaper-dithering 5.0.8 — without whichdrawcustom's defaulttone=autorenders bilevel text frames all-black (NaN collapse, epaper-dithering#51).Hardware verification (EN05, EP426 800×480 MONO, fw 2.0,
partial_update_support: 2, via a live HA dev instance)drawcustomscenario suite over BLE, camera-verified: timestamp ticks over a dithered gray field (3 cycles, zero degradation), inverted status bar appear/replace, progress bar updates, and an identical-payload call correctly loggingNo pixels changed; skipping uploadwith no transfer. Etag chain unbroken across 7 operations; ~2.3 KB compressed wire per full-frame partial.fullrefresh restores uniform blacks — which the state handling makes cheap.Notes
fullremains the default; partial-by-default with a configurable every-N deghost full could be a follow-up.PartialState.to_bytes()persistence via a Store is possible later.🤖 Generated with Claude Code