Skip to content

feat(ed047tc1): add partial_update() to reduce e-ink panel wear#12

Merged
patrick3399 merged 1 commit into
mainfrom
feat/ed047tc1-partial-update
May 21, 2026
Merged

feat(ed047tc1): add partial_update() to reduce e-ink panel wear#12
patrick3399 merged 1 commit into
mainfrom
feat/ed047tc1-partial-update

Conversation

@patrick3399
Copy link
Copy Markdown
Owner

Summary

  • Adds partial_update(x, y, w, h, mode=MODE_GL16) for zone-specific refresh with selectable draw mode
  • Extracts copy_buffer_to_epd_(x, y, w, h) helper to eliminate code duplication between update() and partial_update()
  • update() behavior is unchanged — full screen, MODE_GC16

Draw mode guide

Mode Flash Grayscale Wear Recommended use
MODE_GC16 yes 16 levels high Full refresh, ghosting cleanup
MODE_GL16 no 16 levels ~3x lower Routine partial updates (default)
MODE_DU no B&W only lowest Animation

Usage example

time:
  - platform: homeassistant
    on_time:
      - seconds: 0
        then:
          - lambda: |-
              id(my_display).partial_update(0, 0, 540, 560, MODE_GL16);

interval:
  - interval: 1h
    then:
      - component.update: my_display  # full GC16 to clear ghosting

Test plan

  • Confirm partial_update() refreshes only the specified region
  • Confirm update() still does full screen GC16 refresh
  • Confirm no regression on M5Stack PaperS3

Closes #10

Adds partial_update(x, y, w, h, mode=MODE_GL16) for zone-specific
refresh using lighter draw modes, extending panel lifespan ~3x for
frequently-updating content like clocks or sensor dashboards.

Also extracts copy_buffer_to_epd_() from update() to eliminate
duplication. update() behavior is unchanged (full screen, MODE_GC16).

Closes #10

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@patrick3399 patrick3399 merged commit 8ca1c24 into main May 21, 2026
0 of 7 checks passed
@patrick3399 patrick3399 deleted the feat/ed047tc1-partial-update branch May 21, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: partial_update() to reduce e-ink panel wear

1 participant