idle_timeout: Add status field for current idle timeout (#6982)

Signed-off-by: Eric Billmeyer <eric.billmeyer@freenet.de>
This commit is contained in:
Contomo 2025-08-01 18:37:47 +02:00 committed by GitHub
parent 2cbb895978
commit d5c031bc13
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -291,6 +291,9 @@ is always available):
- `printing_time`: The amount of time (in seconds) the printer has
been in the "Printing" state (as tracked by the idle_timeout
module).
- `idle_timeout`: The current 'timeout' (in seconds)
to wait for the gcode to be triggered.
(as set by [SET_IDLE_TIMEOUT](G-Codes.md#set_idle_timeout))
## led

View File

@ -35,7 +35,9 @@ class IdleTimeout:
printing_time = 0.
if self.state == "Printing":
printing_time = eventtime - self.last_print_start_systime
return { "state": self.state, "printing_time": printing_time }
return {"state": self.state,
"printing_time": printing_time,
"idle_timeout": self.idle_timeout}
def handle_ready(self):
self.toolhead = self.printer.lookup_object('toolhead')
self.timeout_timer = self.reactor.register_timer(self.timeout_handler)