1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-02 19:32:19 +01:00

[ruff] Enable SIM rules and fix code simplification violations (#9872)

This commit is contained in:
J. Nick Koston
2025-07-24 20:26:08 -10:00
committed by GitHub
parent cb87f156d0
commit ffebd30033
72 changed files with 400 additions and 432 deletions

View File

@@ -1037,10 +1037,7 @@ class MockObjClass(MockObj):
def inherits_from(self, other: "MockObjClass") -> bool:
if str(self) == str(other):
return True
for parent in self._parents:
if str(parent) == str(other):
return True
return False
return any(str(parent) == str(other) for parent in self._parents)
def template(self, *args: SafeExpType) -> "MockObjClass":
if len(args) != 1 or not isinstance(args[0], TemplateArguments):