/** * ----------------------------------------------------------------------------- * @package smartVISU * @author Martin Gleiß et.al., migration to SV 2.9 by Wolfram v. Hülsen * @copyright 2012 - 2019 * @license GPL [http://www.gnu.de] * ----------------------------------------------------------------------------- */ /** * Standard dimmer with switching and dimming function * * @param {id=} unique id for this widget (optional) * @param {text=} name of the dimmer * @param {item(bool,num)} an item for switching * @param {item(num)} an item for dimming * @param {value=0} the minimum value if the slider is moved to total left (optional, default: 0) * @param {value=255} the maximum value if the slider is moved to total right (optional, default: 255) * @param {value=5} step between two values (optional, default: 5) * @param {image=light_light} the pic for the 'on' state (optional) * @param {image=light_light} the pic for the 'off' state (optional) * @param {color(icon0,icon1)=icon1} the color for the 'on' state (optional) * @param {color(icon0,icon1)=icon0} the color for the 'off' state (optional) * @param {text(input,handle,both,none)=none} how should the value be shown; possible options: 'input', 'handle', 'both', 'none' (optional, default 'none') * @param {value=} the minimum value to display if the slider is moved to total left if this should differ from sent/received value (optional, default like min) * @param {value=} the maximum value to display if the slider is moved to total right if this should differ from sent/received value (optional, default like max) * @param {percent} icon position from left side * @param {percent} icon position from top side * @param {type(micro,mini,midi,icon)=micro} type: 'micro', 'mini', 'midi', 'icon' (optional, default: micro) * @param {value=0} hide on mobile displays (optional value 1) * @param {text=left} position of the switch: left (default) or right */ {% macro dimmer(id, txt, item_switch, item_value, min, max, step, pic_on, pic_off, color_on, color_off, value_display, min_display, max_display, left, top, type, hide, picpos) %} {% import "basic.html" as basic %} {% import "icon.html" as icon %} {% set uid = uid(page, id) %}
{% if picpos is empty or picpos=='left' %} {% else %} {% endif %} {{ basic.stateswitch('', item_switch, type, '', [ pic_off|default('light_light'), pic_on|default('light_light') ], '', [ color_off , color_on|default('icon1') ]) }} {{ txt|e }} {{ basic.slider('', item_value, min, max, step, 'horizontal', value_display|default('none'), min_display, max_display) }}
Schließen
{% endmacro %}