|
61 | 61 | PUB_KEY_PREFIX = b'\x04'
|
62 | 62 | INVALID_PASSCODES = [00000000, 11111111, 22222222, 33333333, 44444444,
|
63 | 63 | 55555555, 66666666, 77777777, 88888888, 99999999, 12345678, 87654321]
|
| 64 | +PRODUCT_FINISH_ENUM = {"other": 0, "matte": 1, "satin": 2, "polished": 3, "rugged": 4, "fabric": 5} |
| 65 | +PRODUCT_COLOR_ENUM = {"black": 0, "navy": 1, "green": 2, "teal": 3, "maroon": 4, "purple": 5, "olive": 6, "gray": 7, "blue": 8, "lime": 9, |
| 66 | + "aqua": 10, "red": 11, "fuchsia": 12, "yellow": 13, "white": 14, "nickel": 15, "chrome": 16, "brass": 18, "cooper": 19, |
| 67 | + "silver": 19, "gold": 20} |
64 | 68 |
|
65 | 69 | sys.path.insert(0, os.path.join(MATTER_ROOT, 'scripts', 'tools', 'spake2p'))
|
66 | 70 | from spake2p import generate_verifier # noqa: E402 isort:skip
|
@@ -325,6 +329,10 @@ def generate_json(self):
|
325 | 329 | self._add_entry("rd_uid", rd_uid)
|
326 | 330 | if self._args.enable_key:
|
327 | 331 | self._add_entry("enable_key", HEX_PREFIX + self._args.enable_key)
|
| 332 | + if self._args.product_finish: |
| 333 | + self._add_entry("product_finish", PRODUCT_FINISH_ENUM[self._args.product_finish]) |
| 334 | + if self._args.product_color: |
| 335 | + self._add_entry("primary_color", PRODUCT_COLOR_ENUM[self._args.product_color]) |
328 | 336 | if self._args.user:
|
329 | 337 | self._add_entry("user", self._user_data)
|
330 | 338 |
|
@@ -516,6 +524,10 @@ def base64_str(s): return base64.b64decode(s)
|
516 | 524 | optional_arguments.add_argument("--generate_onboarding", action="store_true",
|
517 | 525 | help=("Generate a Manual Code and QR Code according to provided factory data set."
|
518 | 526 | "As a result a PNG image containing QRCode and a .txt file containing Manual Code will be available within output directory"))
|
| 527 | + optional_arguments.add_argument("--product_finish", type=str, choices=PRODUCT_FINISH_ENUM.keys(), |
| 528 | + help="[string] Provide one of the product finishes") |
| 529 | + optional_arguments.add_argument("--product_color", type=str, choices=PRODUCT_COLOR_ENUM.keys(), |
| 530 | + help="[string] Provide one of the product colors.") |
519 | 531 | args = parser.parse_args()
|
520 | 532 |
|
521 | 533 | if args.verbose:
|
|
0 commit comments