From 938357aed88da3c80452320c30983b9ef60dde02 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 15 Nov 2023 15:58:39 -0600 Subject: [PATCH] dashboard: use fastest available yaml loader in the dashboard --- esphome/dashboard/status/ping.py | 3 +-- esphome/dashboard/web_server.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/dashboard/status/ping.py b/esphome/dashboard/status/ping.py index 17c1254c9d..80003398b9 100644 --- a/esphome/dashboard/status/ping.py +++ b/esphome/dashboard/status/ping.py @@ -4,9 +4,8 @@ import asyncio import os from typing import cast -from ..core import DASHBOARD +from ..core import DASHBOARD, list_dashboard_entries from ..entries import DashboardEntry -from ..core import list_dashboard_entries from ..util import chunked diff --git a/esphome/dashboard/web_server.py b/esphome/dashboard/web_server.py index 086a28cbb2..41b39b11b7 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, run_system_command 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 @@ -885,7 +886,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}"