quad.select
Select: lets you select a specific value (e.g. scene, etc.)
Parameters
{{ quad.select(id, item_select, type, value, pic, text, color_on, itemvals, itemtxts, indicator, linetext, columntext, item_uzsu, uzsu_attribs, item_plot, icon_plot, item_auto, extpopup, locks, item_slider, place3, place4, column_order) }}
id
unique id for this widget (optional)
item_select
an (array of) item(s)
type
type: 'menu', 'micro', 'mini', 'midi', 'icon' (optional, default: menu). The type parameter defines the number of columns in the widget.
value
list of values (optional, default [0,1])
pic
list of icons for every button (optional) - not supported for type 'menu'
text
list of texts for every menu entry or button (optional)
color_on
the color for the on state of the buttons, e.g. 'icon0'through'icon5' or '#f00' or 'red' (optional, default: icon1) - not supported for type 'menu'
itemvals
an item containing all selectable values (optional) - overrides existing value definitions, available for menu type only
itemtxts
an item containing the texts corresponding to the selectable values (optional even if itemvals is specified), available for menu type only
indicator
activity indicator which is active until response (or a timeout is reached); pass either a color, icon class, 'blink' or 'simulate'. Timeout is 3s by default and can be set globally using the configuration key "indicator_duration". Add a colon and integer number to specify an individual timeout, e.g. 'blink:15' (optional)
You can also set an indicator icon, text and color by passing these as additional parameters in the icon, text and color arrays. Just provide one icon more than you have values to switch. A dynamic icon can be used also along with the 'simulate' option.
The indicator options will not be applied to the select element of type 'menu' which will convert all options to 'blink'.
linetext
text for the whole line (optional)
columntext
(array with) text for each column (optional)
item_uzsu
a gad/item for UZSU
uzsu_attribs
Array with standard UZSU parameters: pic_on, pic_off, valueType, valueParameterList, color_on, color_off. (optional)
Normally the array must have the same dimension as the "type" parameter, e.g. "[['', '', 'num'], '', ['', '', 'bool']]" for a table of 3 columns.
Exception: if the parameter "item_uzsu" is a singe item in string format a new column with sn uzsu icon is displayed behind the main column block.
item_plot
array with all plot.period attributes to show a plot in popup. Alternatively just the item to be plotted.
Normally the array must have the same dimension as the "type" parameter, e.g. "[['plotitem1', 'avg', '2d','now'], 'plotitem2', '']" for a table of 3 columns.
Exception: a plot parameter array with exactly 17 entries causes a new column with a plot icon to be displayed behind the main column block. Example: "['plotitem1', 'avg', '2d','now', '','','','','','','','','','','','','temp']
icon_plot
icon triggering the plot popup
item_auto
"root item" which holds stateengine information. show current state of stateengine/stateengine item. Adjust icons and states below accordingly
extpopup
Array of arrays for extended popup window. Use this to create an icon to open a popup with switches, sliders, flips or select menues.
First entry can either be "stateengine" to make the stateengine plugin icon the trigger for the popup or an icon (e.g. time_automatic).
After that you have to create an array for each line of the popup. In this array you first define the elements like switch, text, etc.,
followed by the attributes for each element as you would for the basic widget.
Possible elements are: header, text, slider, flip, switch, select
Example: ['stateengine', ['header', 'Suspendzeit'], [['switch', 'slider'], [switch_item, 'icon', [0,1], ['secur_open','secur_locked']],
[slider_item, slider_min, slider_max, slider_step, '', 'handle']]
locks
array with items for locking. You have to be aware of the order: item_lock, item_bwmlock (presence sensor), item_force (force on/off/neutral)
item_slider
additional item for changing value (e.g. timer). A slider popup will be shown
You can provide additional attributes as an array: item, min, max, step, format, value_display (handle, etc.)
place3
placeholder attributes for future features, etc.
place4
placeholder attributes for future features, etc.
column_order
array with element description: Reorder elements to your liking (esp. relevant for smartphones as several columns might be too much)
possible elements are: 'select', 'stateengine', 'uzsu', 'plot', 'locks', 'extpopup'
For empty columns either use ' ' or a number to define the column width (e.g. '40' = 40 pixels width)
Combine elements in one column by putting them in arrays. Standard is ['locks', 'select', 'stateengine', 'plot', 'uzsu']
Be aware that this only works with lines containing one switch only! For multiple switches leave column_order empty and rely on the defaults.
Example
Multiple Select
{{ quad.select('select1', ['this', 'that'], ['menu', 'menu'], [[0,3],[4,5]], [['edit_numeric_0.svg','edit_numeric_3.svg'],['edit_numeric_4.svg','edit_numeric_5.svg']], [['0','3'],['4','5']], ['',''], ['',''], '', '', 'Select as menu', ['Select1', 'Select2'], ['this.uzsu','that.uzsu'], ['', ''], ['plotitem1', 'plotitem2']) }}
Single select Item [['uzsu','select'], '10', ['plot','stateengine', 'extpopup'], '10', 'locks']
{{ quad.select('select2', 'this', 'icon', [0,1,2,3], ['edit_numeric_0.svg','edit_numeric_1.svg','edit_numeric_2.svg','edit_numeric_3.svg'], ['','','',''], '', 'horizontal', '', '', 'Select as horizontal group', '', 'this.uzsu', '', 'plotitem', 'measure_power_meter.svg', 'this.automatik', (extpopup['extra']), ['this.sperren'], 'this.slider', '', '', [['uzsu','select'], '10', ['plot','stateengine', 'extpopup'], '10', 'locks']) }}
Single select item
{{ quad.select('select3', 'this', 'icon', [0,1,2,3,4], ['edit_numeric_0.svg','edit_numeric_1.svg','edit_numeric_2.svg','edit_numeric_3.svg','edit_numeric_4.svg'], ['','','','',''], '', '', '', '', 'Select as none group', '', 'this.uzsu', '', 'plotitem', 'measure_power_meter.svg', 'this.automatik', '', ['this.sperren'], ['dies.timer', 0, 10, 1, 'min', 'handle'], '', '', ['select', 'plot', 'uzsu']) }}
Single select item without column order
{{ quad.select('select4', 'this', 'mini', [0,1,2,3,4], '', ['0','1','2','3','4'], '', 'horizontal', '', '', 'Select standard columns', '', 'this.uzsu', '', 'plotitem', 'measure_power_meter.svg', 'this.automatik', '') }}
Author: Niko Will, Onkel Andy