mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Don't send a time-out for preheat if timeout is 0
The printer doesn't accept 0. Contributes to issue CURA-3161.
This commit is contained in:
parent
8d09c53896
commit
785f10966e
1 changed files with 4 additions and 1 deletions
|
@ -250,7 +250,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
@pyqtSlot(int, int)
|
||||
def preheatBed(self, temperature, duration):
|
||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
||||
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
||||
if duration > 0:
|
||||
data = """{"temperature": "%i", "timeout": "%i"}""" % (temperature, duration)
|
||||
else:
|
||||
data = """{"temperature": "%i"}""" % temperature
|
||||
put_request = QNetworkRequest(url)
|
||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||
self._manager.put(put_request, data.encode())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue