[lvgl] Stage 4 (#7166)

This commit is contained in:
Clyde Stubbs
2024-08-05 15:07:05 +10:00
committed by GitHub
parent 87944f0c1b
commit d18bb34f87
28 changed files with 2002 additions and 579 deletions
+5 -4
View File
@@ -1,7 +1,6 @@
import esphome.config_validation as cv
from .defines import (
CONF_LABEL,
CONF_LONG_MODE,
CONF_MAIN,
CONF_RECOLOR,
@@ -15,6 +14,8 @@ from .schemas import TEXT_SCHEMA
from .types import LvText, WidgetType
from .widget import Widget
CONF_LABEL = "label"
class LabelType(WidgetType):
def __init__(self):
@@ -33,9 +34,9 @@ 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):
w.set_property(CONF_TEXT, await lv_text.process(value))
w.set_property(CONF_LONG_MODE, config)
w.set_property(CONF_RECOLOR, config)
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)
label_spec = LabelType()