From 38a01988a533c526196f06f7c72fb72205abccb3 Mon Sep 17 00:00:00 2001 From: Mikhail Zakharov Date: Tue, 21 Feb 2023 16:52:06 -0500 Subject: [PATCH] fix library override logic (#4474) * fix library override logic * formatting --- esphome/core/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 545fae381f..117b19a6ae 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -653,7 +653,15 @@ class EsphomeCore: f"Library {library} must be instance of Library, not {type(library)}" ) for other in self.libraries[:]: - if other.name != library.name or other.name is None or library.name is None: + if other.name is None or library.name is None: + continue + library_name = ( + library.name if "/" not in library.name else library.name.split("/")[1] + ) + other_name = ( + other.name if "/" not in other.name else other.name.split("/")[1] + ) + if other_name != library_name: continue if other.repository is not None: if library.repository is None or other.repository == library.repository: