From fcd5a563e461972e6124e7524f4865ee84472291 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 13 Aug 2019 21:42:44 +0200 Subject: [PATCH] Use cluster_size property from zeroconf if available --- .../src/Network/LocalClusterOutputDeviceManager.py | 2 +- .../src/UltimakerNetworkedPrinterOutputDevice.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py index 6c45fd9fc0..e5ae7b83ac 100644 --- a/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py +++ b/plugins/UM3NetworkPrinting/src/Network/LocalClusterOutputDeviceManager.py @@ -236,7 +236,7 @@ class LocalClusterOutputDeviceManager: machine.setName(device.name) machine.setMetaDataEntry(self.META_NETWORK_KEY, device.key) machine.setMetaDataEntry("group_name", device.name) - + device.connect() machine.addConfiguredConnectionType(device.connectionType.value) CuraApplication.getInstance().getOutputDeviceManager().addOutputDevice(device) diff --git a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py index 9230ed8a56..7bebd58a46 100644 --- a/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/UltimakerNetworkedPrinterOutputDevice.py @@ -109,7 +109,10 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice): @pyqtProperty(int, notify=_clusterPrintersChanged) def clusterSize(self) -> int: if not self._has_received_printers: - return 1 # prevent false positives when discovering new devices + discovered_size = self.getProperty("cluster_size") + if discovered_size == "": + return 1 # prevent false positives for new devices + return int(discovered_size) return len(self._printers) # Get the amount of printer in the cluster per type.