Do not allow on, off, or status requests without arguments. Pass device objects to "power_device()" rather than device names.
Signed-off-by: Eric Callahan <arkine.code@gmail.com>
Devices are now configured using "prefix" sections. The pin configuration now more closely mimics that of Klipper's configuration so as to reduce confusion.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Only load the plugin for each prefix section once. Plugins themselves will be responsible for parsing the configuration from each prefix section.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add python3-libgpiod dependency.
As this dependency requiress a rebuild of the python3 environment, add some command line options to the install script:
- "-r" will rebuild the virtualenv
- "-f" will force overwite the defaults file. By default an existing defaults file will not be modified.
- "-c <config_path>" will direct moonraker to use the supplied path for the config file.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Tornado clears the headers when an error is detected, "set_default_headers" must be overrridden so that errors are properly returned.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The `enable_cors` option has been removed from the [server] config. CORS is now configured in [authorization] via the `cors_domains` option.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Rather than allow all origins as was the default with "enable_cors", users may not specify the domains allowed. If "*" is specified, all domains are allowed.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Determine the byte location of the first and last gcode command (Either Mxxx or Gxxx commands). This is useful for determining the portion of the file that consists of actual commands.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
GIven that subscriptions are reset, connected clients no longer maintained and they cannot check "webhooks.state" to see if Klippy is ready. This notifcation may be used to in its place.
SIgned-off-by: Eric Callahan <arksine.code@gmail.com>
Document the new server.websocket.id method and update the documentation for the subscription APIs.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Clients may provide arguments either in the query string or body. Reserved arguments "token" and "connection_id" are excluded from the result.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Some requests, such "printer/objects/subscribe", require a websocket
for asynchronous updates. Clients may now specify a "connection_id"
in the form data that identifies an associated websocket.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
There is no need to pass the auth, server, or websocket manager objects to request handlers. They can be retreived directly from the application reference.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows clients to "unsubscribe"by sending an empty dict. Each client will receive updates only for subscribed objects.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This class encapsulates all request data received from a client. This simplifies callbacks and makes it easier to add additional parameters to a client request.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This allows regsitered methods to be coroutines. Execution is done on the event loop to prevent a coroutine from blocking the incoming command queue.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This is a better description of the item parsed from _convert_path() is a path relative to the "root" directory.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Previously different parts of the file manager referred to name identifying a "root directory" as either base or root. This could lead to confusion, so all references are now "root".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>