INNER CODE UNIT · Python
boardname
xoseperez/espurna · code/ota.py:282
def boardname(board):
return board.get("hostname", board["ip"])
def store(device, env):
source = ".pio/build/{}/firmware.elf".format(env)
destination = ".pio/build/elfs/{}.elf".format(boardname(device).lower())
dst_dir = os.path.dirname(destination)
if not os.path.exists(dst_dir):
os.mkdir(dst_dir)
shutil.move(source, destination)
def run(device, env):
print("Building and flashing image over-the-air...")
environ = os.environ.copy()