Skip to content

Commit

Permalink
Merge pull request #18539 from Ultimaker/CURA-11655_fix_method_materi…
Browse files Browse the repository at this point in the history
…als_loading

CURA-11655 Fix Method X/XL material selection
  • Loading branch information
casperlamboo authored Mar 8, 2024
2 parents 0149be1 + fa2257a commit 690eb81
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, List

import uuid

from .CloudClusterResponse import CloudClusterResponse
from .ClusterPrinterStatus import ClusterPrinterStatus

Expand All @@ -11,4 +13,20 @@ class CloudClusterWithConfigResponse(CloudClusterResponse):

def __init__(self, **kwargs) -> None:
self.configuration = self.parseModel(ClusterPrinterStatus, kwargs.get("host_printer"))

# Some printers will return a null UUID in the host_printer.uuid field. For those we can fall back using
# the host_guid field of the cluster data
valid_uuid = False
try:
parsed_uuid = uuid.UUID(self.configuration.uuid)
valid_uuid = parsed_uuid.int != 0
except:
pass

if not valid_uuid:
try:
self.configuration.uuid = kwargs.get("host_guid")
except:
pass

super().__init__(**kwargs)

0 comments on commit 690eb81

Please sign in to comment.