-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
feat(color): enhancements for Lua widget scripts. #5926
base: main
Are you sure you want to change the base?
Conversation
Added support for the default value of a SWITCH or SOURCE option to be a table of possible values. { "volt_sensor", SOURCE, {"cell","VFAS","RxBt","A1", "A2"} } |
Send path name of widget folder to script 'create()' function. Enhancements for widgets option default values, getSwitchIndex() and getSourceIndex() Lua function.
751a48a
to
e26392e
Compare
The |
The position of all objects can be set with the 'pos()' function. {type="rectangle", filled=true,
color=getFillColor,
size=(function() return fw, math.floor(wgt.vPercent / 100 * (fh)) end),
pos=(function() return 0, fh - math.floor(wgt.vPercent / 100 * (fh)) end)}, |
Perfect! Sorry, I missed that in the docu .... Does One problem with |
Parent. I've updated the gitbook docs.
Triangle is complicated as Lvgl does not have a native triangle object. |
Yes. Most libs have to notion of an origin of the drawing canvas. And the rotation rotates around this origin. But I don't know if that's possible for
Mmh, this should be mostly the same as using the |
I am assuming you would only call 'set()' when something changes so it does not check. |
Ok, then maybe saving the |
…ine if line or triangle points have changed.
Perfect! |
I noticed a new (!) problem with the
Now see, that the I don't think that this is intentional, because the Unfortunately I have no small(!) example widget ... will need some time. |
Summary:
Details:
This PR allow the Lua API functions to access the widget or stand alone script that called the function. In addition this adds the telemetry queue per widget required for #5773.
The code now sends the path of the widget being loaded to the script 'create()' function (as the 3rd parameter).
The following changes have been made to the getSwitchIndex() and getSourceIndex() API functions:
For the widget 'options' table, entries of type SWITCH and SOURCE, can set their default, min and max values from a string. This is a shortcut to using getSwitchIndex() or getSourceIndex() in the option table.
E.G. these two lines are equivalent: