Add the "status_delay" option for Home Assistant and refactor to clarify what each option does for each device type.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Some devices on the Home Assistant server do not update their internal state immediately after a request returns. Introduce a configurable delay to work around this issue.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This provides corrective action in the event that an
invalid user entry makes its way into the database.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
For gpiod versions 1.3 or greater use the "default_val" keyword argument to set the default, otherwise use
"default_vals".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Determine if a firmware restart should be postponed by checking Klippy's state. This should correctly schedule the restart regardless of whether or not the device is bound to Klipper.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
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>
When this option is set to "True", the device will power on after the file manager queues an upload for printing.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Now that init occurs before the server starts there is no need to block requests until post initialization.
Signed-off-buy: Eric Callahan <arksine.code@gmail.com>
Occasionally a server restart will fail as the new loop instantiates as closed. This seems to be an issue with asyncio, attempt to work around by retyring to create a new loop.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Previously a set was used to remove duplicate components, however this is unnecessary as the `load_component` method immediately returns dups. Using a list should preserve the load order based on the configuration, making it more predictable.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The `send_event()` method now returns a future that can be awaited until all callbacks are complete. All events emitted during Klipper init are now awaited, and a Lock is used to prevent re-entry. This resolves potential timing issues with commands sent during the init sequence.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Components may call a "component_init" method for initialization that requires async calls. This allows moonraker to track init progress and guarantee init order.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remove the "load_component_multi" method as it is not
necessary. Components are responsible for loading
"child" sections as required. Core components can
now have their own config section.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add support for holding multiple printer jobs in a queue.
When a job successfully completes Moonraker will load
the next job in the queue.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This module adds a helper to track Klippy's "print_stats" module. It
stores the current stats and emits events for changes in job state.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The `update_service_status()` method could result in the creation of multiple subprocesses for each update, resulting in a performance hit as subprocesses are inherently expensive.
Fetch the state for all detected services in a single subprocess.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>