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:
@@ -32,7 +32,7 @@ class LabelType(WidgetType):
|
|||||||
|
|
||||||
async def to_code(self, w: Widget, config):
|
async def to_code(self, w: Widget, config):
|
||||||
"""For a text object, create and set text"""
|
"""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_TEXT, await lv_text.process(value))
|
||||||
await w.set_property(CONF_LONG_MODE, config)
|
await w.set_property(CONF_LONG_MODE, config)
|
||||||
await w.set_property(CONF_RECOLOR, config)
|
await w.set_property(CONF_RECOLOR, config)
|
||||||
|
|||||||
@@ -197,6 +197,9 @@ lvgl:
|
|||||||
- lvgl.label.update:
|
- lvgl.label.update:
|
||||||
id: msgbox_label
|
id: msgbox_label
|
||||||
text: Unloaded
|
text: Unloaded
|
||||||
|
- lvgl.label.update:
|
||||||
|
id: msgbox_label
|
||||||
|
text: "" # Empty text
|
||||||
on_all_events:
|
on_all_events:
|
||||||
logger.log:
|
logger.log:
|
||||||
format: "Event %s"
|
format: "Event %s"
|
||||||
|
|||||||
Reference in New Issue
Block a user