Homey Community Forum

Changing enum values in custom picker capability

Hi,
I would like to change or set the values in an enum custom capability that uses the picker ui.

{
    "type": "enum",
    "title": {
        "en": "Assigned current",
        "sv": "Tilldelad ström"
    },
    "values": [
        {
            "id": "off",
            "title": {
                "en": "Off",
                "sv": "Av"
            }
        },
        {
            "id": "1",
            "title": {
                "en": "1 A"
            }
        },
        ...
        {
            "id": "16",
            "title": {
                "en": "16 A"
            }
        }
    ],
    "getable": true,
    "setable": true,
    "uiComponent": "picker"
}

This capability is super simple and rather than having multiple ones where the only difference is the values. During pairing I would like to get the range of values from the device, and populate the values in the capability since there are different ranges depending on the predefined settings in the device.

Name and number of ports are fetched during pairing via MQTT so I would like to do the same with this but can’t seem to change the enum values in any way.

In onAdded() I have tried this.setCapabilityOptions('assign_current', { values }); but “values” in capability options is just ignored.