INNER CODE UNIT · Python
get_empty_board
xoseperez/espurna · code/ota.py:168
def get_empty_board():
"""
Returns the empty structure of a board to flash
"""
board = {"board": "", "ip": "", "size": 0, "auth": "", "flags": ""}
return board
def get_board_by_index(devices, index):
"""
Returns the required data to flash a given board
"""
board = {}
if 1 <= index <= len(devices):
device = devices[index - 1]
board["hostname"] = device.get("hostname")
board["board"] = device.get("target_board", "")
board["ip"] = device.get("ip", "")