From 0df4afff33a823cfaebcf2b1538791c37abaa5f5 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 7 Feb 2017 13:26:10 +0100 Subject: [PATCH] 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. --- plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index 470d0efa0a..e43e522c0c 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -248,7 +248,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): # to a quarter hour. def preheatBed(self, temperature, duration=900): 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.setHeader(QNetworkRequest.ContentTypeHeader, "application/json") self._manager.put(put_request, data.encode())