Add default for duration parameter of preheatBed

It defaults to 15 minutes.

Contributes to issue CURA-3161.
This commit is contained in:
Ghostkeeper 2017-02-07 13:22:21 +01:00
parent cfbcf56739
commit 9d8034d14f
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -244,8 +244,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
#
# \param temperature The temperature to heat the bed to, in degrees
# Celsius.
# \param duration How long the bed should stay warm, in seconds.
def preheatBed(self, temperature, duration):
# \param duration How long the bed should stay warm, in seconds. Defaults
# 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)
put_request = QNetworkRequest(url)