diff --git a/src/renderer/editor/HighlightedCode.css b/src/renderer/editor/HighlightedCode.css
new file mode 100644
index 0000000..f6b4242
--- /dev/null
+++ b/src/renderer/editor/HighlightedCode.css
@@ -0,0 +1,12 @@
+.HighlightedCode-editor .ace_scroller {
+ width: 100%;
+}
+.HighlightedCode-editor .ace_cursor {
+ opacity: 0;
+}
+.HighlightedCode-editor .ace_marker-layer {
+ display: none;
+}
+.HighlightedCode-editor .ace_print-margin {
+ display: none;
+}
diff --git a/src/renderer/editor/HighlightedCode.tsx b/src/renderer/editor/HighlightedCode.tsx
new file mode 100644
index 0000000..2913bd3
--- /dev/null
+++ b/src/renderer/editor/HighlightedCode.tsx
@@ -0,0 +1,36 @@
+import AceEditor from 'react-ace';
+import 'ace-builds/src-noconflict/mode-python';
+import './HighlightedCode.css';
+
+export default function HighlightedCode({
+ children,
+ indent = 0,
+}: {
+ children: string;
+ indent: number?;
+}) {
+ const lines = children.split('\n');
+ if (lines.length && !lines[0].trim()) {
+ lines.shift();
+ }
+ if (lines.length && !lines[lines.length - 1].trim()) {
+ lines.pop();
+ }
+ // Remove common indent
+ const minIndent = Math.min(...lines
+ .filter(line => line.trim().length)
+ .map(line => line.match(/^ */)[0].length)
+ );
+ const formatted = lines.map(line => ' '.repeat(indent) + line.slice(minIndent)).join('\n');
+ return (
+
get_value
function returns the current value of a
+ specified param
on a device with the specified device_id
.
+ device_id
: the ID that specifies which PiE device
+ will be read
+ param
: identifies which parameter on the specified
+ PiE device will be read. Possible param values depend on the specified device. Find a list of
+ params for each type of device on the lowcar devices page.
+ device_id
and
+ the param
"switch0" will return True when pressed down and False if not.
+