mirror of
https://github.com/esphome/esphome.git
synced 2024-12-24 14:34:54 +01:00
[lvgl] light schema should require widget:
not led:
(Bugfix) (#7649)
This commit is contained in:
parent
40cdb778f5
commit
8bb4316956
2 changed files with 5 additions and 5 deletions
|
@ -2,9 +2,9 @@ import esphome.codegen as cg
|
|||
from esphome.components import light
|
||||
from esphome.components.light import LightOutput
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_GAMMA_CORRECT, CONF_LED, CONF_OUTPUT_ID
|
||||
from esphome.const import CONF_GAMMA_CORRECT, CONF_OUTPUT_ID
|
||||
|
||||
from ..defines import CONF_LVGL_ID
|
||||
from ..defines import CONF_LVGL_ID, CONF_WIDGET
|
||||
from ..lvcode import LvContext
|
||||
from ..schemas import LVGL_SCHEMA
|
||||
from ..types import LvType, lvgl_ns
|
||||
|
@ -15,7 +15,7 @@ LVLight = lvgl_ns.class_("LVLight", LightOutput)
|
|||
CONFIG_SCHEMA = light.RGB_LIGHT_SCHEMA.extend(
|
||||
{
|
||||
cv.Optional(CONF_GAMMA_CORRECT, default=0.0): cv.positive_float,
|
||||
cv.Required(CONF_LED): cv.use_id(lv_led_t),
|
||||
cv.Required(CONF_WIDGET): cv.use_id(lv_led_t),
|
||||
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(LVLight),
|
||||
}
|
||||
).extend(LVGL_SCHEMA)
|
||||
|
@ -26,7 +26,7 @@ async def to_code(config):
|
|||
await light.register_light(var, config)
|
||||
|
||||
paren = await cg.get_variable(config[CONF_LVGL_ID])
|
||||
widget = await get_widgets(config, CONF_LED)
|
||||
widget = await get_widgets(config, CONF_WIDGET)
|
||||
widget = widget[0]
|
||||
await wait_for_widgets()
|
||||
async with LvContext(paren) as ctx:
|
||||
|
|
|
@ -93,7 +93,7 @@ light:
|
|||
- platform: lvgl
|
||||
name: LVGL LED
|
||||
id: lv_light
|
||||
led: lv_led
|
||||
widget: lv_led
|
||||
|
||||
binary_sensor:
|
||||
- platform: lvgl
|
||||
|
|
Loading…
Reference in a new issue