mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 17:59:00 +08: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
@ -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…
x
Reference in New Issue
Block a user