Commit Graph

235 Commits

Author SHA1 Message Date
Arksine 3b63205e70 websockets: Report exception when "TypeError" is caught
Signed-off-by:  Eric Callahan <arksine.coded@gmail.com>
2020-11-08 07:39:37 -05:00
Arksine ffdcfd527a file_manager: clear metadata on item delete or move
When a directory is deleted or moved go ahead and prune the storage.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-08 07:39:36 -05:00
Arksine 472c7c4b23 file_manager: rename all refrences of "base" to "root"
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>
2020-11-07 20:36:08 -05:00
Arksine c415f9ee15 file_manager: Don't store file lists
Since we need to walk through a file list each time one is requested there is no gain from storing lists locally.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:36:08 -05:00
Arksine e51dbb45c1 file_manager: refactor the MetadataStorage class
Storage is now updated by individual calls to "parse_metadata()" instead of passing a full list.  This will allow the manager to

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:36:08 -05:00
Arksine e5f3aeca78 docs: document remote method calls
This updates the "PANELDUE_BEEP" gcode macro to use the "paneldue_beep" remote method.  Also included is documentation on the "set_device_power" method added to the power plugin.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:34:56 -05:00
Arksine 59d27e6829 power: register "set_device_power" remote method
This allows device power to be toggled from a klipper gcode macro.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:34:56 -05:00
Arksine 6464bbfc3c paneldue: register "paneldue_beep" remote method
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:34:56 -05:00
Arksine ba78a82a26 moonraker: add ability to register remote methods with Klippy
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:34:56 -05:00
Arksine c6d629659b klippy_apis: Add API to register methods with Klippy
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-07 20:34:56 -05:00
Arksine 5ff87aa24e docs: Add home assistant example
Example provided courtesy of Github User Kruppes.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2020-11-06 07:00:01 -05:00
Arksine 8bd6e45303 file_manager: fix bug in _handle_metadata_request()
Don't modify the metadata directly.  Create a copy, then add the "filename" item.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-05 12:43:17 -05:00
Arksine 73cbcb7b7e docs: document "extended" argument for GET directory endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-02 20:18:07 -05:00
Arksine 624be50026 file_manager: add "extended" argument to directory endpoint
If extended==True is passed to GET directory then the result for each gcode file will include associate metadata, if present.

SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-02 20:18:07 -05:00
Arksine f14b1f3ff0 file_manager: use os.path.splitext to find file extensions
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-11-02 20:18:03 -05:00
Arksine 0c7fa454e9 scripts: add "pillow" python requirement
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-31 08:40:49 -04:00
Arksine aac11a9fb8 extract_metadata: Add support for extracting Cura thumbnails
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-31 08:40:49 -04:00
Arksine 0d515e4938 file_manager: Add support for uploading and extracting ufp files
Credit to GitHub user cdkeito for creating a template from which this implementation was inspired.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-31 08:40:49 -04:00
Jordan Ruthe b63d192df7 power: add websocket notification
Signed-off-by: Jordan Ruthe <jordanruthe@gmail.com>
2020-10-27 18:08:56 -04:00
Arksine d582d76346 docs: Add clarification to printer object description
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-26 21:29:53 -04:00
Arksine 9394bf592c docs: Add documentation for Klipper Printer Objects
This documents the most useful printer objects available for query, providing the fields that a query returns and what the represent.

Also add a basic  "print state monitoring" example and  "bed_mesh" example to web_api.md.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-26 21:25:20 -04:00
Arksine 4919548ef5 test_client: Add button to retreive mesh
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-26 20:29:02 -04:00
th33xitus 374d984ced fix: make installer not fail if klipper is installed as systemd service
If Klipper is installed as systemd service, the script would fail and exit at step 6 (corrected that typo) when trying to stop Klipper via init.d.
Changing the used command to systemctl will be compatible with both init.d and systemd services.

Signed-off-by:  Dominik Willner <th33xitus@gmail.com>
2020-10-26 14:46:44 -04:00
Arksine 413062f8e8 docs: Update API documentation
The "modified" field returned by all file manager endpoints and notifications now refers to unix time (in seconds).

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-25 19:50:24 -04:00
Arksine 7554a599b4 paneldue: Convert "modifed" attribute of metadata to a string
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-21 17:54:36 -04:00
Arksine dfb1e19948 extract_metadata: store file "modified" time as unix time
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-21 17:53:45 -04:00
Arksine f2fb8d33d4 file_manager: store file "modified" time as unix time
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-21 17:53:08 -04:00
Arksine 2d77400a65 docs: update for latest API additions and changes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-21 15:42:03 -04:00
Arksine 8a6503da8a datastore: Add timestamp (in unix time) field to each line in the gcode store
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-18 16:52:08 -04:00
Arksine ab35346f24 moonraker: Add method to retreive host info
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-13 07:53:40 -04:00
Arksine 28844cb41d PanelDue: Dump recieved gcode queue on restart
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-11 09:09:17 -04:00
Arksine 8fcccfd46e moonraker: Add "/server/restart" endpoint
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-11 09:09:17 -04:00
Arksine f220e1b2ee moonraker: remove stale objects from subscription tracking
This prevents moonraker from subscribing to unknown printer objects on startup.

SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-10 08:52:44 -04:00
Arksine 346c3ad2a0 PanelDue: Make checksums optional
Some displays which emulate PD firmware do not use checksums.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-08 14:28:15 -04:00
Arksine 7a013a42f7 machine: Use shutdown -r command to reboot
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-05 18:23:58 -04:00
Arksine 264e708c1d file_manager: fix typo in directory check
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-05 18:16:10 -04:00
Arksine 620fb356cc file_manager: Update the internal file list when `get_directory` is called
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-10-05 17:57:18 -04:00
Arksine 43d8e181be readme: Add Fluidd to the list of supported clients
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-30 18:08:41 -04:00
Arksine ac648cefcf docs: Add new endpints to API documention
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-30 18:03:25 -04:00
Arksine 7e3f236393 data_store: add "/server/gcode_store" endpoint
Clients may use this API to fetch up to 1000 lines of cached gocde responses.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-28 14:57:44 -04:00
Arksine b8fc6f5130 plugins: rename "temperature_store" plugin to "data_store".
This is in preparation for additional storage functionality.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-28 14:08:40 -04:00
Eric Callahan a578199dab
docs: fix incorrect option for API Key file location
Resolves #22.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-28 06:53:45 -04:00
Arksine 8440a10b9e extract_metadata: attempt to parse object height from PrusaSlicer comments
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-26 11:44:18 -04:00
Arksine 756492f349 moonraker: add "/server/info" endpoint
This method provides basic server information, such as loaded plugins and the state of the UDS connection to Klippy.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-26 08:34:05 -04:00
Arksine 6905515f3d shell_command: add ability to cancel a running process
Also adds an indefinite timeout if the timeout is specified as "None".

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-26 06:14:35 -04:00
Arksine 3d1faebf15 moonraker: load_plugin() fix
Make sure that the correct config section is loaded when "load_plugin" is called.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-26 06:09:08 -04:00
Arksine d1c0cdf65b docs: Fix incorrect option for klippy_uds_address
Resolves #20.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-16 11:27:20 -04:00
Arksine 36fb1da46d docs: add missing documentation
- Document "enable_cors".  Resolves #18.
- Add a note that Moonraker is not aware of the gcode file path  until Klippy successfully starts.  Resolves #16.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-12 07:48:54 -04:00
Arksine 8b08b03fbf app: add max_upload_size configuration option
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-11 06:27:48 -04:00
Arksine 733cf0afac docs: Update metadata API documentation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2020-09-09 11:32:37 -04:00