Use cluster_size property from zeroconf if available

This commit is contained in:
ChrisTerBeke 2019-08-13 21:42:44 +02:00
parent 998f58d3fa
commit fcd5a563e4
2 changed files with 5 additions and 2 deletions

View File

@ -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)

View File

@ -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.