Start to implement devices enrollment

This commit is contained in:
2024-07-01 21:10:45 +02:00
parent 378c296e71
commit 9ba4aa5194
21 changed files with 267 additions and 16 deletions

View File

@@ -1,15 +1,25 @@
import argparse
import os
parser = argparse.ArgumentParser(
description='SolarEnergy Python-based client')
parser = argparse.ArgumentParser(description="SolarEnergy Python-based client")
parser.add_argument("--unsecure_origin", help="Change unsecure API origin", default="http://localhost:8080")
parser.add_argument(
"--unsecure_origin",
help="Change unsecure API origin",
default="http://localhost:8080",
)
parser.add_argument("--storage", help="Change storage location", default="storage")
parser.add_argument(
"--relay_gpios",
help="Comma-separated list of GPIO used to modify relays",
default="5,6,7",
)
args = parser.parse_args()
args.secure_origin_path = os.path.join(args.storage, "SECURE_ORIGIN")
args.root_ca_path = os.path.join(args.storage, "root_ca.pem")
args.root_ca_path = os.path.join(args.storage, "root_ca.crt")
args.dev_priv_key_path = os.path.join(args.storage, "dev.key")
args.dev_csr_path = os.path.join(args.storage, "dev.csr")
args.dev_csr_path = os.path.join(args.storage, "dev.csr")
args.dev_crt_path = os.path.join(args.storage, "dev.crt")
args.relay_gpios_list = list(map(lambda x: int(x), args.relay_gpios.split(",")))