view service/espNode/tasks.py @ 1421:c451aad69f65

output-widgets.html path Ignore-this: 3e3625215c69ee5600c20d42d3afaabc darcs-hash:06ed2ea6a38e6fa7a40a36f3bfc93b22522a49c8
author drewp <drewp@bigasterisk.com>
date Sun, 04 Aug 2019 13:03:04 -0700
parents 5e8f1fcfbc79
children 438edc93e29e
line wrap: on
line source

from invoke import task

@task
def program_board_over_usb(ctx, board):
    tag = 'esphome/esphome'
    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts --device=/dev/ttyUSB1 -it {tag} {board}.yaml run", pty=True)

@task
def program_board_over_wifi(ctx, board):
    tag = 'esphome/esphome'
    ctx.run(f"docker run --rm -v `pwd`:/config -v /usr/share/fonts:/usr/share/fonts -it --net=host {tag} {board}.yaml run", pty=True)

@task
def monitor_usb(ctx, board):
    tag = 'esphome/esphome'
    ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} {board}.yaml logs", pty=True)