1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 20:32:21 +01:00

Fix editor live validation (#6431)

This commit is contained in:
J. Nick Koston
2024-03-25 21:24:58 -10:00
committed by GitHub
parent 7cb8f99884
commit 2345e7606a
4 changed files with 63 additions and 51 deletions

View File

@@ -1,9 +1,4 @@
import json
import os
from esphome.const import CONF_ID
from esphome.core import CORE
from esphome.helpers import read_file
class Extend:
@@ -38,25 +33,6 @@ class Remove:
return isinstance(b, Remove) and self.value == b.value
def read_config_file(path: str) -> str:
if CORE.vscode and (
not CORE.ace or os.path.abspath(path) == os.path.abspath(CORE.config_path)
):
print(
json.dumps(
{
"type": "read_file",
"path": path,
}
)
)
data = json.loads(input())
assert data["type"] == "file_response"
return data["content"]
return read_file(path)
def merge_config(full_old, full_new):
def merge(old, new):
if isinstance(new, dict):