Custom Capability and CLI Developer Preview

@erickv there appears to be a bug with rendering a custom toggleSwitch as the dashboard on the iOS ST app, it not only doesn’t render it also prevents the detailView from opening. I’ve provided a sample to Jody.

Can you please clarify the correct usage for list in a detailView, the documentation appears to be conflicting as I had pointed out earlier.

Here is an example which renders on the detailView page but

  1. It does not display the specified values (from “value” as I understand the docs) in the list, so it should show “Mode 1” and “Mode 2”, instead it shows “mode1” and “mode2” on the screen list.
  2. It doesn’t call the specified custom method (setMode) with the arguments (as defined in the JSON key and as per the current documentation), instead the app throws an error when you select an option from the list.
  3. It doesn’t use the values from the attribute mentioned in supportedValues (in this case the DTH initializes the supportedCustomModes attribute value to contain ["mode1"], but the UI still shows both values (mode1 and mode2) in the drop down list.
"detailView": [
        {
            "label": "Custom Mode",
            "displayType": "list",
            "list": {
                "command": {
                    "name": "setMode",
                    "alternatives": [
                        {
                            "key": "mode1",
                            "value": "Mode 1"
                        },
                        {
                            "key": "mode2",
                            "value": "Mode 2"
                        }
                    ],
                    "supportedValues": "supportedCustomModes.value"
                },
                "state": {
                    "value": "customMode.value",
                    "alternatives": [
                        {
                            "key": "mode1",
                            "value": "Mode 1",
                            "type": "inactive"
                        },
                        {
                            "key": "mode2",
                            "value": "Mode 2",
                            "type": "active"
                        }
                    ]
                }
            }
        }
    ]