mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-27 07:33:12 +08:00
Convert parameters to string before including them
This way you can provide normal floating point values instead of providing strings with numbers in them. Contributes to issue CURA-3161.
This commit is contained in:
parent
d7bf23ca21
commit
0df4afff33
@ -248,7 +248,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||||||
# to a quarter hour.
|
# to a quarter hour.
|
||||||
def preheatBed(self, temperature, duration=900):
|
def preheatBed(self, temperature, duration=900):
|
||||||
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
url = QUrl("http://" + self._address + self._api_prefix + "printer/bed/pre_heat")
|
||||||
data = """{"temperature": "{temperature}", "timeout": "{timeout}"}""".format(temperature=temperature, timeout=duration)
|
data = """{"temperature": "{temperature}", "timeout": "{timeout}"}""".format(temperature=str(temperature), timeout=str(duration))
|
||||||
put_request = QNetworkRequest(url)
|
put_request = QNetworkRequest(url)
|
||||||
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json")
|
||||||
self._manager.put(put_request, data.encode())
|
self._manager.put(put_request, data.encode())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user