You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,14 @@ It can also pull code from a web server, so you can run Adafruit example code di
19
19
20
20
It does not currently support Microsoft Windows. I do not have a Windows machine and have no way to test it with Windows. I understand that a lot of people use Windows and that the lack of support means that a lot of people who might benefit from circremote won't be able to use it. While I'm happy to spend some time and resources on continuing to develop circremote and support users, I don't have the time, energy or desire to bring up a new platform and get it working on it. If a motivated co-maintainer comes along who'd like to get circremote working properly with Windows and then support it, I'd be happy to bring someone like that onto the project.
21
21
22
-
From here, see how to install circremote and then please check out the [FAQ](doc/FAQ.md) to see how to use it.
23
-
24
22
-[About circremote](doc/about.md)
25
23
-[Install](doc/install.md)
26
24
-[Usage](doc/usage.md)
27
25
-[Commands](doc/commands.md)
28
26
-[Configuration](doc/configuration.md)
29
27
-[Contributing](doc/contributing.md)
30
28
-[Development](doc/development.md)
29
+
-[Testing](doc/testing.md)
31
30
-[FAQ](doc/faq.md)
32
31
33
32
@@ -39,4 +38,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
39
38
40
39
- CircuitPython community for the excellent ecosystem
Commands consist of three files that are stored in a directory with the name of the command.
33
+
34
+
-`code.py` - the Python code for the command
35
+
-`requirements.txt` - required libraries to be installed by `circup`
36
+
-`info.json` - information about the command
37
+
38
+
#### `code.py`
39
+
40
+
Just like a `code.py` file that's stored on a CircuitPython device, on this file is never saved to the device's internal flash storage.
41
+
42
+
Maximum size will depend on the available memory on the device.
43
+
44
+
##### Variables
45
+
46
+
The file supports very limited substitutions using the syntax `{{NAME}}` - that string will be replaced with the value of the variable named `NAME`. Variables must be listed in `info.json`. We use double curly braces to try to avoid confusion with f-string substitutions.
The `busio.I2C()` line would throw an exception and control would pass to the `board.I2C()` line which would use the default I2C pins for the board.
106
+
107
+
Variables are interpolated using direction string replacement, without any type checking - they're all strings. If you need the result in the Python code to be a string, make sure you include quotes around it in the code.
108
+
109
+
For instance, if `filename` is `settings.toml` then this code would fail:
110
+
```
111
+
print({{ filename }})
112
+
```
113
+
and this code would work:
114
+
```
115
+
print("{{ filename }}")
116
+
```
117
+
118
+
Variables can be optional or required, and can have a default value. Variables with a default value are always optional.
119
+
120
+
##### Default command line
121
+
122
+
A command can include a default command line which has variables automatically substituted in it.
123
+
124
+
For instance, the `cat` command takes one variable, `filename`. It also has a default commandline of `filename`.
125
+
126
+
You can run it like this:
127
+
`circremote DEVICE cat filename=settings.toml`
128
+
or like this:
129
+
`circremote DEVICE cat settings.toml`
130
+
and the filename will automatically be set.
131
+
132
+
#### `requirements.txt`
133
+
134
+
Normal file format, one library name per line, comments start with \#
135
+
136
+
#### `info.json`
137
+
138
+
This is a JSON file with information about the command. This is an example for the `cat` command:
139
+
```
140
+
{
141
+
"description": "Output a file",
142
+
"warn_unavailable": false,
143
+
"variables": [
144
+
{
145
+
"name": "filename",
146
+
"required": true,
147
+
"description": "File to cat",
148
+
"default": null
149
+
}
150
+
],
151
+
"tested": true,
152
+
"default_commandline": "filename"
153
+
}
154
+
```
155
+
156
+
-`description` is used by `-h` to describe what the command does
157
+
-`warn_unavailable` indicates that the user should be warned that this could make the device unavailable or unreachable
158
+
-`variables` - an array of variables, each has a `named, `required` flag, `description and a `default` value
159
+
-`tested` - this indicates whether the command has been tested. Many commands were written by an LLM. While they're verified to parse correctly they may not yet have been truly tested with hardware.
160
+
-`default_commandline` - this is the default command line, used with variable substitutions
0 commit comments