Add option for dashboard command to only generate the project and supporting files (#3981)

This commit is contained in:
Jesse Hills 2022-11-10 09:42:03 +13:00 committed by GitHub
parent dc17c47634
commit 7c8f502e7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -313,7 +313,11 @@ class EsphomeUploadHandler(EsphomeCommandWebSocket):
class EsphomeCompileHandler(EsphomeCommandWebSocket):
def build_command(self, json_message):
config_file = settings.rel_path(json_message["configuration"])
return ["esphome", "--dashboard", "compile", config_file]
command = ["esphome", "--dashboard", "compile"]
if json_message.get("only_generate", False):
command.append("--only-generate")
command.append(config_file)
return command
class EsphomeValidateHandler(EsphomeCommandWebSocket):