mirror of
https://github.com/esphome/esphome.git
synced 2025-10-22 19:53:46 +01:00
[core] Allow AUTO_LOAD
to receive the component config to determine if it should load other components (#10961)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
@@ -82,11 +82,10 @@ class ComponentManifest:
|
||||
return getattr(self.module, "CONFLICTS_WITH", [])
|
||||
|
||||
@property
|
||||
def auto_load(self) -> list[str]:
|
||||
al = getattr(self.module, "AUTO_LOAD", [])
|
||||
if callable(al):
|
||||
return al()
|
||||
return al
|
||||
def auto_load(
|
||||
self,
|
||||
) -> list[str] | Callable[[], list[str]] | Callable[[ConfigType], list[str]]:
|
||||
return getattr(self.module, "AUTO_LOAD", [])
|
||||
|
||||
@property
|
||||
def codeowners(self) -> list[str]:
|
||||
|
Reference in New Issue
Block a user