mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 11:08:10 +01:00
Merge branch 'write_read_executor' into integration
This commit is contained in:
commit
ab45364209
1 changed files with 8 additions and 2 deletions
|
@ -757,9 +757,15 @@ class EditRequestHandler(BaseHandler):
|
||||||
|
|
||||||
@authenticated
|
@authenticated
|
||||||
@bind_config
|
@bind_config
|
||||||
def post(self, configuration=None):
|
async def post(self, configuration=None):
|
||||||
with open(file=settings.rel_path(configuration), mode="wb") as f:
|
# Atomic write
|
||||||
|
config_file = settings.rel_path(configuration)
|
||||||
|
with open(file=config_file, mode="wb") as f:
|
||||||
f.write(self.request.body)
|
f.write(self.request.body)
|
||||||
|
|
||||||
|
await async_run_system_command(
|
||||||
|
[*DASHBOARD_COMMAND, "compile", "--only-generate", config_file]
|
||||||
|
)
|
||||||
self.set_status(200)
|
self.set_status(200)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue