Make use of constant from const.py

This commit is contained in:
Michael Davidson 2023-12-20 22:14:42 +11:00
parent 26169ec0ec
commit af81251a7c
No known key found for this signature in database
GPG Key ID: B8D1A99712B8B0EB

View File

@ -1,15 +1,11 @@
import esphome.codegen as cg
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_WIDTH, CONF_HEIGHT, CONF_LAMBDA
from esphome.components.display import DisplayRef
graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout")
DisplayRenderingPanel = graphical_layout_ns.class_("DisplayRenderingPanel")
CONF_TYPE = "display_rendering_panel"
CONF_HEIGHT = "height"
CONF_WIDTH = "width"
CONF_LAMBDA = "lambda"
async def config_to_layout_item(item_config, child_item_builder):
var = cg.new_Pvariable(item_config[CONF_ID])