mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 16:27:51 -06: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue