-
Notifications
You must be signed in to change notification settings - Fork 10
Implement SH1107 sleep/wake functionality #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Added: self._awake - stores current state of the display state - property that returns the current state sleep() - method that puts display to sleep wake() - method that wakes display from sleep
Received error during PR submission checks that the rev: fields of the black and reuse-tool repos cannot be mutable objects. Changed rev from "latest" to the current version numbers for each repo.
@SAK917 Looks like I forgot to update some stuff on this library. I'll do that tomorrow and then merge it with your fork which will hopefully make your PR pass. |
PR check-in failed Pre-commit hooks test indicating these files had missing copyright and licensing info. Added headers as per @dherrada.
@SAK917 Just heard you're working on adding the licenses. That'd be greatly appreciated! If you've got any questions, feel free to ping me |
Addressed the following pylint errors: unused-import [13,1] redefined-builtin [16,1] wrong-import-order [16,1] wrong-import-order [17,1]
@dherrada Happy to do what I can... thanks to a LOT of patience and help from @askpatrickw, I was able to muddle through all the changes the checks flagged. Most were for the supporting files, sorry for all the commits! |
@SAK917 Great to see that it's passing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the code and the changes look straight-forward.
I do not have this device so did not test.
I suggest rebase and merge when approved.
Changed name of display state property from "active" to "is_awake" to clarify it refers to the display state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One API suggestion.
Changed property name from state to is_awake Made self._is_awake private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 1.1.0 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1107#2 from SAK917/main > Added pre-commit and SPDX copyright
Add
sleep()
andwake()
methods and astate
property to allow users to put the display into a power-saving mode. Uses thebus
object passed to the SH1107 class at initialization to write to the device. Commands for entering and exiting sleep mode derived from the SH1107 datasheet.Tested on a Feather M4 Express and SH1107 FeatherWing OLED 128x64 display.