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:
@@ -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):
|
||||
|
Reference in New Issue
Block a user