Utilize adaptive interval for temperature and sd status polling

This way user adjustments to those timeouts via the settings
will take immediate effect even while the connection to the
printer is already established.
This commit is contained in:
Gina Häußge committed 2015-03-25 17:27:59 +01:00
1 parent 50862668b1
commit af7d2bb8c7
1 file changed
+2 -2
+2 -2
View File
@@ -511,7 +511,7 @@ class MachineCom(object):
self.sendCommand("M24")
self._sd_status_timer = RepeatedTimer(get_interval("sdStatus"), self._poll_sd_status, run_first=True)
self._sd_status_timer = RepeatedTimer(lambda: get_interval("sdStatus"), self._poll_sd_status, run_first=True)
self._sd_status_timer.start()
else:
line = self._getNext()
@@ -1144,7 +1144,7 @@ class MachineCom(object):
self.sendCommand("M27", cmd_type="sd_status_poll")
def _onConnected(self):
self._temperature_timer = RepeatedTimer(get_interval("temperature"), self._poll_temperature, run_first=True)
self._temperature_timer = RepeatedTimer(lambda: get_interval("temperature"), self._poll_temperature, run_first=True)
self._temperature_timer.start()
self._changeState(self.STATE_OPERATIONAL)