view service/espNode/tasks.py @ 596:a56bc73d308c

espNode code Ignore-this: 443d950518d808c2df1ade5935100e38
author drewp@bigasterisk.com
date Sun, 07 Jul 2019 11:23:48 -0700
parents
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)