mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 06:58:11 +01:00
Fix crash when handling pin_check error (#5915)
This commit is contained in:
parent
03baaa94a8
commit
29002c8f45
1 changed files with 6 additions and 1 deletions
|
@ -111,7 +111,12 @@ class Config(OrderedDict, fv.FinalValidateConfig):
|
||||||
last_root = max(
|
last_root = max(
|
||||||
i for i, v in enumerate(error.path) if v is cv.ROOT_CONFIG_PATH
|
i for i, v in enumerate(error.path) if v is cv.ROOT_CONFIG_PATH
|
||||||
)
|
)
|
||||||
error.path = error.path[last_root + 1 :]
|
# can't change the path so re-create the error
|
||||||
|
error = vol.Invalid(
|
||||||
|
message=error.error_message,
|
||||||
|
path=error.path[last_root + 1 :],
|
||||||
|
error_type=error.error_type,
|
||||||
|
)
|
||||||
self.errors.append(error)
|
self.errors.append(error)
|
||||||
|
|
||||||
def add_validation_step(self, step: "ConfigValidationStep"):
|
def add_validation_step(self, step: "ConfigValidationStep"):
|
||||||
|
|
Loading…
Reference in a new issue