mirror of
https://github.com/esphome/esphome.git
synced 2024-12-12 08:24:55 +01:00
Some lint improvements
This commit is contained in:
parent
a61343e8ec
commit
5c2c8935ce
2 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ HorizontalStack = graphical_layout_ns.class_("HorizontalStack")
|
||||||
CONF_ITEM_PADDING = "item_padding"
|
CONF_ITEM_PADDING = "item_padding"
|
||||||
CONF_TYPE = "horizontal_stack"
|
CONF_TYPE = "horizontal_stack"
|
||||||
CONF_ITEMS = "items"
|
CONF_ITEMS = "items"
|
||||||
CONF_ITEM_TYPE = "type"
|
CONF_TYPE_KEY = "type"
|
||||||
|
|
||||||
|
|
||||||
async def config_to_layout_item(item_config, child_item_builder):
|
async def config_to_layout_item(item_config, child_item_builder):
|
||||||
|
@ -17,7 +17,7 @@ async def config_to_layout_item(item_config, child_item_builder):
|
||||||
cg.add(var.set_item_padding(item_padding_config))
|
cg.add(var.set_item_padding(item_padding_config))
|
||||||
|
|
||||||
for child_item_config in item_config[CONF_ITEMS]:
|
for child_item_config in item_config[CONF_ITEMS]:
|
||||||
child_item_type = child_item_config[CONF_ITEM_TYPE]
|
child_item_type = child_item_config[CONF_TYPE_KEY]
|
||||||
if child_item_type in child_item_builder:
|
if child_item_type in child_item_builder:
|
||||||
child_item_var = await child_item_builder[child_item_type](
|
child_item_var = await child_item_builder[child_item_type](
|
||||||
child_item_config, child_item_builder
|
child_item_config, child_item_builder
|
||||||
|
|
|
@ -7,7 +7,7 @@ VerticalStack = graphical_layout_ns.class_("VerticalStack")
|
||||||
CONF_ITEM_PADDING = "item_padding"
|
CONF_ITEM_PADDING = "item_padding"
|
||||||
CONF_TYPE = "vertical_stack"
|
CONF_TYPE = "vertical_stack"
|
||||||
CONF_ITEMS = "items"
|
CONF_ITEMS = "items"
|
||||||
CONF_ITEM_TYPE = "type"
|
CONF_TYPE_KEY = "type"
|
||||||
|
|
||||||
|
|
||||||
async def config_to_layout_item(item_config, child_item_builder):
|
async def config_to_layout_item(item_config, child_item_builder):
|
||||||
|
@ -17,7 +17,7 @@ async def config_to_layout_item(item_config, child_item_builder):
|
||||||
cg.add(var.set_item_padding(item_padding_config))
|
cg.add(var.set_item_padding(item_padding_config))
|
||||||
|
|
||||||
for child_item_config in item_config[CONF_ITEMS]:
|
for child_item_config in item_config[CONF_ITEMS]:
|
||||||
child_item_type = child_item_config[CONF_ITEM_TYPE]
|
child_item_type = child_item_config[CONF_TYPE_KEY]
|
||||||
if child_item_type in child_item_builder:
|
if child_item_type in child_item_builder:
|
||||||
child_item_var = await child_item_builder[child_item_type](
|
child_item_var = await child_item_builder[child_item_type](
|
||||||
child_item_config, child_item_builder
|
child_item_config, child_item_builder
|
||||||
|
|
Loading…
Reference in a new issue