Make sure the unsuccessful manual device gets removed

CURA-6057
This commit is contained in:
Lipu Fei 2019-04-08 12:25:52 +02:00
parent 5cce4cd4cd
commit 086ae1c735

View file

@ -286,7 +286,7 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
self.refreshConnections() self.refreshConnections()
def _checkManualDevice(self, address): def _checkManualDevice(self, address: str) -> None:
# Check if a UM3 family device exists at this address. # Check if a UM3 family device exists at this address.
# If a printer responds, it will replace the preliminary printer created above # If a printer responds, it will replace the preliminary printer created above
# origin=manual is for tracking back the origin of the call # origin=manual is for tracking back the origin of the call
@ -307,7 +307,8 @@ class UM3OutputDevicePlugin(OutputDevicePlugin):
# - Something went wrong with checking the amount of printers the cluster has! # - Something went wrong with checking the amount of printers the cluster has!
# - Couldn't find printer at the address when trying to add it manually. # - Couldn't find printer at the address when trying to add it manually.
if address in self._manual_instances: if address in self._manual_instances:
self.removeManualDeviceSignal.emit(self.getPluginId(), "", address) key = "manual:" + address
self.removeManualDevice(key, address)
return return
if "system" in reply_url: if "system" in reply_url: