mirror of
https://github.com/esphome/esphome.git
synced 2025-04-25 08:07:18 +00:00
Add upload dashboard api (#4318)
This commit is contained in:
parent
6d65671f92
commit
13cfe11a19
@ -305,6 +305,19 @@ class EsphomeRenameHandler(EsphomeCommandWebSocket):
|
|||||||
|
|
||||||
|
|
||||||
class EsphomeUploadHandler(EsphomeCommandWebSocket):
|
class EsphomeUploadHandler(EsphomeCommandWebSocket):
|
||||||
|
def build_command(self, json_message):
|
||||||
|
config_file = settings.rel_path(json_message["configuration"])
|
||||||
|
return [
|
||||||
|
"esphome",
|
||||||
|
"--dashboard",
|
||||||
|
"upload",
|
||||||
|
config_file,
|
||||||
|
"--device",
|
||||||
|
json_message["port"],
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
class EsphomeRunHandler(EsphomeCommandWebSocket):
|
||||||
def build_command(self, json_message):
|
def build_command(self, json_message):
|
||||||
config_file = settings.rel_path(json_message["configuration"])
|
config_file = settings.rel_path(json_message["configuration"])
|
||||||
return [
|
return [
|
||||||
@ -1113,6 +1126,7 @@ def make_app(debug=get_bool_env(ENV_DEV)):
|
|||||||
(f"{rel}logout", LogoutHandler),
|
(f"{rel}logout", LogoutHandler),
|
||||||
(f"{rel}logs", EsphomeLogsHandler),
|
(f"{rel}logs", EsphomeLogsHandler),
|
||||||
(f"{rel}upload", EsphomeUploadHandler),
|
(f"{rel}upload", EsphomeUploadHandler),
|
||||||
|
(f"{rel}run", EsphomeRunHandler),
|
||||||
(f"{rel}compile", EsphomeCompileHandler),
|
(f"{rel}compile", EsphomeCompileHandler),
|
||||||
(f"{rel}validate", EsphomeValidateHandler),
|
(f"{rel}validate", EsphomeValidateHandler),
|
||||||
(f"{rel}clean-mqtt", EsphomeCleanMqttHandler),
|
(f"{rel}clean-mqtt", EsphomeCleanMqttHandler),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user