Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from setuptools import setup, find_packages

NAME = "z_wave_ts_silabs"
VERSION = "0.4.6"
VERSION = "0.4.7"

# To install the library, run the following
#
Expand Down
42 changes: 5 additions & 37 deletions z_wave_ts_silabs/processes.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,23 +232,7 @@ def __init__(self, ctxt: SessionContext):
if not os.path.exists(uic_config_file_path):
raise FileNotFoundError

rust_platform: str | None = None
if platform.system() == 'Linux':
if platform.machine() == 'x86_64': # is amd64 on windows
rust_platform = "x86_64-unknown-linux-gnu"
elif platform.machine() == 'arm64':
rust_platform = "aarch64-unknown-linux-gnu"
elif platform.machine() == 'arm':
rust_platform = "armv7-unknown-linux-gnueabihf"
elif platform.system() == 'Darwin':
if platform.machine() == 'x86_64':
rust_platform = "x86_64-apple-darwin"
elif platform.machine() == 'arm64':
rust_platform = "aarch64-apple-darwin"
if rust_platform is None:
raise OSError(f"unsupported OS: {platform.system()}")

cmd_line = f'{ctxt.uic}/build/cargo/uic_upvl_build/{rust_platform}/debug/uic-upvl --conf {uic_config_file_path}'
cmd_line = f'{ctxt.uic}/uic-upvl --conf {uic_config_file_path}'
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of platform detection logic assumes that the new archive format will have platform-appropriate executables at the root level. Consider adding validation to ensure the executable exists and is executable before attempting to run it, or document this assumption clearly.

Suggested change
cmd_line = f'{ctxt.uic}/uic-upvl --conf {uic_config_file_path}'
uic_upvl_path = os.path.join(ctxt.uic, "uic-upvl")
if not (os.path.exists(uic_upvl_path) and os.access(uic_upvl_path, os.X_OK)):
raise FileNotFoundError(f"Executable not found or not executable: {uic_upvl_path}")
cmd_line = f'{uic_upvl_path} --conf {uic_config_file_path}'

Copilot uses AI. Check for mistakes.
super().__init__(ctxt, 'upvl', cmd_line)


Expand Down Expand Up @@ -313,23 +297,7 @@ def __init__(self, ctxt: SessionContext, devices_to_update: list[dict[str, str]]
_logger.debug(f'uic-image-provider: images.json: {self.images_json}')
f.write(json.dumps(self.images_json))

rust_platform: str | None = None
if platform.system() == 'Linux':
if platform.machine() == 'x86_64': # is amd64 on windows
rust_platform = "x86_64-unknown-linux-gnu"
elif platform.machine() == 'arm64':
rust_platform = "aarch64-unknown-linux-gnu"
elif platform.machine() == 'arm':
rust_platform = "armv7-unknown-linux-gnueabihf"
elif platform.system() == 'Darwin':
if platform.machine() == 'x86_64':
rust_platform = "x86_64-apple-darwin"
elif platform.machine() == 'arm64':
rust_platform = "aarch64-apple-darwin"
if rust_platform is None:
raise OSError(f"unsupported OS: {platform.system()}")

cmd_line = f'{ctxt.uic}/build/cargo/uic_image_provider_build/{rust_platform}/debug/uic-image-provider --conf {uic_config_file_path}'
cmd_line = f'{ctxt.uic}/uic-image-provider --conf {uic_config_file_path}'
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the uic-upvl change, this assumes the executable exists at the root level. The removed platform detection logic handled unsupported platforms with a clear error message. Consider adding executable existence validation.

Copilot uses AI. Check for mistakes.
super().__init__(ctxt,'image_provider', cmd_line)


Expand All @@ -351,7 +319,7 @@ def __init__(self, ctxt: SessionContext, region: str, tty_path: str, update_file
protocol_pref='2,1' if 'LR' in region else '1,2'
))

cmd_line = f'{ctxt.uic}/build/applications/zpc/zpc --conf {uic_config_file_path}'
cmd_line = f'{ctxt.uic}/zpc --conf {uic_config_file_path}'
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This path change removes the build/applications/zpc/ directory structure. Ensure the new archive format places the zpc executable at the root level, or add validation to confirm the executable exists.

Copilot uses AI. Check for mistakes.
if update_file is not None:
sapi_ver_regex = r"\[zpc_ncp_update\] chip_serial_api_version: (?P<sapiver>(7.\d{1,3}.\d{1,3}))"
self.patterns = {
Expand Down Expand Up @@ -394,7 +362,7 @@ def _generate_uic_configuration_file(self, ctxt: SessionContext, region: str, lo
f"# Unify configuration file (autogenerated on: {datetime.now()})\n"
f"log:\n"
f" level: '{log_level}'\n"
f"mapdir: '{ctxt.uic}/build/applications/zpc/components/dotdot_mapper/rules'\n"
f"mapdir: '{ctxt.uic}/rules'\n"
f"zpc:\n"
f" inclusion_protocol_preference: '{protocol_pref}'\n"
f" normal_tx_power_dbm: {tx_power}\n"
Expand All @@ -403,7 +371,7 @@ def _generate_uic_configuration_file(self, ctxt: SessionContext, region: str, lo
f" serial_log_file: '{ctxt.current_test_logdir}/sapi.log'\n"
f" datastore_file: '{ctxt.current_test_logdir}/zpc.db'\n"
f" poll:\n"
f" attribute_list_file: '{ctxt.uic}/applications/zpc/components/zpc_rust/zwave_poll_config.yaml'\n"
f" attribute_list_file: '{ctxt.uic}/zwave_poll_config.yaml'\n"
f" ota:\n"
f" cache_path: '{ctxt.current_test_logdir}/zpc_ota_cache'\n"
# maybe append this in the relevant processes instead ?
Expand Down