Clearing mediaPresets Capability

How do you clear the mediaPresets capability? I am adding presets to a device, but once they are all removed, I need to clear the list back to its initial empty state. I have tried emitting nil as well as {}. Any ideas?


Hi, @blueyetisoftware!

The capability is configured to require id and name in every event of the capability:

"attributes": {
    "presets": {
        "schema": {
            "type": "object",
            "properties": {
                "value": {
                    "type": "array",
                    "items": {
                        "title": "MediaPreset",
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "id": {...},
                            "name": {...},
                            "mediaSource": {...},
                            "imageUrl": {...}
                        "required": [ //***HERE***//

That’s why sending an empty array doesn’t change the status of the “presets” attribute, instead, you can use the following command:


I tested it and sending that event disables the usage of the widget until it gets new data:

1 Like

Perfect. Thank you very much

1 Like