mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 23:34:32 +08:00
Use cluster_size property from zeroconf if available
This commit is contained in:
parent
998f58d3fa
commit
fcd5a563e4
@ -109,7 +109,10 @@ class UltimakerNetworkedPrinterOutputDevice(NetworkedPrinterOutputDevice):
|
|||||||
@pyqtProperty(int, notify=_clusterPrintersChanged)
|
@pyqtProperty(int, notify=_clusterPrintersChanged)
|
||||||
def clusterSize(self) -> int:
|
def clusterSize(self) -> int:
|
||||||
if not self._has_received_printers:
|
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)
|
return len(self._printers)
|
||||||
|
|
||||||
# Get the amount of printer in the cluster per type.
|
# Get the amount of printer in the cluster per type.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user