Tasmota icon indicating copy to clipboard operation
Tasmota copied to clipboard

Add support for LVGL transitions

Open treitmayr opened this issue 9 months ago • 13 comments

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

treitmayr avatar Feb 17 '25 20:02 treitmayr

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.

s-hadinger avatar Feb 17 '25 21:02 s-hadinger

It will need to wait for 1 day or 2. Version 14.5.0 is getting out, I will merge right after.

s-hadinger avatar Feb 17 '25 21:02 s-hadinger

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).

treitmayr avatar Feb 17 '25 22:02 treitmayr

I just realized that there is a second example for LVGL transitions ("gummy button") which I now adjusted as well.

treitmayr avatar Feb 19 '25 20:02 treitmayr

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

s-hadinger avatar Feb 20 '25 22:02 s-hadinger

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.

github-actions[bot] avatar Mar 17 '25 23:03 github-actions[bot]

Bump. It will review this

s-hadinger avatar Mar 18 '25 07:03 s-hadinger

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.

github-actions[bot] avatar Apr 12 '25 09:04 github-actions[bot]

Bump

s-hadinger avatar Apr 15 '25 06:04 s-hadinger

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.

github-actions[bot] avatar May 10 '25 07:05 github-actions[bot]

Still need more time to review

s-hadinger avatar May 10 '25 08:05 s-hadinger

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.

github-actions[bot] avatar Jun 04 '25 08:06 github-actions[bot]

I'm currently doing the port to LVGL 9.3.0. It's the occasion to review it

s-hadinger avatar Jun 04 '25 09:06 s-hadinger

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.

github-actions[bot] avatar Jun 29 '25 10:06 github-actions[bot]

This PR was automatically closed because of being stale.

github-actions[bot] avatar Jul 04 '25 10:07 github-actions[bot]