I am trying my hand and LVGL for a new display project. I am converting some old code, so I have a whole bunch of lambda already I am trying to re-use.
My question is about named colours for widgets. In a widget you can use named colours like:
Then what I want to do is change that colour in an on_value: block for a sensor.
I tried using the named colours in the lambda assigns, but of course they are not defined. I could just do my if statements in yaml, but what I have currently is:
Then what triggers them to update? I am having problems with the learning curve here. The small arc is the indicator for wind direction which changes often. Apart from the colour and the x/y values, the arc parameters never change and aren’t linked to any sensor.
For lambda display code the code is executed every time the display engine refreshes the display. I didn’t think LVGL did that - but happy to be corrected. I thought LVGL widgets were static unless updated specifically by lvl.widget.update or by user interaction…
I have never even held LVGL display on my hand…
What I meant, to move the first on_value: lambda with conditions directly to arc_color update lambda underneath. So you don’t need to use globals.
I’m not sure if I understood the problem here though…