Add clean build files command and auto-clean on version change (#181)

* Add clean build files command and auto-clean on version change

* Update __main__.py
This commit is contained in:
Otto Winter
2018-10-14 18:52:21 +02:00
committed by GitHub
parent 8d395e5338
commit e34365dc7c
4 changed files with 123 additions and 7 deletions
+8
View File
@@ -124,6 +124,13 @@ class EsphomeyamlCleanMqttHandler(EsphomeyamlCommandWebSocket):
return ["esphomeyaml", config_file, "clean-mqtt"]
class EsphomeyamlCleanHandler(EsphomeyamlCommandWebSocket):
def build_command(self, message):
js = json.loads(message)
config_file = os.path.join(CONFIG_DIR, js['configuration'])
return ["esphomeyaml", config_file, "clean"]
class SerialPortRequestHandler(BaseHandler):
def get(self):
if not self.is_authenticated():
@@ -221,6 +228,7 @@ def make_app(debug=False):
(r"/compile", EsphomeyamlCompileHandler),
(r"/validate", EsphomeyamlValidateHandler),
(r"/clean-mqtt", EsphomeyamlCleanMqttHandler),
(r"/clean", EsphomeyamlCleanHandler),
(r"/download.bin", DownloadBinaryRequestHandler),
(r"/serial-ports", SerialPortRequestHandler),
(r"/wizard.html", WizardRequestHandler),