view espNode/tasks.py @ 1554:bb765a6bf09a

use local FuXi checkout of https://github.com/drewp/FuXi (and some other dep updates) Ignore-this: 7d32ca4fcf5f3064b7615c279eb10ac1 darcs-hash:edc10465fa491974b0929150581d82248fc5e6c5
author drewp <drewp@bigasterisk.com>
date Thu, 13 Feb 2020 22:58:56 -0800
parents ed3d29eb989a
children
line wrap: on
line source

from invoke import task

tag = 'esphome/esphome:dev'

@task
def pull_esphome(ctx):
    ctx.run(f"docker pull {tag}")

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

@task
def program_board_over_wifi(ctx, board):
    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):
    ctx.run(f"docker run --rm -v `pwd`:/config --device=/dev/ttyUSB0 -it {tag} {board}.yaml logs", pty=True)

# device up?
#  nmap -Pn -p 3232,6053 10.2.0.21