Azure / azure-iot-explorer

Cross-platform UI for interacting with devices attached to Azure IoT Hub. This tool is meant for learning and testing, not for production environment.
MIT License
223 stars 73 forks source link

[BUG] Cant enable boolean option in Command Payload #640

Open oedze opened 1 year ago

oedze commented 1 year ago

Describe the bug We have a DTMI model that defines a command with a object payload, This object payload has 2 booleans. When i load them into the IoT Explorer, i can't enable any of the two booleans

DTMI:

{
    "@id": "dtmi:mycompany:components:upload;1",
    "@type": "Interface",
    "contents": [
        {
            "@id": "dtmi:mycompany:components:upload:format;1",
            "@type": "Command",
            "displayName": {
                "en": "Format"
            },
            "name": "format",
            "request": {
                "@type": [
                    "CommandPayload",
                    "Initialized"
                ],
                "displayName": {
                    "en": "Format"
                },
                "name": "format",
                "initialValue": {
                    "fat": false,
                    "lfs": false
                },
                "schema": {
                    "@type": "Object",
                    "displayName": {
                        "en": "Object"
                    },
                    "fields": [
                        {
                            "displayName": {
                                "en": "FAT"
                            },
                            "name": "fat",
                            "schema": "boolean"
                        },
                        {
                            "displayName": {
                                "en": "LFS"
                            },
                            "name": "lfs",
                            "schema": "boolean"
                        }
                    ]
                }
            }
        }
    ],
    "displayName": {
        "en": "UploadComponent"
    },
    "@context": [
        "dtmi:iotcentral:context;2",
        "dtmi:dtdl:context;2"
    ]
}

How it looks in the IoT Explorer

image

When i click on the checkbox, they don't activate, making it impossible to use.

To Reproduce Steps to reproduce the behavior:

  1. Create a device that has this component
  2. Load the DTMI model for this device
  3. Go to the commands tab for this component
  4. Click on the checkboxes.

Expected behavior When i click the button, i expect a checkmark to appear

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Setting the default value to true also doesn't work, they don't activate. It's not a pure visual glitch, becaus when i send the command to the device, the values are false.