Handle uart.write in json-config endpoint (#4430)

This commit is contained in:
Jesse Hills 2023-02-14 11:38:21 +13:00 committed by GitHub
parent dfeeccfcca
commit 4f4ca61ada
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1007,8 +1007,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):