mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
[lvgl] Fix disp_bg_image when image not used;
Allow line points to be updated. define gradients before use in styles
This commit is contained in:
parent
03ae6b2c1b
commit
b829d9082c
3 changed files with 12 additions and 3 deletions
|
@ -322,8 +322,8 @@ async def to_code(configs):
|
|||
await encoders_to_code(lv_component, config, default_group)
|
||||
await keypads_to_code(lv_component, config, default_group)
|
||||
await theme_to_code(config)
|
||||
await styles_to_code(config)
|
||||
await gradients_to_code(config)
|
||||
await styles_to_code(config)
|
||||
await set_obj_properties(lv_scr_act, config)
|
||||
await add_widgets(lv_scr_act, config)
|
||||
await add_pages(lv_component, config)
|
||||
|
|
|
@ -341,9 +341,15 @@ FLEX_OBJ_SCHEMA = {
|
|||
cv.Optional(df.CONF_FLEX_GROW): cv.int_,
|
||||
}
|
||||
|
||||
|
||||
def bg_image_validator(value):
|
||||
add_lv_use("img", "label")
|
||||
return lv_image(value)
|
||||
|
||||
|
||||
DISP_BG_SCHEMA = cv.Schema(
|
||||
{
|
||||
cv.Optional(df.CONF_DISP_BG_IMAGE): lv_image,
|
||||
cv.Optional(df.CONF_DISP_BG_IMAGE): bg_image_validator,
|
||||
cv.Optional(df.CONF_DISP_BG_COLOR): lv_color,
|
||||
}
|
||||
)
|
||||
|
|
|
@ -39,7 +39,10 @@ LINE_SCHEMA = {
|
|||
class LineType(WidgetType):
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
CONF_LINE, LvType("lv_line_t"), (CONF_MAIN,), LINE_SCHEMA, modify_schema={}
|
||||
CONF_LINE,
|
||||
LvType("lv_line_t"),
|
||||
(CONF_MAIN,),
|
||||
LINE_SCHEMA,
|
||||
)
|
||||
|
||||
async def to_code(self, w: Widget, config):
|
||||
|
|
Loading…
Reference in a new issue