diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index 14c17c33a3..238f4d57df 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -128,7 +128,7 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice): return True # However, for manually added printers, the local IP address is used in lieu of a proper # network key, so check for that as well - if self.clusterData.host_internal_ip is not None and network_key.find(self.clusterData.host_internal_ip): + if self.clusterData.host_internal_ip is not None and network_key in self.clusterData.host_internal_ip: return True return False diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py index d3acc4037e..4c8058d91d 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDeviceManager.py @@ -151,6 +151,7 @@ class CloudOutputDeviceManager: if not active_machine: return + output_device_manager = CuraApplication.getInstance().getOutputDeviceManager() stored_cluster_id = active_machine.getMetaDataEntry(self.META_CLUSTER_ID) local_network_key = active_machine.getMetaDataEntry(self.META_NETWORK_KEY) for device in self._remote_clusters.values(): @@ -161,9 +162,9 @@ class CloudOutputDeviceManager: # Connect to it if we can match the local network key that was already present. active_machine.setMetaDataEntry(self.META_CLUSTER_ID, device.key) self._connectToOutputDevice(device, active_machine) - else: + elif device.key in output_device_manager.getOutputDeviceIds(): # Remove device if it is not meant for the active machine. - CuraApplication.getInstance().getOutputDeviceManager().removeOutputDevice(device.key) + output_device_manager.removeOutputDevice(device.key) ## Connects to an output device and makes sure it is registered in the output device manager. @staticmethod