feat: add Last.fm app - #10
Conversation
|
|
Thanks for the feedback!
Sounds very reasonable to start with and it's easy enough to add and remove apps if storage becomes an issue! I still have close to 200kb free space so a bit pre-mature optimization on my end (although I partly just wanted to discuss the topic). I'll update the PR and remove the split and drop the build tool as soon as I get some time over! |
- Fix scrolling/resetting - Fix margins - Fix refresh loop - Drop comments - Update settings UI
|
@matrixbox Hey! Looks like you added the Last.fm app but not by merging this PR. I had some outstanding tasks that I was planning to fix so instead I updated this PR to contain them. I rebased on PS. I always enable edits from maintainers on my PRs so feel free to (force) push any changes to my branches and merge them if you want to! |
|
Actually, I think the history will be cleaner and easier to follow in a new PR so I'll create a new one! Created #14 |
|
Done! 💯 |
I know this is a completely new concept, feel free to reject it without any reason!
I think it's important that you understand the approach and feel that it's a good one and that you can maintain it, even though I of course plan to keep maintaining this as well. If the approach feels too complex I see two options:
mpy-cross,build.pyand just put the app as-is inapps/Last.fm app
This adds an app to poll Last.fm for what's currently playing. See app README for more information.
The app can be configured to set colors, shadow, alignment, one or multiple rows etc.
Additional changes
This PR also contains a new concept which will allow you to write code with clear comments and clear structure but at the same time use less space on the device. The PR introduces an
srcdirectory where human readable and formatted code can be put.The code in
src/lastfmis formatted withrufffor Python and prettier for HTML. However the idea is to "build" this app withtools/build.pyusingmpy-crossfor Python and HTML minifier for the HTML.Another thing that I haven't seen in other apps worth mentioning is that this app auto-exits on inactivity. The reason is because to get a snappy feeling of quick updates the app polls every 5s which isn't really needed when nothing is playing. This is configurable.
I personally think this gives more flexibility around quality and maintainability but it also allow us to implement other tools in the build process such as HTML templating to ensure all apps uses the same styling and layout.
Some measurements from this app:
Worth noting the
.mpyfigure is flash footprint. The bigger on-device win is usually RAM and import time: shipping code.mpy means the device skips compiling the .py at launch, no parser/compiler allocation, no source held in memory.If you don't think this is a good idea I can try to slim down the app and code and move it direclty under
apps. If you do think this is a good idea I can look into porting all apps to this structure. Or we can just keep it for some apps like this one.Pictures