mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Properly float-format input of preheatBed
It rounds to 3 digits. The specification of the feature in the API doesn't mention how detailed the temperature and duration can go, but thousands seems more than enough. This also eliminates pesky problems with the JSON brackets in the format function. Contributes to issue CURA-3161.
This commit is contained in:
parent
559b40867e
commit
3618ae0d4f
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
|||
@pyqtSlot(float, float)
|
||||
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=str(temperature), timeout=str(duration))
|
||||
data = """{"temperature": "%0.3f", "timeout": "%0.3f"}""" % (temperature, duration)
|
||||
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