view service/espNode/tasks.py @ 710:94610b5263e4

add browser_test server for playing with /graph resource Ignore-this: 6112c234b93e0fb99ffe918a022e5a49
author drewp@bigasterisk.com
date Mon, 03 Feb 2020 23:45:15 -0800
parents 438edc93e29e
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