Only perform materials-sync-job for capable printers.

part of CURA-8671
This commit is contained in:
Remco Burema 2021-12-02 12:22:55 +01:00
parent 95f0b692a6
commit 1253b41537
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
3 changed files with 14 additions and 1 deletions

View file

@ -83,6 +83,14 @@ class UploadMaterialsJob(Job):
host_guid = "*", # Required metadata field. Otherwise we get a KeyError.
um_cloud_cluster_id = "*" # Required metadata field. Otherwise we get a KeyError.
)
# Filter out any printer not capable of the 'import_material' capability. Needs FW 7.0.1-RC at the least!
self._printer_metadata = [ printer_data for printer_data in self._printer_metadata if (
UltimakerCloudConstants.META_CAPABILITIES in printer_data and
"import_material" in printer_data[UltimakerCloudConstants.META_CAPABILITIES]
)
]
for printer in self._printer_metadata:
self._printer_sync_status[printer["host_guid"]] = self.PrinterStatus.UPLOADING.value