diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index ed1dbe1ab8..5268786a4f 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -415,9 +415,10 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): @pyqtProperty(str, constant = True) def printerType(self) -> str: - return self.getPrinterTypeIfMakerBot(self._properties.get(b"printer_type", b"Unknown").decode("utf-8")) + return NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(self._properties.get(b"printer_type", b"Unknown").decode("utf-8")) - def getPrinterTypeIfMakerBot(self, printer_type): + @staticmethod + def getPrinterTypeIfMakerBot(printer_type): method_printer_type = { "fire_e": "ultimaker_method", "lava_f": "ultimaker_methodx", diff --git a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py index 9f33847f2a..36b2bf016b 100644 --- a/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py +++ b/plugins/UM3NetworkPrinting/src/Models/Http/CloudClusterResponse.py @@ -2,6 +2,7 @@ # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional, List +from cura.PrinterOutput.NetworkedPrinterOutputDevice import NetworkedPrinterOutputDevice from ..BaseModel import BaseModel @@ -34,7 +35,7 @@ class CloudClusterResponse(BaseModel): self.host_version = host_version self.host_internal_ip = host_internal_ip self.friendly_name = friendly_name - self.printer_type = self.getPrinterTypeIfMakerBot(printer_type) + self.printer_type = NetworkedPrinterOutputDevice.getPrinterTypeIfMakerBot(printer_type) self.printer_count = printer_count self.capabilities = capabilities if capabilities is not None else [] super().__init__(**kwargs) @@ -52,12 +53,3 @@ class CloudClusterResponse(BaseModel): """ return str({k: v for k, v in self.__dict__.items() if k in {"cluster_id", "host_guid", "host_name", "status", "is_online", "host_version", "host_internal_ip", "friendly_name", "printer_type", "printer_count", "capabilities"}}) - def getPrinterTypeIfMakerBot(self, printer_type): - method_printer_type = { - "fire_e": "ultimaker_method", - "lava_f": "ultimaker_methodx", - "magma_10": "ultimaker_methodxl" - } - if printer_type in method_printer_type: - return method_printer_type[printer_type] - return printer_type