[config] Retain path information in validated configuration (#6785)

This commit is contained in:
Clyde Stubbs 2024-06-12 11:15:57 +10:00 committed by GitHub
parent 699d00e218
commit 7b9fb57bb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ from esphome.const import (
CONF_EXTERNAL_COMPONENTS,
TARGET_PLATFORMS,
)
from esphome.core import CORE, EsphomeError
from esphome.core import CORE, EsphomeError, DocumentRange
from esphome.helpers import indent
from esphome.util import safe_print, OrderedDict
@ -184,7 +184,7 @@ class Config(OrderedDict, fv.FinalValidateConfig):
def get_deepest_document_range_for_path(
self, path: ConfigPath, get_key: bool = False
) -> ESPHomeDataBase | None:
) -> DocumentRange | None:
data = self
doc_range = None
for index, path_item in enumerate(path):
@ -1123,4 +1123,4 @@ def read_config(command_line_substitutions):
safe_print("")
return None
return OrderedDict(res)
return res