Skip to content

Device select

Example#

preview

Code-example#

<measmatic-card highlight-header>
  <measmatic-device-select data-id="control1Id1" filter="ClAsS1" icon="device" label="Switch"></measmatic-device-select>
  <measmatic-device-select data-id="control1Id2" filter="ClAsS1" label="Switch"></measmatic-device-select>
  <measmatic-device-select data-id="control1Id3" filter="ClAsS1" icon="device-alternative"></measmatic-device-select>
  <measmatic-device-select data-id="control1Id4"></measmatic-device-select>
</measmatic-card>

Description#

This custom-element creates a control to select devices which were set in the Device Manager under Test site configuration.

Usage#

Attributes#

Necessary#

<measmatic-device-select data-id='control1Id'>
Measmatic needs an data-id in this element to initialize the control properly.

Optional#

<measmatic-device-select data-id='control1Id' filter='Switch'>
By adding the attribute filter='Switch' you can filter the selectable devices.

<measmatic-device-select data-id='control1Id' label='Switch'>
To edit the text next to the selection you can add label='Switches'.

<measmatic-device-select data-id='control1Id' icon='world'>
You can choose an icon from the directory "Measmatic/data/TestIcons/".

Properties of interest

  • device gets name of the selected device
  • guid gets guid of the selected device
  • deviceObject gets/sets Object containing name and guid of selected device