Code: Select all
<Field id="analog0" type="menu" defaultValue="sensor-0">
<Label>Input 0:</Label>
<List>
<List class="self" method="phidgetSensorsList" />
</List>
</Field>Code: Select all
def phidgetSensorsList(self, filter="", ValuesDict="None", typeId="", targetId=0):
csvfile = open('/Users/rdp/phidgets-sensors.txt')
sensorOptions = [ row.strip().split(',') for row in csvfile]
return (sensorOptions)Error (client) runDialogForDevice() caught exception: Dynamic <List> elements must contain a class attribute. -- filter with no class: (null)
The list I am passing in looks like:
Code: Select all
[['sensor-0', ' -- None --'], ['sensor-1', '1101 - IR Distance Adapter'], ['sensor-2', '1102 - IR Reflective Sensor 5mm'], ['sensor-3', '1103 - IR Reflective Sensor 10cm'], ['sensor-4', '1104 - Vibration Sensor'], ['sensor-5', '1105 - Light Sensor'], ['sensor-6', '1106 - Force Sensor'], ['sensor-7', '1107 - Humidity Sensor'], ['sensor-8', '1108 - Magnetic Sensor'], ['sensor-9', '1109 - Rotation Sensor'], ['sensor-10', '1110 - Touch Sensor'], ['sensor-11', '1111 - Motion Sensor'], ['sensor-12', '1112 - Slider 60'], ['sensor-13', '1113 - Mini Joy Stick Sensor'], ['sensor-14', '1114 - Temperature Sensor'], ['sensor-15', '1115 - Pressure Sensor'], ['sensor-16', '1116 - Multi-turn Rotation Sensor'], ['sensor-17', '1117 - Voltage Sensor'], ['sensor-18', '1118 - 50Amp Current Sensor AC+DC'], ['sensor-19', '1119 - 20Amp Current Sensor AC+DC'], ['sensor-20', '1120 - FlexiForce Adapter'], ['sensor-21', '1121 - Voltage Divider'], ['sensor-22', '1122 - 30 Amp Current Sensor AC+DC'], ['sensor-23', '1123 - Precision Voltage Sensor'], ['sensor-24', '1124 - Precision Temperature Sensor'], ['sensor-25', '1125 - Humidity/Temperature Sensor'], ['sensor-26', '1126 - Differential Gas Pressure Sensor'], ['sensor-27', '1127 - Precision Light Sensor'], ['sensor-28', '1128 - MaxBotix EZ-1 Sonar Sensor'], ['sensor-29', '1129 - Touch Sensor'], ['sensor-30', '1130 - pH/ORP Adapter'], ['sensor-31', '1131 - Thin Force Sensor'], ['sensor-32', '1132 - 4-20mA Adapter'], ['sensor-33', '1133 - Sound Sensor'], ['sensor-34', '1134 - Switchable Voltage Divider'], ['sensor-35', '1135 - Precision Voltage Sensor']]I know I am doing something wrong, but, for the life of me, I cannot figure out what.
