mirror of
https://github.com/esphome/esphome.git
synced 2025-10-30 06:33:51 +00:00
[ruff] Enable SIM rules and fix code simplification violations (#9872)
This commit is contained in:
@@ -25,9 +25,9 @@ async def new_openthermnumber(config: dict[str, Any]) -> cg.Pvariable:
|
||||
await cg.register_component(var, config)
|
||||
input.generate_setters(var, config)
|
||||
|
||||
if (initial_value := config.get(CONF_INITIAL_VALUE, None)) is not None:
|
||||
if (initial_value := config.get(CONF_INITIAL_VALUE)) is not None:
|
||||
cg.add(var.set_initial_value(initial_value))
|
||||
if (restore_value := config.get(CONF_RESTORE_VALUE, None)) is not None:
|
||||
if (restore_value := config.get(CONF_RESTORE_VALUE)) is not None:
|
||||
cg.add(var.set_restore_value(restore_value))
|
||||
|
||||
return var
|
||||
|
||||
Reference in New Issue
Block a user