[Local Agent] Sync go/nest-cl/293074

Change-Id: I10fcb119b3cc3c34a561446560483d318c93b17c
diff --git a/local_agent/translation_layer/gdm_manager.py b/local_agent/translation_layer/gdm_manager.py
index cfa6dcb..91048b2 100644
--- a/local_agent/translation_layer/gdm_manager.py
+++ b/local_agent/translation_layer/gdm_manager.py
@@ -70,9 +70,14 @@
 
                     # Retrieve the Matter endpoints and clusters in the first detection.
                     with self._mgr.create_and_close_device(device_id) as device:
-                        matter_endpoints = device.matter_endpoints.get_supported_endpoints()
-                        endpoint_clusters_mapping = device.matter_endpoints.get_supported_endpoints_and_clusters()
-                        cluster_capabilities = list(set().union(*endpoint_clusters_mapping.values()))
+                        # If the device is not Matter device
+                        if not device.has_capabilities(["matter_endpoints"]):
+                            matter_endpoints = []
+                            cluster_capabilities = []
+                        else:
+                            matter_endpoints = device.matter_endpoints.get_supported_endpoints()
+                            endpoint_clusters_mapping = device.matter_endpoints.get_supported_endpoints_and_clusters()
+                            cluster_capabilities = list(set().union(*endpoint_clusters_mapping.values()))
 
                         # Additional non-Matter capabilities.
                         if device.has_capabilities([common.PWRPC_COMMON_CAPABILITY]):