This commit is contained in:
ChrisTerBeke 2019-07-29 17:38:07 +02:00
parent 14808c5de1
commit 6d9b6668e2
2 changed files with 5 additions and 3 deletions

View file

@ -47,6 +47,7 @@ class CloudOutputDeviceManager:
self._update_timer.setInterval(int(self.CHECK_CLUSTER_INTERVAL * 1000)) self._update_timer.setInterval(int(self.CHECK_CLUSTER_INTERVAL * 1000))
self._update_timer.setSingleShot(False) self._update_timer.setSingleShot(False)
# Ensure we don't start twice.
self._running = False self._running = False
## Starts running the cloud output device manager, thus periodically requesting cloud data. ## Starts running the cloud output device manager, thus periodically requesting cloud data.
@ -55,7 +56,7 @@ class CloudOutputDeviceManager:
return return
self._account.loginStateChanged.connect(self._onLoginStateChanged) self._account.loginStateChanged.connect(self._onLoginStateChanged)
self._update_timer.timeout.connect(self._getRemoteClusters) self._update_timer.timeout.connect(self._getRemoteClusters)
self._onLoginStateChanged(is_logged_in = self._account.isLoggedIn) self._onLoginStateChanged(is_logged_in=self._account.isLoggedIn)
## Stops running the cloud output device manager. ## Stops running the cloud output device manager.
def stop(self): def stop(self):
@ -63,7 +64,7 @@ class CloudOutputDeviceManager:
return return
self._account.loginStateChanged.disconnect(self._onLoginStateChanged) self._account.loginStateChanged.disconnect(self._onLoginStateChanged)
self._update_timer.timeout.disconnect(self._getRemoteClusters) self._update_timer.timeout.disconnect(self._getRemoteClusters)
self._onLoginStateChanged(is_logged_in = False) self._onLoginStateChanged(is_logged_in=False)
## Force refreshing connections. ## Force refreshing connections.
def refreshConnections(self) -> None: def refreshConnections(self) -> None:

View file

@ -42,13 +42,14 @@ class NetworkOutputDeviceManager:
self._discovered_devices = {} # type: Dict[str, NetworkOutputDevice] self._discovered_devices = {} # type: Dict[str, NetworkOutputDevice]
self._output_device_manager = CuraApplication.getInstance().getOutputDeviceManager() self._output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
# TODO: move zeroconf stuff to own class # TODO: move zeroconf stuff to own class?
self._zero_conf = None # type: Optional[Zeroconf] self._zero_conf = None # type: Optional[Zeroconf]
self._zero_conf_browser = None # type: Optional[ServiceBrowser] self._zero_conf_browser = None # type: Optional[ServiceBrowser]
self._service_changed_request_queue = None # type: Optional[Queue] self._service_changed_request_queue = None # type: Optional[Queue]
self._service_changed_request_event = None # type: Optional[Event] self._service_changed_request_event = None # type: Optional[Event]
self._service_changed_request_thread = None # type: Optional[Thread] self._service_changed_request_thread = None # type: Optional[Thread]
# TODO: move manual device stuff to own class?
# Persistent dict containing manually connected clusters. # Persistent dict containing manually connected clusters.
self._manual_instances = {} # type: Dict[str, ManualPrinterRequest] self._manual_instances = {} # type: Dict[str, ManualPrinterRequest]
self._last_manual_entry_key = None # type: Optional[str] self._last_manual_entry_key = None # type: Optional[str]