Ensure that all material configs are added to the list

CURA-8463
This commit is contained in:
Jaime van Kessel 2022-08-30 16:33:29 +02:00
parent 6fed6b824c
commit e2ba110cf7
No known key found for this signature in database
GPG key ID: C85F7A3AF1BAA7C4
4 changed files with 26 additions and 6 deletions

View file

@ -17,6 +17,7 @@ from cura.UltimakerCloud import UltimakerCloudConstants
from cura.UltimakerCloud.UltimakerCloudScope import UltimakerCloudScope
from .ToolPathUploader import ToolPathUploader
from ..Models.BaseModel import BaseModel
from ..Models.Http.CloudClusterWithConfigResponse import CloudClusterWithConfigResponse
from ..Models.Http.CloudClusterResponse import CloudClusterResponse
from ..Models.Http.CloudClusterStatus import CloudClusterStatus
from ..Models.Http.CloudError import CloudError
@ -76,7 +77,7 @@ class CloudApiClient:
error_callback = failed,
timeout = self.DEFAULT_REQUEST_TIMEOUT)
def getClustersByMachineType(self, machine_type, on_finished: Callable[[List[CloudClusterResponse]], Any], failed: Callable) -> None:
def getClustersByMachineType(self, machine_type, on_finished: Callable[[List[CloudClusterWithConfigResponse]], Any], failed: Callable) -> None:
# HACK: There is something weird going on with the API, as it reports printer types in formats like
# "ultimaker_s3", but wants "Ultimaker S3" when using the machine_variant filter query. So we need to do some
# conversion!
@ -90,7 +91,7 @@ class CloudApiClient:
url = f"{self.CLUSTER_API_ROOT}/clusters?machine_variant={machine_type}"
self._http.get(url,
scope=self._scope,
callback=self._parseCallback(on_finished, CloudClusterResponse, failed),
callback=self._parseCallback(on_finished, CloudClusterWithConfigResponse, failed),
error_callback=failed,
timeout=self.DEFAULT_REQUEST_TIMEOUT)