Skip to content

Commit 04c901b

Browse files
committed
Merge branch 'dev'
2 parents c81ddfb + 6484292 commit 04c901b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+19166
-18400
lines changed

docs/develop/development.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ See [Documentation](https://moonmodules.org/MoonLight/develop/documentation/)
8282
🌙 and 💫 is also used in code comments of ESP32-SvelteKit to show where changes to upstream have been made.
8383
* The following ESP32-SvelteKit features have been switched off in the default builts (they can be switched on if you want to use them, see [features.ini](https://github.com/MoonModules/MoonLight/blob/main/features.ini))
8484
* -D FT_SECURITY=0
85-
* ~~-D FT_SLEEP=1~~ enabled!
85+
* -D FT_SLEEP=0
8686
* ~~-D FT_BATTERY=1~~ enabled!
8787

8888
### UI development server

docs/develop/modules.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,29 +39,29 @@ ModuleDemo(PsychicHttpServer *server
3939
4040
```cpp
4141
void setupDefinition(JsonArray root) override{
42-
JsonObject property; // state.data has one or more properties
43-
JsonArray details; // if a property is an array, this is the details of the array
44-
JsonArray values; // if a property is a select, this is the values of the select
42+
JsonObject control; // state.data has one or more properties
43+
JsonArray details; // if a control is an array, this is the details of the array
44+
JsonArray values; // if a control is a select, this is the values of the select
4545
46-
property = root.add<JsonObject>(); property["name"] = "hostName"; property["type"] = "text"; property["default"] = "MoonLight";
47-
property = root.add<JsonObject>(); property["name"] = "connectionMode"; property["type"] = "select"; property["default"] = "Signal Strength"; values = property["values"].to<JsonArray>();
46+
control = root.add<JsonObject>(); control["name"] = "hostName"; control["type"] = "text"; control["default"] = "MoonLight";
47+
control = root.add<JsonObject>(); control["name"] = "connectionMode"; control["type"] = "select"; control["default"] = "Signal Strength"; values = control["values"].to<JsonArray>();
4848
values.add("Offline");
4949
values.add("Signal Strength");
5050
values.add("Priority");
5151
52-
property = root.add<JsonObject>(); property["name"] = "savedNetworks"; property["type"] = "array"; details = property["n"].to<JsonArray>();
52+
control = root.add<JsonObject>(); control["name"] = "savedNetworks"; control["type"] = "rows"; details = control["n"].to<JsonArray>();
5353
{
54-
property = details.add<JsonObject>(); property["name"] = "SSID"; property["type"] = "text"; property["default"] = "ewtr"; property["min"] = 3; property["max"] = 32;
55-
property = details.add<JsonObject>(); property["name"] = "Password"; property["type"] = "password"; property["default"] = "";
54+
control = details.add<JsonObject>(); control["name"] = "SSID"; control["type"] = "text"; control["default"] = "ewtr"; control["min"] = 3; control["max"] = 32;
55+
control = details.add<JsonObject>(); control["name"] = "Password"; control["type"] = "password"; control["default"] = "";
5656
}
5757
5858
}
5959
6060
```
6161

6262
* Implement function **onUpdate** to define what happens if data changes
63-
* struct UpdatedItem defines the update (parent property (including index in case of multiple records), name of property and value)
64-
* This runs in the httpd / webserver task. To run it in another task (application task) use runInTask1 and 2 - see [ModuleLightsControl](https://github.com/MoonModules/MoonLight/blob/main/src/MoonLight/ModuleLightsControl.h)
63+
* struct UpdatedItem defines the update (parent control (including index in case of multiple records), name of control and value)
64+
* This runs in the httpd / webserver task. To run it in another task (application task) use runInAppTask - see [ModuleLightsControl](https://github.com/MoonModules/MoonLight/blob/main/src/MoonLight/ModuleLightsControl.h)
6565

6666
```cpp
6767
void onUpdate(UpdatedItem &updatedItem) override
@@ -131,7 +131,7 @@ submenu: [
131131

132132
### Readonly data
133133

134-
A module can consist of data which is edited by the user (e.g. selecting a live script to run) and data which is send from the server to the UI (e.g. a list of running processes). Currently both type of valuas are stored in state data and definition. Distinguished by property["ro"] = true in setupDefinition. So the client uses state data and definition to build a screen with both types visually mixed together (what is desirable). Currently there are 2 websocket events: one for the entire state (including readonly) and one only for readonly which only contains the changed values. Module.svelte handles readonly differently by the function handleRO which calls updateRecursive which only update the parts of the data which has changed.
134+
A module can consist of data which is edited by the user (e.g. selecting a live script to run) and data which is send from the server to the UI (e.g. a list of running processes). Currently both type of values are stored in state data and definition. Distinguished by control["ro"] = true in setupDefinition. So the client uses state data and definition to build a screen with both types visually mixed together (what is desirable). Currently there are 2 websocket events: one for the entire state (including readonly) and one only for readonly which only contains the changed values. Module.svelte handles readonly differently by the function handleRO which calls updateRecursive which only update the parts of the data which has changed.
135135

136136
It might be arguable that readonly variables are not stored in state data.
137137

docs/develop/nodes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ A node implements the following (overloaded) functions:
1818
* ...
1919

2020
* Node types: it is recommended that a node is one of the 4 types (Effect, Modifier, Layer, Driver). However each node could perform functionality of all types. To recognize what a node does the emojis 🚥, 🔥, 💎 and ☸️ are used in the name. The function hasOnLayout() and hasModifier() indicate the specific functionality the node supports. They control when a physical to virtual mapping is recalculated
21-
* **hasOnLayout()**: a layout node specify the amount of position of lights controlled. E.g. a panel of 16x16 or a cube of 20x20x20. If hasOnLayout() is true you should implement onLayout calling addLight(position) and addPin() for all the lights.
22-
* addPin() is needed if a LED driver is used to send the output to LED strips.
21+
* **hasOnLayout()**: a layout node specify the amount of position of lights controlled. E.g. a panel of 16x16 or a cube of 20x20x20. If hasOnLayout() is true you should implement onLayout calling addLight(position) for all the lights and nextPin()
22+
* nextPin() is needed to define how many ledsPerPin are used for each pin
2323
* **hasModifier()**: a modifier node which manipulates virtual size and positions and lights using one or more of the functions modifySize, modifyPosition and modifyXYZ.
2424
* if the loop() function contains setXXX functions is used it is an **effect** node. It will contain for-loops iterating over each virtual ! light defined by layout and modifier nodes. The iteration will be on the x-axis for 1D effects, but also on the y- and z-axis for 2D and 3D effects. setRGB is the default function setting the RGB values of the light. If a light has more 'channels' (e.g. Moving heads) they also can be set.
2525
* Moving heads

docs/moonbase/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
* **Restart needed**: e.g. when drivers are changed, a restart might be needed, see 🔄 in the statusbar. Clicking on the 🔄 icon allows you to restart
2323

24-
* **Save** and **Cancel** Changes are only saved after pressing the save button 💾. To undo changes, press the cancel button 🚫 and the last saved state will be restored.
24+
* **Save** and **Cancel** Changes are only saved after pressing the save button 💾. To undo changes, press the cancel button and the last saved state will be restored.
2525

2626
* **Theme**: Light, Dark, Auto
2727

docs/moonlight/lightscontrol.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Controls:
1414
* Hover with the mouse to see effects and modifiers in the preset
1515
* Double click on a saved preset to delete the preset.
1616
* Red: Selected preset
17-
* 🚨: Save (💾) or cancel (🚫 effects first, before storing them as a preset!
17+
* 🚨: Save (💾) or cancel (↻) Save effects first, before storing them as a preset!
1818
* Note: Presets only stores Effects and Modifiers, not Layers and Drivers.
1919
* Preset loop: loop over presets (seconds per presets)
2020
* Monitor On: sends LED output to the monitor.

features.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build_flags =
66
-D FT_UPLOAD_FIRMWARE=1
77
-D FT_DOWNLOAD_FIRMWARE=1 ; requires FT_NTP=1
88
-D FT_SLEEP=0
9-
; -D FT_BATTERY=0 ; 🌙 defined in specific firmwares
9+
-D FT_BATTERY=1
1010
-D FT_ANALYTICS=1
1111
-D FT_COREDUMP=1
1212
-D FT_ETHERNET=1

firmware/esp32-d0.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ build_flags = ${esp32-d0-base.build_flags}
2828
-D LOLIN_WIFI_FIX ; some boards have wifi issues if this is not defined, this sets WIFI_POWER_8_5dBm
2929
; -D LED_BUILTIN=2
3030
; -D KEY_BUILTIN=0
31-
; -D VOLTAGE_PIN=8 ; 🚧
32-
; -D CURRENT_PIN=9 ; 🚧
3331
lib_deps = ${esp32-d0-base.lib_deps}
3432
; RAM: [=== ] 26.2% (used 85980 bytes from 327680 bytes)
3533
; Flash: [======= ] 65.2% (used 2051394 bytes from 3145728 bytes)
@@ -66,8 +64,6 @@ build_flags = ${esp32-d0-base.build_flags}
6664
-mfix-esp32-psram-cache-issue
6765
; -D LED_BUILTIN=2
6866
; -D USE_M5UNIFIED=1 ;for MoonManEffect (but low on heap)
69-
-D VOLTAGE_PIN=8 ; 🚧
70-
-D CURRENT_PIN=9 ; 🚧
7167
lib_deps = ${esp32-d0-base.lib_deps}
7268
${livescripts.lib_deps}
7369
; m5stack/M5Unified ;for MoonManEffect (but low on heap)

firmware/esp32-p4.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ upload_speed = 921600
2828
build_flags = ${esp32-p4-base.build_flags}
2929
-Wl,-wrap,esp_dma_capable_malloc ;; makes SDIO for ESP-Hosted use PSRAM if available.
3030
; -D FT_ETHERNET=1 ; 🚧 not implemented yet
31-
-D LED_PINS=\"2,3,4,5,6,20,21,22,23,26,27,32,33,36,47,48\" ; 🚧 Troy default showed in IO but not used in PIN allocations yet: set them in layout
3231

3332
lib_deps = ${esp32-p4-base.lib_deps}
3433
; RAM: [= ] 11.2% (used 36580 bytes from 327680 bytes)

firmware/esp32-s3.ini

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ board_build.extra_flags =
3232
build_flags = ${esp32-s3-base.build_flags}
3333
-D USE_M5UNIFIED=1
3434
-D USE_M5UNIFIEDDisplay=1
35-
-D LED_PINS=\"5,6,7,8\" ; 🚧
3635
lib_deps = ${esp32-s3-base.lib_deps}
3736
m5stack/M5Unified
3837

@@ -63,20 +62,6 @@ lib_deps = ${esp32-s3-base.lib_deps}
6362
; RAM: [== ] 23.0% (used 75432 bytes from 327680 bytes)
6463
; Flash: [======= ] 67.8% (used 2266678 bytes from 3342336 bytes)
6564

66-
[env:esp32-s3-stephanelec-16p]
67-
board = esp32-s3-devkitc-1 ; https://github.com/platformio/platform-espressif32/blob/develop/boards/esp32-s3-devkitc-1.json
68-
board_build.arduino.memory_type = qio_opi
69-
board_build.psram_type = opi
70-
board_build.extra_flags =
71-
-DBUILD_TARGET_ESP32_S3_STEPHANELEC_16P
72-
-DBOARD_HAS_PSRAM
73-
-D FT_BATTERY=1 ; battery feature
74-
-D VOLTAGE_PIN=8
75-
-D CURRENT_PIN=9
76-
-D LED_PINS=\"47,48,21,38,14,39,13,40,12,41,11,42,10,2,3,1\" ; 🚧
77-
build_flags = ${esp32-s3-base.build_flags}
78-
lib_deps = ${esp32-s3-base.lib_deps}
79-
8065

8166
[env:esp32-s3-devkitc-1-n16r8v]
8267
; board = esp32-s3-devkitc-1-n16r8v ;found in boards folder
@@ -92,10 +77,6 @@ board_build.extra_flags =
9277
-DBOARD_HAS_PSRAM
9378
build_flags = ${esp32-s3-base.build_flags}
9479
-D LOLIN_WIFI_FIX ; some boards have wifi issues if this is not defined, this sets WIFI_POWER_8_5dBm
95-
-D FT_BATTERY=1 ; battery feature
96-
-D VOLTAGE_PIN=8 ; 🚧
97-
-D CURRENT_PIN=9 ; 🚧
98-
-D LED_PINS=\"47,48,21,38,14,39,13,40,12,41,11,42,10,2,3,1\" ; 🚧
9980
; -D FT_ETHERNET=1 ; 🚧 not implemented yet
10081
; -D USE_M5UNIFIED=1 ;for MoonManEffect (but low on heap) crashes on this board
10182
lib_deps = ${esp32-s3-base.lib_deps}

interface/src/lib/components/moonbase/EditObject.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import Cancel from '~icons/tabler/x';
77
88
import MultiInput from '$lib/components/moonbase/MultiInput.svelte';
9-
import ObjectArray from '$lib/components/moonbase/ObjectArray.svelte';
9+
import MultiRow from '$src/lib/components/moonbase/MultiRow.svelte';
1010
1111
interface Props {
1212
property: any;
@@ -51,13 +51,13 @@
5151
{#each property.n as propertyN}
5252
{#if propertyN.type == 'array'}
5353
<label for={propertyN.name}>{propertyN.name}</label>
54-
<ObjectArray
54+
<MultiRow
5555
property={propertyN}
5656
bind:data={dataEditable}
5757
definition={localDefinition}
5858
{onChange}
5959
{changeOnInput}
60-
></ObjectArray>
60+
></MultiRow>
6161
{:else if propertyN.type == 'controls'}
6262
{#each dataEditable[propertyN.name] as control}
6363
<!-- e.g. dE["controls"] -> {"name":"xFrequency","type":"slider","default":64,"p":1070417419,"value":64} -->

0 commit comments

Comments
 (0)