power: abort a scheduled firmware restart if klipper reports ready
This handles a specific scenario where a power device is bound to the Klipper service and is configured to perform a firmware restart after power on. In this case, we can detect if the firmware restart is required and abort it if necessary. Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
739af51904
commit
7f11214609
|
@ -315,6 +315,9 @@ class PowerDevice:
|
|||
if not self.need_scheduled_restart:
|
||||
return
|
||||
self.need_scheduled_restart = False
|
||||
if state == "ready":
|
||||
logging.info("Klipper reports 'ready', aborting firmware restart")
|
||||
return
|
||||
event_loop = self.server.get_event_loop()
|
||||
kapis: APIComp = self.server.lookup_component("klippy_apis")
|
||||
event_loop.delay_callback(
|
||||
|
|
Loading…
Reference in New Issue