/**
* -----------------------------------------------------------------------------
* @package smartVISU
* @author Martin Gleiß
* @copyright 2012 - 2015
* @license GPL [http://www.gnu.de]
* -----------------------------------------------------------------------------
*/
{% extends "widget_basic.html" %}
{% block example %}
Examples
Use this flip to control the basic.symbols
{{ basic.flip('', 'bath.light.switch') }}
Symbol is only shown when 'bath.light.switch' is on
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', 'bath.light.switch') }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', 'bath.light.switch') }}
With different picture and text, colorized, text-only, dynamic icon or used as link to open a popup
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg') }}
{{ basic.symbol('', 'bath.light.switch', '', '', '', '', '#0b0') }}
{{ basic.symbol('', 'bath.light.switch', 'On') }}
{{ basic.symbol('', 'bath.light.switch', '', icon.light('','','bath.light.value') ) }}
{{ basic.symbol('', 'bath.light.switch', 'Open popup', '', '', '', '', '#symbol_popup', 'popup') }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg') }}
{{ basic.symbol('', 'bath.light.switch', '', 'audio_sync.svg', '', '', '#0b0') }}
{{ basic.symbol('', 'bath.light.switch', 'On') }}
{{ basic.symbol('', 'bath.light.switch', '', icon.light('','','bath.light.value'), '', '', 'icon1','','','micro') }}
{{ basic.symbol('', 'bath.light.switch', 'Open popup', '', '', '', '', '#symbol_popup', 'popup') }}
With multiple states and min/max mode (use the buttons to select state)
First: {{ basic.select('', 'first.multistate', 'mini', [0, 1, 2, 3, 4], '', [0, 1, 2, 3, 4] ) }}
Second: {{ basic.select('', 'second.multistate', 'mini', [0, 1, 2, 3, 4], '', [0, 1, 2, 3, 4] ) }}
Standard Icon if both values are 0
Sound icon if at least one is <=1 and one > 0
no icon when one of the values is 2
lock icon if one of the value is >= 3
{% filter trim|escape|nl2br %}{% raw %}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', 'secur_locked', 3, 'min') }}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', ['', 'audio_sound'], [0,1], 'max') }}
{% endraw %}{% endfilter %}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', 'secur_locked', 3, 'min') }}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', ['', 'audio_sound'], [0,1], 'max') }}
No icon if both values are below 2, standard icon if one >=2
{% filter trim|escape|nl2br %}{% raw %}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', '', 2, 'min') }}
{% endraw %}{% endfilter %}
{{ basic.symbol('', ['first.multistate', 'second.multistate'], '', '', 2, 'min') }}
With multiple states (use the buttons to select state)
{{ basic.select('', 'bath.multistate', 'mini', [1, 2, 3], '', [1, 2, 3] ) }}
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', 'bath.multistate', '', 'message_led', [1,2,3], '', ['red','#EAFF00','green']) }}
{{ basic.symbol('', 'bath.multistate', ['low','medium','high'], '', [1,2,3], '', ['red','icon1','green']) }}
{{ basic.symbol('', 'bath.multistate', ['low','medium','high'], ['control_1','control_2','control_3'], [1,2,3]) }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', 'bath.multistate', '', 'message_led', [1,2,3], '', ['red','#EAFF00','green']) }}
{{ basic.symbol('', 'bath.multistate', ['low','medium','high'], '', [1,2,3], '', ['red','icon1','green']) }}
{{ basic.symbol('', 'bath.multistate', ['low','medium','high'], ['control_1','control_2','control_3'], [1,2,3]) }}
Combinations with 'or', 'and' or custom formula (this one implements XOR, so the text is shown if one and only one flip is set on).
Use both flips (one for 'bath.light.switch' and the other for 'bath.rtr.state') to control the symbols
bath.light.switch: {{ basic.flip('', 'bath.light.switch') }}
bath.rtr.state: {{ basic.flip('', 'bath.rtr.state') }}
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'OR') }}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'AND', '', 1, 'and') }}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'Custom XOR', '', '', '( VAR1 && !VAR2 ) || ( !VAR1 && VAR2 )') }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'OR') }}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'AND', '', '', 'and') }}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], 'Custom XOR', '', '', '( VAR1 && !VAR2 ) || ( !VAR1 && VAR2 )') }}
If you combine multiple items with or and on/off (1/0) states you have to put 1 as first value and 0 as sescond.
Explanation: By using or the first match of any item with a value will be evaluated. So if you set 0 in front, this condition will be met if any of the items has value 0. But most likely you want to show off state only if all values are 0.
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], '', '', [1,0], 'or', ['green','red']) }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', ['bath.light.switch', 'bath.rtr.state'], '', '', [1,0], 'or', ['green','red']) }}
Using threshold (use the slider to change value)
{{ basic.slider('', 'bath.light.value') }}
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', 'bath.light.value', '', 'message_led', [85,170], '>', ['red','#EAFF00','green']) }}
{{ basic.symbol('', 'bath.light.value', ['low','medium','high'], '', [85,170], '>', ['red','icon1','green']) }}
{{ basic.symbol('', 'bath.light.value', ['low','medium','high'], ['control_1','control_2','control_3'], [85,170], '>') }}
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', 'bath.light.value', '', 'message_led', [85,170], '>', ['red','#EAFF00','green']) }}
{{ basic.symbol('', 'bath.light.value', ['low','medium','high'], '', [85,170], '>', ['red','icon1','green']) }}
{{ basic.symbol('', 'bath.light.value', ['low','medium','high'], ['control_1','control_2','control_3'], [85,170], '>') }}
New in v3.0: size of symbols may be altered. As from v3.1 buttons are also provided and an additional text can be displayed on the
button(flip the switch to "on" )
{{ basic.flip('', 'bath.light.switch') }}
{% filter trim|escape|nl2br %}{% verbatim %}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg', '', '', '', '', '', 'micro') }} // or 'mini', 'icon', 'midi'
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg', '', '', '', '', '', 'btn-micro') }} // or 'btn-mini', 'btn-midi'
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg', '', '', '', '', '', 'btn-mini', 'bath') }} // or 'btn-micro', 'btn-midi'
{% endverbatim %}{% endfilter %}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','micro') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','mini') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','icon') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','midi') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','btn-micro') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','btn-mini') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg','','','','','','btn-midi') }}
{{ basic.symbol('', 'bath.light.switch', 'Light on', 'light_light.svg', '', '', '', '', '', 'btn-mini', 'bath') }}
{% endblock %}