Add generate home assistant config command (#208)

* Add generate home assistant config command

* Lint

* Lint
This commit is contained in:
Otto Winter
2018-11-03 14:08:31 +01:00
committed by GitHub
parent 36da3b85d5
commit 27b86d89b0
80 changed files with 625 additions and 5 deletions
+8
View File
@@ -132,6 +132,13 @@ class EsphomeyamlCleanHandler(EsphomeyamlCommandWebSocket):
return ["esphomeyaml", config_file, "clean"]
class EsphomeyamlHassConfigHandler(EsphomeyamlCommandWebSocket):
def build_command(self, message):
js = json.loads(message)
config_file = os.path.join(CONFIG_DIR, js['configuration'])
return ["esphomeyaml", config_file, "hass-config"]
class SerialPortRequestHandler(BaseHandler):
def get(self):
if not self.is_authenticated():
@@ -230,6 +237,7 @@ def make_app(debug=False):
(r"/validate", EsphomeyamlValidateHandler),
(r"/clean-mqtt", EsphomeyamlCleanMqttHandler),
(r"/clean", EsphomeyamlCleanHandler),
(r"/hass-config", EsphomeyamlHassConfigHandler),
(r"/download.bin", DownloadBinaryRequestHandler),
(r"/serial-ports", SerialPortRequestHandler),
(r"/wizard.html", WizardRequestHandler),