Skip to content

Update magic_schema.json to have complete visualization object#208

Merged
lorennorman merged 3 commits intomainfrom
viz-complete-options
Aug 11, 2025
Merged

Update magic_schema.json to have complete visualization object#208
lorennorman merged 3 commits intomainfrom
viz-complete-options

Conversation

@tyeth
Copy link
Member

@tyeth tyeth commented Aug 11, 2025

Updates magic board schema to include full visualisation object from components repo.

https://github.com/adafruit/Wippersnapper_Components/blob/1f7823e15ee49acffb15aab2cc947ea7d1ad6619/components/pin/schema.json#L84-L111

  "visualization": {
      "description": "Specifies which visual component to use in the WipperSnapper interface and how to configure it",
      "type": "object",
      "discriminator": { "propertyName": "type" },
      "required": ["type"],
      "oneOf": [{
        "properties": {
          "type": { "const": "switch" },
          "offLabel": { "type": "string" },
          "offIcon": { "type": "string" },
          "onLabel": { "type": "string" },
          "onIcon": { "type": "string" }
        },
        "additionalProperties": false
      }, {
        "properties": {
          "type": { "const": "button" },
          "pressedLabel": { "type": "string" },
          "unpressedLabel": { "type": "string" }
        },
        "additionalProperties": false
      }, {
        "properties": {
          "type": { "const": "slider" }
        },
        "additionalProperties": false
      }]
    }

Slightly concerned that the exported did not include the visualisation.type which is in theory mandatory. The magic config import also worked fine without it.

"visualization": {
"offLabel": "Enabled",
"onLabel": "Disabled",
"offIcon": "fa6:regular:plug-circle-bolt",
"onIcon": "fa6:solid:plug-circle-xmark"

@tyeth tyeth requested a review from lorennorman August 11, 2025 17:38
@tyeth
Copy link
Member Author

tyeth commented Aug 11, 2025

After discussion I now see that type is not required for magic config, but is for component repo.

@lorennorman lorennorman merged commit 843fe86 into main Aug 11, 2025
7 checks passed
@lorennorman lorennorman deleted the viz-complete-options branch August 11, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants