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:
parent
50862668b1
commit
af7d2bb8c7
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue