Skip to content

Commit 8296519

Browse files
authored
idle_timeout: let it be 0 (#165)
1 parent d9ce54f commit 8296519

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ If I want my printer to light itself on fire, I should be able to make my printe
7676

7777
- [kinematics: independent X & Y acceleration and velocity settings](https://github.com/DangerKlippers/danger-klipper/pull/4)
7878

79+
- [idle_timeout: allow the idle timeout to be disabled](https://github.com/DangerKlippers/danger-klipper/issues/165)
80+
7981
- [canbus: custom CAN bus uuid hash for deterministic uuids](https://github.com/DangerKlippers/danger-klipper/pull/156)
8082

8183
If you're feeling adventurous, take a peek at the extra features in the bleeding-edge branch [feature documentation](docs/Bleeding_Edge.md)

docs/Config_Reference.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,8 @@ explicit idle_timeout config section to change the default settings.
16491649
# "TURN_OFF_HEATERS" and "M84".
16501650
#timeout: 600
16511651
# Idle time (in seconds) to wait before running the above G-Code
1652-
# commands. The default is 600 seconds.
1652+
# commands. Set it to 0 to disable the timeout feature.
1653+
# The default is 600 seconds.
16531654
```
16541655

16551656
## Optional G-Code features

klippy/extras/idle_timeout.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(self, config):
2323
self.gcode = self.printer.lookup_object("gcode")
2424
self.toolhead = self.timeout_timer = None
2525
self.printer.register_event_handler("klippy:ready", self.handle_ready)
26-
self.idle_timeout = config.getfloat("timeout", 600.0, above=0.0)
26+
self.idle_timeout = config.getfloat("timeout", 600.0, minval=0)
2727
gcode_macro = self.printer.load_object(config, "gcode_macro")
2828
self.idle_gcode = gcode_macro.load_template(
2929
config, "gcode", DEFAULT_IDLE_GCODE
@@ -64,6 +64,9 @@ def transition_idle_state(self, eventtime):
6464
return self.reactor.NEVER
6565

6666
def check_idle_timeout(self, eventtime):
67+
# timeout is disabled
68+
if not self.idle_timeout > 0:
69+
return eventtime + 60.0
6770
# Make sure toolhead class isn't busy
6871
print_time, est_print_time, lookahead_empty = self.toolhead.check_busy(
6972
eventtime

0 commit comments

Comments
 (0)