Closed ukoda closed 8 months ago
Oops, you are right. The type mapping from lv_imgbtn_state_t
to int
was missed. It is now fixed in the latest development release #20354.
Thanks for reporting.
And nice display !!!
I can confirm that has resolved my issue. EMA and I thank you for the prompt fix :-)
@s-hadinger a similar bug may exist with the clear_flag function which works with lv.OBJ_FLAG_HIDDEN but fails with lv.OBJ_FLAG_SCROLLABLE. It gives the error "BRY: failed to run compiled code 'type_error' - Unexpected argument type 'b', expected 'i'".
It is time for bed now so I will do more digging tomorrow and look to create a new issue if needed.
This is because you put lv.OBJ_FLAG_SCROLLABLE = false
at the beginning of the script. You just masked the actual value of lv.OBJ_FLAG_SCROLLABLE
which is 16
PROBLEM DESCRIPTION
The image button set_src function only works if the first argument is lv.IMGBTN_STATE_RELEASED. If lv.IMGBTN_STATE_PRESSED, lv.IMGBTN_STATE_CHECKED_PRESSED or lv.IMGBTN_STATE_CHECKED_RELEASED is used it will fail with incomplete screen render. After a while the Berry console becomes available and shows the error message "BRY: failed to run compiled code 'type_error' - Unexpected argument type 'i', expected 'lv.lv_imgbtn_state'".
Code snippet, full code at end of this post:
My code is an attempted port of an existing native C app I created and currently in use. My objective is to retain the existing functionality while bringing in the advantages Tasmota offers.
NB: The existing C code is just using the image button as a status image that is toggled using the checkbox state. It was the easy way to to do things with the prior environment. I realise there is probably other, better, ways to do this but figure this issue will hit someone else as the Berry LVGL support sees wider use and therefore worth reporting rather than simply trying to working around.
I am aware of issue 11784. I have searched the Tasmota source code and it would appear IMGBTN_STATE_PRESSED etc are present and do not appear to be treated differently from IMGBTN_STATE_RELEASED. In parallel with waiting for feedback on this issue I will dig deeper to try and understand how Berry works in this case.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Status 0
:TO REPRODUCE
EXPECTED BEHAVIOUR
The screen should be fully render, as shown below, and no error message on the Berry console.
SCREENSHOTS
This what it should look like if rendering completes:
ADDITIONAL CONTEXT
Full code:
(Please, remember to close the issue when the problem has been addressed)