Improve error reporting for add_library (#10226)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Katherine WhitlockandCopilot authored and Jesse Hills committed 2025-08-19 13:09:21 +12:00
1 parent 3c7865cd6f
commit 80970f972b
1 file changed
+4
+4
View File
@@ -803,6 +803,10 @@ class EsphomeCore:
raise TypeError(
f"Library {library} must be instance of Library, not {type(library)}"
)
if not library.name:
raise ValueError(f"The library for {library.repository} must have a name")
short_name = (
library.name if "/" not in library.name else library.name.split("/")[-1]
)