Tasmota
Tasmota copied to clipboard
Add support for LVGL transitions
Description:
This PR enables support for the LVGL transition feature which creates continuous adjustments from one style to another to be performed over a given time duration.
For this the object type lv.style_transition_dsc was enabled, and it can be fully initialized via its constructor (which in turn calls the native LVGL function lv_style_transition_dsc()). The PR currently only includes the actual code changes as well as an updated LVGL berry example, but does not include the changed generated files. I can add the generated files as soon as all kinks and quirks found in the code during the review were straightened out.
One thing to observe is that passing a style_transition_dsc object to lv.style.set_transition() does not add a reference to the object, therefore it also has to be kept in some variable to prevent its garbage collection. I am not sure how this is usually solved.
Also please check for any issues in the lv_berry.c code because I implemented this glue code mostly be looking up examples in other Tasmota source files. In a stripped down version we could leave out the function list_to_zbytes() and require the user to create an lv.style_prop_arr object as the first parameter for initialization.
As for the example, it works very well with just copy/pasting it to the Berry console. It also shows the two different ways of creating the lv.style_transition_dsc object.
Related issue (if applicable): none
Checklist:
- [x] The pull request is done against the latest development branch
- [x] Only relevant files were touched
- [x] Only one feature/fix was added per PR and the code change compiles without warnings
- [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8
- [x] The code change is tested and works with Tasmota core ESP32 V.3.1.1.250203
- [x] I accept the CLA.
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass
Wow, you are mastering the LVGL mapping. Impressive. I skimmed through the code and saw nothing abnormal.
I'm ok to merge now, anyways it does not interfere with other functions.
It will need to wait for 1 day or 2. Version 14.5.0 is getting out, I will merge right after.
Thank you for the quick review! No hurry, please - good to see a new release coming.
At some point maybe you could let me know about your opinion regarding the list_to_zbytes() code path. It adds convenience at the cost of more code. And although it took me quite a while to finish this function, it may not be worth it after all when it is only used in the (probably rare) case someone uses transitions.
Before the merge please also let me know if I shall provide the updated generated files or you do that yourself (not sure how that usually is done).
I just realized that there is a second example for LVGL transitions ("gummy button") which I now adjusted as well.
Overall excellent job. My main concern is that class lv_style_transition_dsc already exists as a bytes buffer. Hence creating the C class instead masks the access to the internal fields.
Ideally I would like to call your constructor on top of the bytes() mapping.
I'm wondering if this could be even more simplified by doing a super class in Berry just to override the constructor.
Stay tuned
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.
Bump. It will review this
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.
Bump
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.
Still need more time to review
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.
I'm currently doing the port to LVGL 9.3.0. It's the occasion to review it
This PR has been automatically marked as stale because it hasn't any activity in last few weeks. It will be closed if no further activity occurs. Thank you for your contributions.
This PR was automatically closed because of being stale.