This adds initial support for connecting Moonraker to the SimplyPrint
service. Currently the connection defaults to SimplyPrint's dev/test
endpoint, this will be changed prior to official release.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Its possible for any component to request a configuration
option from another component. Don't overwrite the
inital value stored.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Process included files in the order they are added. This changes how
duplicate sections throughout included files are merged, options in
the last section to be parsed will take precedent.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
The webcam module allows users to enter webcam configuration through
moonraker.conf while keeping compatibility with frontends that
store webcam data in the database.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
In the future, an `Access-Control-Request-Private-Network` header will be sent with
these requests, and servers must respond with `Access-Control-Allow-Private-Network`.
This will start with the next Chrome version (104), and Mozilla has marked the
standard as "worth prototyping", which often leads to final implementation.
Signed-off-by: Franklyn Tackitt <git@frank.af>
Check for updates every 7 days rather than every 28 days. This
is in preparation of an upcoming beta release.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Python 3.10 deprecates "get_event_loop()", so it is necessary to
create a new loop and set it as active at startup. Previously
Moonraker only did this after a soft restart.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
For legacy purposes its possible that "initialize()" may be an
awaitable. Ignore the type as it consues mypy.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Remote devices, such as the tplink smartplug and http
based devices, may not be immediately available when
Moonraker starts. Previously this would result in an error.
Remote switches that requiring polling for state will now
reattempt initialization indefinitely. This behavior brings
them in line with devices that are updated asynchronously.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Override the paho-mqtt client "reconnect()" method with
a method capable of taking a connected socket. This allows
Moonraker to connect the socket asynchronously, then finish
establishing the connection.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't allow exceptions to propagate beyond a call to
_process_event(). Make sure the future is not marked
as done prior to setting the result.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
For the "Percent" preset the intensity controls the amount of the bar lit up 0-100
Work around issue when preset is re-enabled if sending intensity or speed while no preset is active
Removed control endpoint
Added missed toggle endpoint
Transition time to 0 for control changes
Signed-off-by: Richard Mitchell <richardjm+moonraker@gmail.com>
To accommodate access to multiple protocols Moonraker will always
require that the "params" field contain a dictionary, so reject any
other type as invalid. There is no need to expand keyword arguments,
simply pass the params dict to the callback.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Add basic support "agents", ie: unmanaged extensions. Connected
agents are granted a limited ability to emit websocket notifications
and process rpc requests from Moonraker.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
HTTP 404 and JSON-RPC -32601 are equivalent, so translate
where necessary. Any other JRPC code received outside of the
HTTP error range should be assigned a 500.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Handle exceptions should the attempt to fetch peer
credentials on the unix socket fail. This isn't a hard
requirement for connection and should not cause
the connection to abort.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This prevents a scenario where a request handler mutates
the arguments of a WebRequest, which could result in
changing the default "request_arguments" in
"InternalTransport.call_method()".
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This is a reimplementation of commit d61540cad5,
however this attempt provides a fallback for legacy configurations
that still have configuration in the server section.
This will change how `/server/config` reports configuration. Options
will always be reported in their respective component's field, even if
they are currently configured in the `[server]` section.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This isn't necessary as we don't add new sections to the
original config object when parsing supplemental data.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This replaces the previous "get_sd_directory()" method, allowing
consumers to get any registered root path.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This isn't necessary as we don't add new sections to the
original config object when parsing supplemental data.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Most core components have default options that allow them to
load without a section specified in moonraker.conf. This resulted
in those options showing up in the [server] section in the
"/server/config" response. These changes will make sure that those
values show up in the correct section.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Use git for-each-ref to retreive tags and their associated commit
hashes. This allows us to limit the amount of tags to 10 and
simplifies the code as the returned objects are already dereferenced.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
Don't require the `app_params` argument, instead dynamically
generate the configuration from a dict. This simiplifies AppDeploy
initialization as the internally generated configurations can be
read in the same way as those supplied in moonraker.conf.
Signed-off-by: Eric Callahan <arksine.code@gmail.com>