view service/espNode/tasks.py @ 1423:ba56263fe3b2

arduinonode to docker Ignore-this: 8f689c7491819bc47200018b517fd7de darcs-hash:e3602fc781c7b66e98ca950d5782ecc41e506bad
author drewp <drewp@bigasterisk.com>
date Wed, 07 Aug 2019 20:23: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)