|
| 1 | +# Copyright (c) 2025 Nordic Semiconductor ASA |
| 2 | +# |
| 3 | +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause |
| 4 | + |
| 5 | +import argparse |
| 6 | +from textwrap import dedent |
| 7 | +from west.commands import WestCommand |
| 8 | +from zap_common import existing_dir_path, ZapInstaller, DEFAULT_MATTER_PATH |
| 9 | + |
| 10 | + |
| 11 | +class ZapInstall(WestCommand): |
| 12 | + |
| 13 | + def __init__(self): |
| 14 | + super().__init__( |
| 15 | + 'zap-install', |
| 16 | + 'Install Matter ZCL Advanced Platform (ZAP) GUI', |
| 17 | + dedent(''' |
| 18 | + Install Matter ZCL Advanced Platform (ZAP) GUI. |
| 19 | +
|
| 20 | + The ZAP GUI in a node.js tool for configuring the data model |
| 21 | + of a Matter application, which defines clusters, commands, |
| 22 | + attributes and events enabled for the given application.''')) |
| 23 | + |
| 24 | + def do_add_parser(self, parser_adder): |
| 25 | + parser = parser_adder.add_parser(self.name, |
| 26 | + help=self.help, |
| 27 | + formatter_class=argparse.RawDescriptionHelpFormatter, |
| 28 | + description=self.description) |
| 29 | + parser.add_argument('-m', '--matter-path', type=existing_dir_path, |
| 30 | + default=DEFAULT_MATTER_PATH, help=f'Path to Matter SDK. Default is set to {DEFAULT_MATTER_PATH}') |
| 31 | + return parser |
| 32 | + |
| 33 | + def do_run(self, args, unknown_args): |
| 34 | + zap_installer = ZapInstaller(args.matter_path) |
| 35 | + zap_installer.update_zap_if_needed() |
0 commit comments