-
Notifications
You must be signed in to change notification settings - Fork 37
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
Docs: Prefer module-specific settings over board configs #161
Comments
@jreesun , looks good! |
What you did with cameras makes sense to me! When there's no possible variation, a setting wouldn't apply. I just wanted to make sure you saw this if you decided to start refactoring display or other classes where user preference may apply. |
Got it! Yes, I'm watching the changes and will follow the new pattern in case I change something. |
Tested your latest code. It seems Maixpy can't handle |
Oi! That's what I get for only testing in the simulator... I'll see what I can do, thanks |
EDIT:
This pattern would be a good thing to add to the Development docs so others understand how and why things are done this way.
Building on top of #159 and #160, it would be better to remove the
board.config["krux"]
pattern and instead have the modules themselves define settings that they reference to make decisions, where the default value of a setting could be based on theboard.config["type"]
or similar non-Krux-specific properties.This would:
krux
key and once again match upstream MaixPy's versionsThis would also resolve #147 nicely.
Using that as an example, if
display.py
had aDisplaySettings
class with aninverted_coordinates
property, the default value could be initially set based on ifboard.config["type"] == 'amigo_tft'
. The calling code could then sayif settings.display.inverted_coordinates: <do stuff>
, and users could go into their Settings to override this if they wanted.The text was updated successfully, but these errors were encountered: