Bug in Maker API output

When querying full details on a device or devices, some commands (mostly on/off) are duplicated in the output. I think this is due to some devices having multiple device capabilities that expose on/off commands.

Would it be possible to have the Maker API app filter these out as the Device details page does?

{
    "name": "hueBridgeBulb",
    "label": "Carport Light 1",
    "type": "hueBridgeBulb",
    "id": "8",
    "date": "2019-03-28T12:00:01+0000",
    "model": null,
    "manufacturer": null,
    "capabilities": [
        "Switch",
        "SwitchLevel",
        "Refresh",
        "Actuator",
        "Light",
        "ChangeLevel"
    ],
    "attributes": {
        "level": "25",
        "dataType": "ENUM",
        "values": [
            "on",
            "off"
        ],
        "switch": "off"
    },
    "commands": [
    {
        "command": "off"
    },
    {
        "command": "off"
    },
    {
        "command": "on"
    },
    {
        "command": "on"
    },
    {
        "command": "refresh"
    },
    {
        "command": "setLevel"
    },
    {
        "command": "startLevelChange"
    },
    {
        "command": "stopLevelChange"
    }
    ]
}

I've noticed this as well but I wasn't sure if it was a "bug" or something else. It will be interesting to hear from Hubitat on this though.

It's not really a bug IMO, just returning the list of attributes from capabilities. It's more of a feature request to dedup the list server side vs doing it client side.

It's added to the list.

1 Like

Makes sense that it's just duplication from the capabilities. I'm dealing with it on client side so I'm not concerned.

1 Like