[lvgl] Various fixes (#15098)

This commit is contained in:
Clyde Stubbs
2026-03-23 12:09:30 -04:00
committed by GitHub
parent 5a984b54cf
commit e8c5dfca3e
3 changed files with 12 additions and 2 deletions
+7 -1
View File
@@ -226,6 +226,9 @@ async def to_code(configs):
config_0 = configs[0]
# Global configuration
if CORE.is_esp32:
# Skip compiling lvgl examples
add_idf_sdkconfig_option("CONFIG_LV_BUILD_EXAMPLES", False)
add_idf_sdkconfig_option("CONFIG_LV_BUILD_DEMOS", False)
if get_esp32_variant() == VARIANT_ESP32P4:
add_idf_sdkconfig_option("CONFIG_LV_DRAW_BUF_ALIGN", 64)
# disable use of PPA for fills until upstream bugs fixed
@@ -406,7 +409,10 @@ async def to_code(configs):
lv_conf_h_file = CORE.relative_src_path(LV_CONF_FILENAME)
write_file_if_changed(lv_conf_h_file, generate_lv_conf_h())
cg.add_build_flag("-DLV_CONF_H=1")
cg.add_build_flag(f'-DLV_CONF_PATH=\\"{LV_CONF_FILENAME}\\"')
# handle windows paths in a way that doesn't break the generated C++
lv_conf_h_path = Path(lv_conf_h_file).as_posix()
cg.add_build_flag(f'-DLV_CONF_PATH=\\"{lv_conf_h_path}\\"')
cg.add_build_flag("-DLV_KCONFIG_IGNORE")
for prop in df.get_remapped_uses():
df.LOGGER.warning(
+1 -1
View File
@@ -71,7 +71,7 @@ inline void lv_style_set_text_font(lv_style_t *style, const font::Font *font) {
lv_style_set_text_font(style, font->get_lv_font());
}
#endif
#ifdef USE_IMAGE
#if defined(USE_LVGL_IMAGE) && defined(USE_IMAGE)
// Shortcut / overload, so that the source of an image can easily be updated
// from within a lambda.
inline void lv_image_set_src(lv_obj_t *obj, esphome::image::Image *image) {
@@ -16,6 +16,7 @@ from ..lv_validation import lv_bool, lv_int, lv_text
from ..schemas import TEXT_SCHEMA
from ..types import LvText
from . import Widget, WidgetType
from .label import CONF_LABEL
CONF_TEXTAREA = "textarea"
@@ -46,6 +47,9 @@ class TextareaType(WidgetType):
TEXTAREA_SCHEMA,
)
def get_uses(self):
return (CONF_LABEL,)
async def to_code(self, w: Widget, config: dict):
for prop in (CONF_TEXT, CONF_PLACEHOLDER_TEXT, CONF_ACCEPTED_CHARS):
if (value := config.get(prop)) is not None: