|
@ -121,7 +121,7 @@ def get_empty_board(): |
|
|
""" |
|
|
""" |
|
|
Returns the empty structure of a board to flash |
|
|
Returns the empty structure of a board to flash |
|
|
""" |
|
|
""" |
|
|
board = {'board': '', 'ip': '', 'size': 0, 'auth': '', 'flags': '', 'modules': ''} |
|
|
|
|
|
|
|
|
board = {'board': '', 'ip': '', 'size': 0, 'auth': '', 'flags': ''} |
|
|
return board |
|
|
return board |
|
|
|
|
|
|
|
|
def get_board_by_index(index): |
|
|
def get_board_by_index(index): |
|
@ -230,8 +230,8 @@ def store(device, env): |
|
|
|
|
|
|
|
|
def run(device, env): |
|
|
def run(device, env): |
|
|
print("Building and flashing image over-the-air...") |
|
|
print("Building and flashing image over-the-air...") |
|
|
command = "ESPURNA_IP=\"%s\" ESPURNA_BOARD=\"%s\" ESPURNA_AUTH=\"%s\" ESPURNA_FLAGS=\"%s\" WEBUI_MODULES=\"%s\" platformio run --silent --environment %s -t upload" |
|
|
|
|
|
command = command % (device['ip'], device['board'], device['auth'], device['flags'], device['modules'], env) |
|
|
|
|
|
|
|
|
command = "ESPURNA_IP=\"%s\" ESPURNA_BOARD=\"%s\" ESPURNA_AUTH=\"%s\" ESPURNA_FLAGS=\"%s\" platformio run --silent --environment %s -t upload" |
|
|
|
|
|
command = command % (device['ip'], device['board'], device['auth'], device['flags'], env) |
|
|
subprocess.check_call(command, shell=True) |
|
|
subprocess.check_call(command, shell=True) |
|
|
store(device, env) |
|
|
store(device, env) |
|
|
|
|
|
|
|
@ -245,7 +245,6 @@ if __name__ == '__main__': |
|
|
parser.add_argument("-f", "--flash", help="flash device", default=0, action='count') |
|
|
parser.add_argument("-f", "--flash", help="flash device", default=0, action='count') |
|
|
parser.add_argument("-o", "--flags", help="extra flags", default='') |
|
|
parser.add_argument("-o", "--flags", help="extra flags", default='') |
|
|
parser.add_argument("-p", "--password", help="auth password", default='') |
|
|
parser.add_argument("-p", "--password", help="auth password", default='') |
|
|
parser.add_argument("-m", "--modules", help="webui modules", default='') |
|
|
|
|
|
parser.add_argument("-s", "--sort", help="sort devices list by field", default='hostname') |
|
|
parser.add_argument("-s", "--sort", help="sort devices list by field", default='hostname') |
|
|
parser.add_argument("-y", "--yes", help="do not ask for confirmation", default=0, action='count') |
|
|
parser.add_argument("-y", "--yes", help="do not ask for confirmation", default=0, action='count') |
|
|
parser.add_argument("hostnames", nargs='*', help="Hostnames to update") |
|
|
parser.add_argument("hostnames", nargs='*', help="Hostnames to update") |
|
@ -289,7 +288,6 @@ if __name__ == '__main__': |
|
|
if board: |
|
|
if board: |
|
|
board['auth'] = args.password |
|
|
board['auth'] = args.password |
|
|
board['flags'] = args.flags |
|
|
board['flags'] = args.flags |
|
|
board['modules'] = args.modules |
|
|
|
|
|
queue.append(board) |
|
|
queue.append(board) |
|
|
|
|
|
|
|
|
# If no boards ask the user |
|
|
# If no boards ask the user |
|
@ -298,7 +296,6 @@ if __name__ == '__main__': |
|
|
if board: |
|
|
if board: |
|
|
board['auth'] = args.password or input("Authorization key of the device to flash: ") |
|
|
board['auth'] = args.password or input("Authorization key of the device to flash: ") |
|
|
board['flags'] = args.flags or input("Extra flags for the build: ") |
|
|
board['flags'] = args.flags or input("Extra flags for the build: ") |
|
|
board['modules'] = args.modules or input("WebUI modules to build: ") |
|
|
|
|
|
queue.append(board) |
|
|
queue.append(board) |
|
|
|
|
|
|
|
|
# If still no boards quit |
|
|
# If still no boards quit |
|
@ -321,7 +318,6 @@ if __name__ == '__main__': |
|
|
print("BOARD = %s" % board['board']) |
|
|
print("BOARD = %s" % board['board']) |
|
|
print("AUTH = %s" % board['auth']) |
|
|
print("AUTH = %s" % board['auth']) |
|
|
print("FLAGS = %s" % board['flags']) |
|
|
print("FLAGS = %s" % board['flags']) |
|
|
print("MODULES = %s" % board['modules']) |
|
|
|
|
|
print("ENV = %s" % env) |
|
|
print("ENV = %s" % env) |
|
|
|
|
|
|
|
|
response = True |
|
|
response = True |
|
|