mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Use cluster_size property from zeroconf if available
This commit is contained in:
parent
998f58d3fa
commit
fcd5a563e4
2 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue