diff --git a/homeassistant/components/zwave_js/__init__.py b/homeassistant/components/zwave_js/__init__.py index 3c3f2b975b2..8d3b93ad9db 100644 --- a/homeassistant/components/zwave_js/__init__.py +++ b/homeassistant/components/zwave_js/__init__.py @@ -518,7 +518,7 @@ class NodeEvents: # Create a firmware update entity for each non-controller device that # supports firmware updates if not node.is_controller_node and any( - CommandClass.FIRMWARE_UPDATE_MD.value == cc.id + cc.id == CommandClass.FIRMWARE_UPDATE_MD.value for cc in node.command_classes ): await self.controller_events.driver_events.async_setup_platform( diff --git a/homeassistant/components/zwave_js/api.py b/homeassistant/components/zwave_js/api.py index 39a33e50239..ba61de3bce4 100644 --- a/homeassistant/components/zwave_js/api.py +++ b/homeassistant/components/zwave_js/api.py @@ -374,6 +374,10 @@ def node_status(node: Node) -> dict[str, Any]: "zwave_plus_version": node.zwave_plus_version, "highest_security_class": node.highest_security_class, "is_controller_node": node.is_controller_node, + "has_firmware_update_cc": any( + cc.id == CommandClass.FIRMWARE_UPDATE_MD.value + for cc in node.command_classes + ), } diff --git a/tests/components/zwave_js/test_api.py b/tests/components/zwave_js/test_api.py index 92d5f62bce2..fc5c654ac46 100644 --- a/tests/components/zwave_js/test_api.py +++ b/tests/components/zwave_js/test_api.py @@ -319,6 +319,7 @@ async def test_node_status(hass, multisensor_6, integration, hass_ws_client): assert result["zwave_plus_version"] == 1 assert result["highest_security_class"] == SecurityClass.S0_LEGACY assert not result["is_controller_node"] + assert not result["has_firmware_update_cc"] # Test getting non-existent node fails await ws_client.send_json(