view service/espNode/tasks.py @ 1452:1dd4da407c0b

build and release config Ignore-this: a1a0231a2811ac29f906ca72d85a8c34 darcs-hash:879bbda36c705de169b0b746f5c4de467b48d142
author drewp <drewp@bigasterisk.com>
date Wed, 25 Sep 2019 17:28:38 -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)