From d981d7859dd29ef78c5164a812c3408eb7da417a Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:38:21 +1300 Subject: [PATCH] Handle uart.write in json-config endpoint (#4430) --- esphome/dashboard/dashboard.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/dashboard/dashboard.py b/esphome/dashboard/dashboard.py index f426215d29..f7d471586d 100644 --- a/esphome/dashboard/dashboard.py +++ b/esphome/dashboard/dashboard.py @@ -1008,8 +1008,14 @@ class SafeLoaderIgnoreUnknown(yaml.SafeLoader): def ignore_unknown(self, node): return f"{node.tag} {node.value}" + def construct_yaml_binary(self, node) -> str: + return super().construct_yaml_binary(node).decode("ascii") + SafeLoaderIgnoreUnknown.add_constructor(None, SafeLoaderIgnoreUnknown.ignore_unknown) +SafeLoaderIgnoreUnknown.add_constructor( + "tag:yaml.org,2002:binary", SafeLoaderIgnoreUnknown.construct_yaml_binary +) class JsonConfigRequestHandler(BaseHandler):