From aaa58258743f8f626ab72b1a3603aba9a5786374 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 20:59:15 -0600 Subject: [PATCH 01/12] Adding in schema for the json configs --- src/config/generic_gundam.json | 3 ++ src/config/gundam_led_config.schema.json | 37 ++++++++++++++++++++++++ src/config/nu_gundam.json | 1 + src/config/unicorn_banshee.json | 1 + 4 files changed, 42 insertions(+) create mode 100644 src/config/gundam_led_config.schema.json diff --git a/src/config/generic_gundam.json b/src/config/generic_gundam.json index 43ec352..623f474 100644 --- a/src/config/generic_gundam.json +++ b/src/config/generic_gundam.json @@ -1,4 +1,5 @@ { + "$schema": "gundam_led_config.schema.json", "name": "gunpla", "leds": [ {"name": "head", "pin": 0, "color": "green"}, @@ -11,5 +12,7 @@ {"name": "weapon2", "pin": 7, "color": "red"}, {"name": "weapon2_camera", "pin": 8, "color": "green"}, {"name": "vernier", "pin": 10, "color": "blue"} + ], + "lightshow": [ ] } \ No newline at end of file diff --git a/src/config/gundam_led_config.schema.json b/src/config/gundam_led_config.schema.json new file mode 100644 index 0000000..8ea829b --- /dev/null +++ b/src/config/gundam_led_config.schema.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "GundamLEDConfig", + "type": "object", + "required": ["name", "leds", "lightshow"], + "properties": { + "name": { + "type": "string", + "description": "The model name of the Gundam unit." + }, + "leds": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "pin", "color"], + "properties": { + "name": { "type": "string" }, + "pin": { "type": "integer", "minimum": 0, "maximum": 21 }, + "color": { "type": "string" }, + "disabled": { "type": "boolean", "default": false } + } + } + }, + "lightshow": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "path", "method"], + "properties": { + "name": { "type": "string" }, + "path": { "type": "string" }, + "method": { "type": "string" } + } + } + } + } +} \ No newline at end of file diff --git a/src/config/nu_gundam.json b/src/config/nu_gundam.json index 44b6b4d..aa59f8b 100644 --- a/src/config/nu_gundam.json +++ b/src/config/nu_gundam.json @@ -1,4 +1,5 @@ { + "$schema": "gundam_led_config.schema.json", "name": "RX-93 Nu Gundam", "leds": [ { diff --git a/src/config/unicorn_banshee.json b/src/config/unicorn_banshee.json index d1a675c..92fa79e 100644 --- a/src/config/unicorn_banshee.json +++ b/src/config/unicorn_banshee.json @@ -1,4 +1,5 @@ { + "$schema": "gundam_led_config.schema.json", "name": "RX-0 Unicorn Banshee", "leds": [ { From 7693a949a092fe72a684b5fd28e118ceace18817 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:03:04 -0600 Subject: [PATCH 02/12] adding in ci step --- .github/workflows/lint.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 5dd0e34..684573c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -19,4 +19,13 @@ jobs: uses: docker://avtodev/markdown-lint:v1 with: args: '**/*.md' - config: .markdownlint.yaml \ No newline at end of file + config: .markdownlint.yaml + validate-json: + name: Validate configuration files + runs-on: ubuntu-latest + steps: + - name: Validate gunpla configs + uses: dsanders11/json-schema-validate-action@v1.4.0 + with: + schema: ./src/config/gundam_led_config.schema.json + files: ./src/config/*.json From bd7b66dbe218c44caa284f1e6d7f3239a98e85bb Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:09:20 -0600 Subject: [PATCH 03/12] removing ./ --- .github/workflows/lint.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 684573c..533809c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -27,5 +27,5 @@ jobs: - name: Validate gunpla configs uses: dsanders11/json-schema-validate-action@v1.4.0 with: - schema: ./src/config/gundam_led_config.schema.json - files: ./src/config/*.json + schema: src/config/gundam_led_config.schema.json + files: src/config/*.json From 6773efb2eb48398e241e779389f085191e3b04cb Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:12:34 -0600 Subject: [PATCH 04/12] different tool --- .github/workflows/lint.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 533809c..b934b10 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -25,7 +25,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Validate gunpla configs - uses: dsanders11/json-schema-validate-action@v1.4.0 + uses: cardinalby/schema-validator-action@v3 with: - schema: src/config/gundam_led_config.schema.json - files: src/config/*.json + file: 'src/config/*.json' From 4973fff65fd325a3abc45eeb7f9590324afc1529 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:13:45 -0600 Subject: [PATCH 05/12] different tool --- .github/workflows/lint.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b934b10..1024db2 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -24,6 +24,9 @@ jobs: name: Validate configuration files runs-on: ubuntu-latest steps: + - name: Check out code + uses: actions/checkout@v2 + - name: Validate gunpla configs uses: cardinalby/schema-validator-action@v3 with: From 57e66d9e661a1d77389f7bebcc805c696f983668 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:17:28 -0600 Subject: [PATCH 06/12] adjust paths --- ...ndam_led_config.schema.json => gundam_led_config.schema.json | 0 src/config/generic_gundam.json | 2 +- src/config/nu_gundam.json | 2 +- src/config/unicorn_banshee.json | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) rename src/config/gundam_led_config.schema.json => gundam_led_config.schema.json (100%) diff --git a/src/config/gundam_led_config.schema.json b/gundam_led_config.schema.json similarity index 100% rename from src/config/gundam_led_config.schema.json rename to gundam_led_config.schema.json diff --git a/src/config/generic_gundam.json b/src/config/generic_gundam.json index 623f474..a7d9b18 100644 --- a/src/config/generic_gundam.json +++ b/src/config/generic_gundam.json @@ -1,5 +1,5 @@ { - "$schema": "gundam_led_config.schema.json", + "$schema": "../../gundam_led_config.schema.json", "name": "gunpla", "leds": [ {"name": "head", "pin": 0, "color": "green"}, diff --git a/src/config/nu_gundam.json b/src/config/nu_gundam.json index aa59f8b..030c347 100644 --- a/src/config/nu_gundam.json +++ b/src/config/nu_gundam.json @@ -1,5 +1,5 @@ { - "$schema": "gundam_led_config.schema.json", + "$schema": "../../gundam_led_config.schema.json", "name": "RX-93 Nu Gundam", "leds": [ { diff --git a/src/config/unicorn_banshee.json b/src/config/unicorn_banshee.json index 92fa79e..fb46a64 100644 --- a/src/config/unicorn_banshee.json +++ b/src/config/unicorn_banshee.json @@ -1,5 +1,5 @@ { - "$schema": "gundam_led_config.schema.json", + "$schema": "../../gundam_led_config.schema.json", "name": "RX-0 Unicorn Banshee", "leds": [ { From b794d723662234f4ea2802a676e1af08c6e01806 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:02:18 -0600 Subject: [PATCH 07/12] at this point i'm just hoping --- .github/workflows/lint.yaml | 1 + src/config/generic_gundam.json | 3 ++- .../config/gundam_led_config.schema.json | 0 src/config/nu_gundam.json | 2 +- src/config/unicorn_banshee.json | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) rename gundam_led_config.schema.json => src/config/gundam_led_config.schema.json (100%) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1024db2..953de99 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -31,3 +31,4 @@ jobs: uses: cardinalby/schema-validator-action@v3 with: file: 'src/config/*.json' + schema: 'src/config/gundam_led_config.schema.json' diff --git a/src/config/generic_gundam.json b/src/config/generic_gundam.json index a7d9b18..d986f02 100644 --- a/src/config/generic_gundam.json +++ b/src/config/generic_gundam.json @@ -1,5 +1,6 @@ { - "$schema": "../../gundam_led_config.schema.json", + "$schema": "gundam_led_config.schema.json", + "name": "gunpla", "leds": [ {"name": "head", "pin": 0, "color": "green"}, diff --git a/gundam_led_config.schema.json b/src/config/gundam_led_config.schema.json similarity index 100% rename from gundam_led_config.schema.json rename to src/config/gundam_led_config.schema.json diff --git a/src/config/nu_gundam.json b/src/config/nu_gundam.json index 030c347..aa59f8b 100644 --- a/src/config/nu_gundam.json +++ b/src/config/nu_gundam.json @@ -1,5 +1,5 @@ { - "$schema": "../../gundam_led_config.schema.json", + "$schema": "gundam_led_config.schema.json", "name": "RX-93 Nu Gundam", "leds": [ { diff --git a/src/config/unicorn_banshee.json b/src/config/unicorn_banshee.json index fb46a64..92fa79e 100644 --- a/src/config/unicorn_banshee.json +++ b/src/config/unicorn_banshee.json @@ -1,5 +1,5 @@ { - "$schema": "../../gundam_led_config.schema.json", + "$schema": "gundam_led_config.schema.json", "name": "RX-0 Unicorn Banshee", "leds": [ { From b8dfafe8f77012c05b4cf6aa9dc2cb7c6b60240b Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:07:17 -0600 Subject: [PATCH 08/12] adjusting the max pin count --- src/config/gundam_led_config.schema.json | 4 ++-- src/config/unicorn_banshee.json | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/config/gundam_led_config.schema.json b/src/config/gundam_led_config.schema.json index 8ea829b..88467a1 100644 --- a/src/config/gundam_led_config.schema.json +++ b/src/config/gundam_led_config.schema.json @@ -12,10 +12,10 @@ "type": "array", "items": { "type": "object", - "required": ["name", "pin", "color"], + "required": ["name", "pin"], "properties": { "name": { "type": "string" }, - "pin": { "type": "integer", "minimum": 0, "maximum": 21 }, + "pin": { "type": "integer", "minimum": 0, "maximum": 22 }, "color": { "type": "string" }, "disabled": { "type": "boolean", "default": false } } diff --git a/src/config/unicorn_banshee.json b/src/config/unicorn_banshee.json index 92fa79e..b4e17d3 100644 --- a/src/config/unicorn_banshee.json +++ b/src/config/unicorn_banshee.json @@ -68,11 +68,6 @@ "pin": 6, "color": "orange" }, - { - "name": "l_weapon", - "pin": 22, - "color": "orange" - }, { "name": "head", "pin": 7, @@ -80,7 +75,7 @@ }, { "name": "head_camera", - "pin": 23, + "pin": 22, "color": "green" } ], From 5073bb51f2e8888385afcad77397ccccdf2aa434 Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:08:22 -0600 Subject: [PATCH 09/12] oh fake things --- src/config/nu_gundam.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/config/nu_gundam.json b/src/config/nu_gundam.json index aa59f8b..8b8093d 100644 --- a/src/config/nu_gundam.json +++ b/src/config/nu_gundam.json @@ -42,12 +42,6 @@ "name": "fin_funnel_6", "pin": 7, "color": "white" - }, - { - "name": "fakething", - "pin": 45, - "color": "white", - "disabled": true } ], "lightshow": [ From c7d352516681981bbefb5b58f32916389ce5e13c Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:10:23 -0600 Subject: [PATCH 10/12] excluding the schema --- .github/workflows/lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 953de99..0b06b4c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -32,3 +32,4 @@ jobs: with: file: 'src/config/*.json' schema: 'src/config/gundam_led_config.schema.json' + exclude: 'src/config/gundam_led_config.schema.json' From e2edb8191d8c6deeb44288f60bf4c5b378171c4d Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:12:31 -0600 Subject: [PATCH 11/12] i think i already tried this --- .github/workflows/lint.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 0b06b4c..6ca0e29 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -31,5 +31,4 @@ jobs: uses: cardinalby/schema-validator-action@v3 with: file: 'src/config/*.json' - schema: 'src/config/gundam_led_config.schema.json' - exclude: 'src/config/gundam_led_config.schema.json' +# schema: 'src/config/gundam_led_config.schema.json' From 9eca115732ecc1b7a06c0640ee9d0ffc5daab23b Mon Sep 17 00:00:00 2001 From: frozenwizard <172203+frozenwizard@users.noreply.github.com> Date: Mon, 29 Dec 2025 22:19:40 -0600 Subject: [PATCH 12/12] move it back to root dir --- ...gundam_led_config.schema.json => gundam_led_config.schema.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/config/gundam_led_config.schema.json => gundam_led_config.schema.json (100%) diff --git a/src/config/gundam_led_config.schema.json b/gundam_led_config.schema.json similarity index 100% rename from src/config/gundam_led_config.schema.json rename to gundam_led_config.schema.json