mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 00:31:58 +00:00
[lvgl] Fix setting empty text (#13494)
This commit is contained in:
committed by
Jonathan Swoboda
parent
d285706b41
commit
10cbd0164a
@@ -32,7 +32,7 @@ class LabelType(WidgetType):
|
||||
|
||||
async def to_code(self, w: Widget, config):
|
||||
"""For a text object, create and set text"""
|
||||
if value := config.get(CONF_TEXT):
|
||||
if (value := config.get(CONF_TEXT)) is not None:
|
||||
await w.set_property(CONF_TEXT, await lv_text.process(value))
|
||||
await w.set_property(CONF_LONG_MODE, config)
|
||||
await w.set_property(CONF_RECOLOR, config)
|
||||
|
||||
@@ -197,6 +197,9 @@ lvgl:
|
||||
- lvgl.label.update:
|
||||
id: msgbox_label
|
||||
text: Unloaded
|
||||
- lvgl.label.update:
|
||||
id: msgbox_label
|
||||
text: "" # Empty text
|
||||
on_all_events:
|
||||
logger.log:
|
||||
format: "Event %s"
|
||||
|
||||
Reference in New Issue
Block a user