1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

[ruff] Enable RET and fix all violations (#9929)

This commit is contained in:
J. Nick Koston
2025-07-31 16:10:56 -10:00
committed by GitHub
parent 7a4738ec4e
commit f13e742bd5
39 changed files with 81 additions and 139 deletions

View File

@@ -85,8 +85,7 @@ async def action_to_code(
async with LambdaContext(parameters=args, where=action_id) as context:
for widget in widgets:
await action(widget)
var = cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
return var
return cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
async def update_to_code(config, action_id, template_arg, args):
@@ -354,8 +353,7 @@ async def widget_focus(config, action_id, template_arg, args):
if config[CONF_FREEZE]:
lv.group_focus_freeze(group, True)
var = cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
return var
return cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
@automation.register_action(

View File

@@ -271,8 +271,7 @@ padding = LValidator(padding_validator, int32, retmapper=literal)
def zoom_validator(value):
value = cv.float_range(0.1, 10.0)(value)
return value
return cv.float_range(0.1, 10.0)(value)
def zoom_retmapper(value):

View File

@@ -66,8 +66,7 @@ async def style_update_to_code(config, action_id, template_arg, args):
async with LambdaContext(parameters=args, where=action_id) as context:
await style_set(style, config)
var = cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
return var
return cg.new_Pvariable(action_id, template_arg, await context.get_lambda())
async def theme_to_code(config):

View File

@@ -189,7 +189,7 @@ class Widget:
for matrix buttons
:return:
"""
return None
return
def get_max(self):
return self.type.get_max(self.config)

View File

@@ -193,7 +193,7 @@ class ButtonMatrixType(WidgetType):
async def to_code(self, w: Widget, config):
lvgl_components_required.add("BUTTONMATRIX")
if CONF_ROWS not in config:
return []
return
text_list, ctrl_list, width_list, key_list = await get_button_data(
config[CONF_ROWS], w
)