Skip to content

Commit 7a26ca8

Browse files
committed
Created readme files
1 parent 7552872 commit 7a26ca8

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

extended_macro/readme.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# extended_macro
2+
---
3+
* Allow the use of custom Python functions in your Klipper macros by defining the functions in a YAML config file
4+
* Functions can accept parameters and return values to the macro.
5+
6+
### WARNING:
7+
8+
**Do not blindly download Python scripts, both for use in your macros and this script itself.** Read the script and ensure you understand what is going on. The scripts can be powerful and useful, but they can also be dangerous. If the script looks questionable, dangerous, or too confusing, it's better to assume that it is malicious.
9+
10+
**Installation:**
11+
1. Clone this repository or download both `extended_macro.py` and `extended_template.py`
12+
2. Locate where the `klippy-env` directory is on your Klipper instance.
13+
3. Run the following command, substituting `~/klippy-env/` with the location found above:
14+
15+
`~/klippy-env/bin/python -m pip install pyyaml==3.1.4`
16+
17+
4. Finally, move `extended_macro.py` and `extended_template.py` to your Klippy Extras file. This usually is located at `~/klipper/klippy/extras`.
18+
19+
---
20+
**Setup:**
21+
22+
See the examples folder for more guidance.
23+
1. Create your Python script(s) with the function(s) you intend to use.
24+
2. Create a function configuration file using `example/function_config.yaml` as reference. YAML is the allowed schema. The extension must be `yml` or `yaml`
25+
3. In your Klipper config, add the `[extended_template]` section to define the location of your function config file.
26+
27+
---
28+
**Usage:**
29+
30+
See the examples folder for more guidance.
31+
32+
When defining the macro, use `extended_macro` as the config name instead of `gcode_macro`. To use your function, you will wrap the name with curly brackets (`{gcode_function_name_goes_here}`).

readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# droans Klipper Extras
2+
---
3+
* Extended_Macro: Allow the use of user-defined Python code

0 commit comments

Comments
 (0)