Update the DiscoveredCloudUltimakerPrinters model

Whenever new cloud devices are detected on the ultimaker account, add
them to the model

CURA-7022
This commit is contained in:
Kostas Karmas 2020-04-24 19:17:34 +02:00
parent c8e86175cd
commit 49cb1d325e

View file

@ -141,10 +141,13 @@ class CloudOutputDeviceManager:
if machine_manager.getMachine(device.printerType, {self.META_CLUSTER_ID: device.key}) is None \
and machine_manager.getMachine(device.printerType, {self.META_NETWORK_KEY: cluster_data.host_name + "*"}) is None: # The host name is part of the network key.
new_devices.append(device)
elif device.getId() not in self._remote_clusters:
self._remote_clusters[device.getId()] = device
remote_clusters_added = True
CuraApplication.getInstance().getDiscoveredUltimakerCloudPrintersModel().addDiscoveredUltimakerCloudPrinter(new_devices)
if not new_devices:
if remote_clusters_added:
self._connectToActiveMachine()