From 882237120ec6ff6c900553bc949c1fb314de1d2a Mon Sep 17 00:00:00 2001 From: Katherine Whitlock Date: Thu, 14 Aug 2025 16:14:53 -0400 Subject: [PATCH] Improve error reporting for add_library (#10226) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/core/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 9df5da1c78..8a9630735e 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -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] )