Skip to content

MNT: Middleware organization for LEDs and New Behaviour Fields. - #9

Open
diogoalvessoares wants to merge 2 commits into
developfrom
feat/middleware
Open

diogoalvessoares wants to merge 2 commits into
developfrom
feat/middleware

Conversation

@diogoalvessoares

@diogoalvessoares diogoalvessoares commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Notes

  • New features
  • Bug fixes
  • Documentation
  • Maintenance
  • Tests
  • Design

Old behaviour

  • middleware: did not have any kind of technical documentation or layout configuration for LEDS or fields for the new behaviours or fade transition requests.

New behaviour

  • middleware: now has technical documentation, layout configuration for LEDS, fields for the new behaviours and fade transition requests.
    Since the changes are huge and the code is big, it might become confusing. So, here's a little breakdown on what is happening:

  • BLUE CHANGES: Small changes:
    -> lines 56-72: If the value is None, the function returns None. This is a good variable-state check for behaviours (behaviour_clock, behaviour_blush) and others (sleep_mode) that require the None state information in order to develop their functions;
    -> lines 146-154: Display assets for LED drawing (digits, letters, icons). Loaded once at import time and shared across all Leds instances.

  • GREEN CHANGES: Most of the added stuff is just technical documentation. Other than that, the green changes that improve middleware's functionality are here:
    -> Class Leds (lines 474-868):
    --> lines 636-698: The dev can choose between using the upper/lower half of the LEDS or both, using create_top_canvas(), create_bottom_canvas() and merge_halves(top, bottom) functions respectively;
    --> lines 525-528: The middleware also sets fields for fading transitions.
    --> lines 838-867: The middleware sets a request fade transition to the driver_leds.
    -> Class Behaviours (lines 1257-1273):
    --> line 1266: Blush is set to False now. All behaviours work with False;
    --> lines 1267+1272+1273: New fields for the behaviours.

@diogoalvessoares
diogoalvessoares requested a review from a team May 8, 2026 14:35
@LVGoncalves LVGoncalves changed the title FEATURE: Middleware: Layout for LEDS, LED Fade Transition requests and New Behaviour Fields. MNT: Middleware organization for LEDs and New Behaviour Fields. May 8, 2026
@LVGoncalves

Copy link
Copy Markdown
Collaborator

Hello Diogo!
This looks really good. Just a small sugestion, keep the names of the pull requests as concise as possible, focusing on what change or was added. The details will be reviewed in the commits.
And even though this is associated with new behaviours, this is more of a clean up and like you named your commit, this is more of a "chore" than a "feature", since it is a refactor.

@diogoalvessoares

Copy link
Copy Markdown
Collaborator Author

Hello Lucas!
Thanks for letting me know that this is a good change.
Got it. I'll keep the pull requests as concise as possible. Less padding.
Got it. Title changed. Comprehensible.
Let me know if you need anything else.

Regards,

Diogo.

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.

2 participants