Some lint improvements

This commit is contained in:
Michael Davidson 2023-12-19 21:04:50 +11:00
parent a61343e8ec
commit 5c2c8935ce
No known key found for this signature in database
GPG key ID: B8D1A99712B8B0EB
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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