From 5f1d8dfa5bcc9d1ecae593e2e05c8a5609bca767 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 15 Nov 2023 18:08:17 -0600 Subject: [PATCH] dashboard: use fastest available yaml loader in the dashboard (#5771) * dashboard: use fastest available yaml loader in the dashboard * remove unrelated change --- esphome/dashboard/web_server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/dashboard/web_server.py b/esphome/dashboard/web_server.py index c0cc00b66c..76faa43015 100644 --- a/esphome/dashboard/web_server.py +++ b/esphome/dashboard/web_server.py @@ -34,6 +34,7 @@ from esphome import const, platformio_api, yaml_util from esphome.helpers import get_bool_env, mkdir_p from esphome.storage_json import StorageJSON, ext_storage_path, trash_storage_path from esphome.util import get_serial_ports, shlex_quote +from esphome.yaml_util import FastestAvailableSafeLoader from .core import DASHBOARD, list_dashboard_entries from .entries import DashboardEntry @@ -886,7 +887,7 @@ class SecretKeysRequestHandler(BaseHandler): self.write(json.dumps(secret_keys)) -class SafeLoaderIgnoreUnknown(yaml.SafeLoader): +class SafeLoaderIgnoreUnknown(FastestAvailableSafeLoader): def ignore_unknown(self, node): return f"{node.tag} {node.value}"