diff --git a/bellows/ezsp/__init__.py b/bellows/ezsp/__init__.py index b872331c..c3649462 100644 --- a/bellows/ezsp/__init__.py +++ b/bellows/ezsp/__init__.py @@ -362,11 +362,11 @@ async def get_board_info( patch, ver_info_bytes = t.uint8_t.deserialize(ver_info_bytes) special, ver_info_bytes = t.uint8_t.deserialize(ver_info_bytes) version = f"{major}.{minor}.{patch}.{special} build {build}" + build_string = None - try: - build_string = await self.xncp_get_build_string() - except InvalidCommandError: - build_string = None + if FirmwareFeatures.BUILD_STRING in self._xncp_features: + with contextlib.suppress(InvalidCommandError): + build_string = await self.xncp_get_build_string() if build_string: version = f"{version} ({build_string})" diff --git a/tests/test_ezsp.py b/tests/test_ezsp.py index fa07f3df..e95abe63 100644 --- a/tests/test_ezsp.py +++ b/tests/test_ezsp.py @@ -388,6 +388,9 @@ async def replacement(command_name, tokenId=None, valueId=None): return replacement + if not isinstance(xncp_build_string, InvalidCommandError): + ezsp_f._xncp_features |= xncp.FirmwareFeatures.BUILD_STRING + with patch.object( ezsp_f, "_command",