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

Improve error reporting for add_library (#10226)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Katherine Whitlock
2025-08-14 16:14:53 -04:00
committed by GitHub
parent 71efaf097b
commit 882237120e

View File

@@ -803,6 +803,10 @@ class EsphomeCore:
raise TypeError( raise TypeError(
f"Library {library} must be instance of Library, not {type(library)}" 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 = ( short_name = (
library.name if "/" not in library.name else library.name.split("/")[-1] library.name if "/" not in library.name else library.name.split("/")[-1]
) )