Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Schema JSON Capabilities - Form Definition Defaults in Schema (Radio Buttons via x-schema-form) #96

Open
mkormendy opened this issue Jul 20, 2021 · 0 comments

Comments

@mkormendy
Copy link

As a user, I am noticing a number of features that are not in parity with the native Homebridge implementation of the config.schema.json for the form based configuration user interface.

This issue deals with the ability to use the x-schema-form property to implement one-off form alterations instead of having to define an entire form definition for all items of a schema (which is cumbersome). In my case, I wanted to display radio buttons for one field yet not have to define form definition for the entire schema. I performed this with the following block of code:

"trigger": {
  "title": "Force Trigger State (optional)",
  "type": "string",
  "enum": [
    "high",
    "low"
  ],
  "x-schema-form": {
    "type": "radios",
    "titleMap": [{
        "value": "high",
        "name": "High (unselected default)"
      },
      {
        "value": "low",
        "name": "Low"
      }
    ]
  }
},

This produces the expected output here in Homebridge:

Screen Shot 2021-07-20 at 12 13 06 AM

However in HOOBS it produces this:

Screen Shot 2021-07-20 at 12 13 37 AM

Again, this isn't a showstopper but it was actually nicer to see the options up-front without having to expand the select field to access what is available (and possibly select an option by accident because there is an intermittent bug with that select control that selects the first item after, when you blur out of focus on the control).

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

No branches or pull requests

1 participant