dashboard: use fastest available yaml loader in the dashboard

This commit is contained in:
J. Nick Koston 2023-11-15 15:58:39 -06:00
parent c795dbde26
commit 938357aed8
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -4,9 +4,8 @@ import asyncio
import os import os
from typing import cast from typing import cast
from ..core import DASHBOARD from ..core import DASHBOARD, list_dashboard_entries
from ..entries import DashboardEntry from ..entries import DashboardEntry
from ..core import list_dashboard_entries
from ..util import chunked from ..util import chunked

View file

@ -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.helpers import get_bool_env, mkdir_p, run_system_command
from esphome.storage_json import StorageJSON, ext_storage_path, trash_storage_path from esphome.storage_json import StorageJSON, ext_storage_path, trash_storage_path
from esphome.util import get_serial_ports, shlex_quote from esphome.util import get_serial_ports, shlex_quote
from esphome.yaml_util import FastestAvailableSafeLoader
from .core import DASHBOARD, list_dashboard_entries from .core import DASHBOARD, list_dashboard_entries
from .entries import DashboardEntry from .entries import DashboardEntry
@ -885,7 +886,7 @@ class SecretKeysRequestHandler(BaseHandler):
self.write(json.dumps(secret_keys)) self.write(json.dumps(secret_keys))
class SafeLoaderIgnoreUnknown(yaml.SafeLoader): class SafeLoaderIgnoreUnknown(FastestAvailableSafeLoader):
def ignore_unknown(self, node): def ignore_unknown(self, node):
return f"{node.tag} {node.value}" return f"{node.tag} {node.value}"