mirror of
https://github.com/esphome/esphome.git
synced 2024-11-26 12:27:13 +01:00
Allow AUTO_LOAD to be a function (#4550)
This commit is contained in:
parent
b6f628ee40
commit
6e8e9c2aa9
@ -71,7 +71,10 @@ class ComponentManifest:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def auto_load(self) -> list[str]:
|
def auto_load(self) -> list[str]:
|
||||||
return getattr(self.module, "AUTO_LOAD", [])
|
al = getattr(self.module, "AUTO_LOAD", [])
|
||||||
|
if callable(al):
|
||||||
|
return al()
|
||||||
|
return al
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def codeowners(self) -> list[str]:
|
def codeowners(self) -> list[str]:
|
||||||
|
Loading…
Reference in New Issue
Block a user