Manually create printer properties for cloud output device

This commit is contained in:
ChrisTerBeke 2019-02-15 16:46:47 +01:00
parent 21099e30cb
commit e80eccaea3

View File

@ -61,8 +61,19 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice):
# \param cluster: The device response received from the cloud API. # \param cluster: The device response received from the cloud API.
# \param parent: The optional parent of this output device. # \param parent: The optional parent of this output device.
def __init__(self, api_client: CloudApiClient, cluster: CloudClusterResponse, parent: QObject = None) -> None: def __init__(self, api_client: CloudApiClient, cluster: CloudClusterResponse, parent: QObject = None) -> None:
# The following properties are expected on each networked output device.
# Because the cloud connection does not off all of these, we manually construct this version here.
# An example of why this is needed is the selection of the compatible file type when exporting the tool path.
properties = {
b"address": b"",
b"name": cluster.host_name.encode(),
b"firmware_version": cluster.host_version.encode(),
b"printer_type": b""
}
super().__init__(device_id = cluster.cluster_id, address = "", super().__init__(device_id = cluster.cluster_id, address = "",
connection_type = ConnectionType.CloudConnection, properties = {}, parent = parent) connection_type = ConnectionType.CloudConnection, properties = properties, parent = parent)
self._api = api_client self._api = api_client
self._cluster = cluster self._cluster = cluster