MNT: Middleware organization for LEDs and New Behaviour Fields. - #9
Open
diogoalvessoares wants to merge 2 commits into
Open
diogoalvessoares wants to merge 2 commits into
diogoalvessoares wants to merge 2 commits into
Conversation
Collaborator
|
Hello Diogo! |
Collaborator
Author
|
Hello Lucas! Regards, Diogo. |
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.
Notes
Old behaviour
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.