mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-06-05 20:38:27 +02:00
[lvgl] Stage 4 (#7166)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user