-
Notifications
You must be signed in to change notification settings - Fork 779
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
Circuit Python projects that use adafruit_button library should be updated to use new API #1209
Comments
This actually is broken now on the pyportal titano with circuitpython 6.0. even though the deprecation message is provided, the images itself do not display at all from the user_interface example here: https://learn.adafruit.com/making-a-pyportal-user-interface-displayio/the-full-code |
@nezra thanks for reporting that issue. I will try to take a look later on tonight at that example and see if I figure out what might be going on with it. Getting these updated to the new Button API fell off my radar it seems as well. I will try to get a PR this week to change these if they still need it. |
I ran the code in that guide with:
and all of the buttons were shown properly for me. Which one(s) are not being shown for you? |
No button, no background. I have the pyportal titano if that makes a difference. I'm on 6.0.1 stable |
Nevermind! found the issue. The default code sets the brightness to "0.3". On the Titano, whenever the brightness is set to less than 0.5, it turns the display off completely in that sample code. I'm not sure where to report that since it appears to be an issue with board.DISPLAY.brightness. i tested it outside of the learning code by itself, and the same issue occurs. |
Perhaps the Titano treats brightness differently than the others, I'm not sure. I think the main circuitpython repo would be the best spot for the larger potential issue with brightness. But knowing that it is occuring it might also be good to change the sample code so that it will work as close to expected as possible on all of variations of the device. I did make a PR here that updates the bottom API code in this example if you're interested in trying it out. (Don't think it will have any affect on the brightness situation though) #1422 |
In the adafruit_button library PR #23 the button API was changed slightly so that the button itself can be added to Groups and Displays rather than needing to add the
group
property like:button.group
.The code is backward compatible, and the old version prints a deprecation warning.
I put together a little script to search the projects in the repo to find ones that make use of adafruit_button
here are the ones I found:
It's not quite urgent since the backward compatibility is provided so these will not break. I can work my way through this list.
But it may also serve as a "good first issue" for someone
so I'll tag it(Doesn't look like I can tag). If anyone finds this and wants to work on it and needs help feel free to reach out to me here or on discord.The text was updated successfully, but these errors were encountered: