Mercurial > code > home > repos > homeauto
diff service/frontDoorLock/tasks.py @ 567:2a24a6c7a843
update esphome version. rename esp board to be distinct from pi board. new invoke rules for esp programming
Ignore-this: 106acca04ac1012ac21a434692a4d515
author | drewp@bigasterisk.com |
---|---|
date | Sun, 05 May 2019 22:43:14 -0700 |
parents | 7f57d171d6d3 |
children | 1209229cd56e |
line wrap: on
line diff
--- a/service/frontDoorLock/tasks.py Sun May 05 17:09:12 2019 -0700 +++ b/service/frontDoorLock/tasks.py Sun May 05 22:43:14 2019 -0700 @@ -1,6 +1,5 @@ from invoke import task - JOB = 'front_door_lock' PORT = 10011 TAG = f'bang6:5000/{JOB}_x86:latest' @@ -26,3 +25,14 @@ def redeploy(ctx): ctx.run(f'sudo /my/proj/ansible/playbook -l bang -t {ANSIBLE_TAG}') ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}') + +@task +def program_board_over_usb(ctx): + tag = 'esphome/esphome' + ctx.run(f"docker pull {tag}") + ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml run", pty=True) + +@task +def monitor_usb(ctx): + tag = 'esphome/esphome' + ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} door.yaml logs", pty=True)