/** * ----------------------------------------------------------------------------- * @package smartVISU * @author Martin Gleiß * @copyright 2012 * @license GPL [http://www.gnu.de] * ----------------------------------------------------------------------------- */ /** * Standard blind * * @param unique id for this widget * @param name of the blind * @param a gad/item for the up- and down- movement * @param a gad/item for stopping the movement (optional) * @param a gad/item for the actual absolute position of the blinds * @param a gad/item for increase- and decreace- of the blade (optional) * @param a gad/item for the actual absolute angle of the blade (optional) * @param the minimum value for close (optional, default 0) * @param the maximum value for open (optional, default 255) * @param step between two values (optional, default 5) * * @info inspired by Frank Berlenz */ {% macro blind(id, txt, gad_move, gad_stop, gad_pos, gad_shift, gad_angle, min, max, step) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
{{ basic.button(id~'up', gad_move, '', 'arrow-u', 0) }}
{{ basic.slider(id~'pos', gad_pos, min, max, step, 'vertical') }} {{ txt }}
{% if gad_angle %} {{ basic.slider(id~'angle', gad_angle, min, max, step, 'semicircle') }} {% endif %}
{% if gad_stop %}
{{ basic.button(id~'stop', gad_stop, '', 'delete', 1) }}
{% endif %}
{{ basic.button(id~'down', gad_move, '', 'arrow-d', 1) }}
{% if gad_shift %}
{{ basic.button(id~'minus', gad_shift, '', 'minus', 0) }} {{ basic.button(id~'plus', gad_shift, '', 'plus', 1) }}
{% endif %}
{% endmacro %} /** * Standard dimmer with switching and dimming function * * @param unique id for this widget * @param name of the dimmer * @param a gad/item for switching * @param a gad/item for dimming * @param the minimum value if the slider is moved to total left (optional, default 0) * @param the maximum value if the slider is moved to total right (optional, default 255) * @param step between two values (optional, default 5) */ {% macro dimmer(id, txt, gad_switch, gad_value, min, max, step) %} {% import "basic.html" as basic %}
{{ basic.switch(id~'switch', gad_switch, icon1~'light_light.png', icon0~'light_light.png') }}

{{ txt|e }}

{{ basic.slider(id~'slider', gad_value, min, max, step) }}
{% endmacro %} /** * Standard RTR (Room Temperatur Regulator) * * @param unique id for this widget * @param name of the rtr * @param a gad/item for the actual temperature * @param a gad/item for the set temperature * @param a gad/item for comfort / standby (3x bit or 1x byte) * @param a gad/item for night (3x bit or 1x byte) * @param a gad/item for frost (3x bit or 1x byte) * @param a gad/item for the current state of the actor * @param a gad/item for a text (some rtr have a text-display), (optional) * @param step for plus/minus buttons (optional, default 0.5) */ {% macro rtr(id, txt, gad_actual, gad_set, gad_comfort, gad_night, gad_frost, gad_state, gad_txt, step) %} {% import "basic.html" as basic %}
{{ basic.float(id~'actual', gad_actual, '°' ) }}
{{ txt }} {% if gad_txt %} {{ basic.value(id~'txt', gad_txt) }} {% endif %}
{% if gad_set %}
{{ basic.float(id~'set', gad_set, '°' ) }}
{% endif %}
{% if ((config_driver == 'linknx') and (gad_comfort == gad_night) and (gad_night == gad_frost)) %} {{ basic.switch(id~'mode', gad_comfort, icon1~'user_available.png', icon0~'user_away.png', 'comfort', 'standby') }} {{ basic.switch(id~'night', gad_night, icon1~'scene_night.png', icon0~'scene_day.png', 'night', 'standby') }} {{ basic.switch(id~'frost', gad_frost, icon1~'weather_frost.png', icon0~'weather_frost.png', 'frost', 'standby') }} {% elseif ((gad_comfort == gad_night) and (gad_night == gad_frost)) %} {{ basic.switch(id~'mode', gad_comfort, icon1~'user_available.png', icon0~'user_away.png', '1', '2') }} {{ basic.switch(id~'night', gad_night, icon1~'scene_night.png', icon0~'scene_day.png', '3', '2') }} {{ basic.switch(id~'frost', gad_frost, icon1~'weather_frost.png', icon0~'weather_frost.png', '4', '2') }} {% else %} {{ basic.switch(id~'mode', gad_comfort, icon1~'user_available.png', icon0~'user_away.png') }} {{ basic.switch(id~'night', gad_night, icon1~'scene_night.png', icon0~'scene_day.png') }} {{ basic.switch(id~'frost', gad_frost, icon1~'weather_frost.png', icon0~'weather_frost.png') }} {% endif %}
{{ basic.switch(id~'state', gad_state, icon1~'sani_heating.png', icon0~'sani_heating.png') }}
{% endmacro %} /** * Standard shutter * * @param unique id for this widget * @param name of the shutter * @param a gad/item for the up- and down- movement * @param a gad/item for stopping the movement (optional) * @param a gad/item for the actual absolute position of the blinds * @param a gad/item for increase- and decreace- of the blade (optional, for future use) * @param a gad/item for the actual absolute angle of the blade (optional) * @param a gad/item for some saved positions (optional) * @param the minimum value for close (optional, default 0) * @param the maximum value for open (optional, default 255) * @param step between two values (optional, default 5) * @param the mode: 'half' blade turns from -1 to +1, or 'full' blade turns from 0 to +1 (optional, default 'half') * * @info inspired by Jörg Gutowski */ {% macro shutter(id, txt, gad_move, gad_stop, gad_pos, gad_shift, gad_angle, gad_saved, min, max, step, mode) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
{{ basic.button(id~'up', gad_move, '', 'arrow-u', 0) }}
{{ basic.shutter(id, gad_pos, gad_angle, min, max, step, mode) }} {% if gad_saved %}
{{ basic.button(id~'saved1', gad_saved, 'Pos1', 'grid', 0) }}
{% endif %}
{% if gad_stop %}
{{ basic.button(id~'stop', gad_stop, '', 'delete', 1) }}
{% endif %}
{{ txt }}
{{ basic.button(id~'down', gad_move, '', 'arrow-d', 1) }}
{% if gad_saved %}
{{ basic.button(id~'saved2', gad_saved, 'Pos2', 'grid', 1) }}
{% endif %}
{% endmacro %}