Ejemplo n.º 1
0
def save_board_parameters(bcnf):
    basic_params = [
        "FILESYSTEM", "SKETCH", "CHIP_ID", "PORT", "MAC", "CHIP_ID_SHORT",
        "WIFI_STATION_IP", "VALID_BOARD_ADDRESS", "HTTP_URI", "HTTP_PWD",
        "HTTP_USR", "HTTP_ADDR"
    ]

    changed = False

    # print(json.dumps(odb.EXTRA_BUILD_FLAGS, indent=2))

    transfer_missing_elements(odb.EXTRA_BUILD_FLAGS, odb.dft.EXTRA_BUILD_FLAGS)
    transfer_missing_elements(odb.BOARD_SPECIFIC_VARS,
                              odb.dft.BOARD_SPECIFIC_VARS)

    for bpar_ in basic_params:
        if bcnf.has[bpar_]:
            odb.boards_db[bcnf.CHIP_ID][bpar_] = bcnf[bpar_]
            changed = True

    if changed:
        towrite = EasyDict()
        towrite.boards_db = odb.boards_db
        towrite.EXTRA_BUILD_FLAGS = odb.EXTRA_BUILD_FLAGS
        towrite.BOARD_SPECIFIC_VARS = odb.BOARD_SPECIFIC_VARS
        write_to_db(odb.pth.boards_db, towrite)
Ejemplo n.º 2
0
odb.var.flash_baud = 115200
odb.var.serial_baud = 115200


odb.var.GRAFANA_ADMIN_NAME = "admin-graf"
odb.var.GRAFANA_ADMIN_PASS = "******"
odb.var.DEV_HOSTNAME = local_hostname()
odb.var.docker_network_name = "something"
odb.var.AP_SSID = "SOMEAP"
odb.var.AP_PASS = "******"
odb.var.HASS_CONFIG_PATH = os.path.join(odb.pth.root, "configuration.yaml")


odb.dft = EasyDict()

odb.BOARD_SPECIFIC_VARS = EasyDict()
odb.dft.BOARD_SPECIFIC_VARS = EasyDict({
    "CHIP_LAST_HOSTNAME": "esp-{CHIP_ID_SHORT}",
})

odb.EXTRA_BUILD_FLAGS = EasyDict()
odb.dft.EXTRA_BUILD_FLAGS = EasyDict({
    "_S_WIFI_SSID": None,
    "_S_WIFI_PASS": None,
    "_S_OTA_HTTP_PATH": None,
    "_S_OTA_HTTP_USER": None,
    "_SERVER_IP": None,
    "_SERVER_PORT": None,
    "_S_OTA_HTTP_PASS": None
})