mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-21 12:09:13 +08:00
Merge pull request #18539 from Ultimaker/CURA-11655_fix_method_materials_loading
CURA-11655 Fix Method X/XL material selection
This commit is contained in:
commit
690eb81940
@ -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
|
||||
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user