/** * ----------------------------------------------------------------------------- * @package smartVISU - Grid Layout * @author Axel Otterstätter * @copyright 2015 * @license GPL * ----------------------------------------------------------------------------- */ /** * Element: Object/Widget as Grid-Button * * @param unique id for this widget * @param title of the element (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a content */ {% macro element (id, info, row, col, sizex, sizey, content) %}
{{ content }}
{% endmacro %} /** * Pagelink * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param the pagelink (for example: index.php?page=mobile/eg/room_xyz/index -> without .html!) * @param text printed on the button (optional only with icon) * @param a icon (optional) */ {% macro pagelink (id, info, row, col, sizex, sizey, pagelink, txt, icon) %}
{% if not icon %}

{{ txt|e }}

{% elseif icon and txt %}

{{ txt|e }}

{% else %} {% endif %}
{% endmacro %} /** * Pagelink with dynamic status icon * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param the pagelink (for example: index.php?page=mobile/eg/room_xyz/index -> without .html!) * @param text printed on the button (optional) * @param the dynamic icon * @param a gad/item for switching * @param a gad/item for variable value * @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) */ {% macro dynamic_pagelink (id, info, row, col, sizex, sizey, pagelink, txt, dyn_icon, gad_switch, gad_value, min, max) %} {% import "icon.html" as icon %}
{% if 'arrow' in dyn_icon %} {{ icon.arrow(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'batterie' in dyn_icon %} {{ icon.batterie(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade_arc' in dyn_icon %} {{ icon.blade_arc(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade_z' in dyn_icon %} {{ icon.blade_z(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade' in dyn_icon %} {{ icon.blade(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'clock' in dyn_icon %} {{ icon.clock(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'compass' in dyn_icon %} {{ icon.compass(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'graph' in dyn_icon %} {{ icon.graph(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'meter' in dyn_icon %} {{ icon.meter(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'shutter' in dyn_icon %} {{ icon.shutter(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'windrose' in dyn_icon %} {{ icon.windrose(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'windsock' in dyn_icon %} {{ icon.windsock(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'light' in dyn_icon %} {{ icon.light(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'volume' in dyn_icon %} {{ icon.volume(id~'-icon', gad_switch, gad_value, min, max) }} {% endif %}
{% if txt %}

{{ txt|e }}

{% endif %}
{% endmacro %} /** * Pagelink with weather icon * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param the pagelink (for example: index.php?page=mobile/eg/room_xyz/index -> without .html!) * @param text printed on the button (optional only with icon) * @param forcast offset: 1 for today, 2 for tomorrow (default), 3 the day after tomorrow ..., (optional, alternativ for text) */ {% macro weather_pagelink (id, info, row, col, sizex, sizey, pagelink, txt, offset) %} {% set uid = uid(page, id) %} {% if once('digiweather') %} {% endif %}
{% if txt %}

{{ txt|e }}

{% else %}

>

{% endif %}
{% endmacro %} /** * Shutter * * @param unique id for this widget * @param title of the shutter (optional) * @param icon row * @param icon col * @param size x * @param size y * @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 position of the shutters * @param a gad/item to move the shutters to the shade position (optional) * @param a gad/item to display the window status (optional) */ {% macro shutter (id, info, row, col, sizex, sizey, gad_move, gad_stop, gad_pos, gad_shade, gad_window, type, hide) %} {% import "basic.html" as basic %} {% import "icon.html" as icon %} {% set uid = uid(page, id) %} {% set min = 0 %} {% set max = 100 %}
{% if gad_pos %}
{% else %} {% if gad_window %}
{{ basic.symbol(id~'icon_open', gad_window, '', 'fts_window_1w_open.svg', 2, '', 'icon1') }} {{ basic.symbol(id~'icon_tilt', gad_window, '', 'fts_window_1w_tilt.svg', 1, '', 'icon1') }} {{ basic.symbol(id~'icon_close', gad_window, '', 'fts_window_1w.svg', 0) }}
{% else %} {% endif %} {% endif %} {% if info %}

{{ info|e }}

{%endif %}
{{ basic.button(id~'up', gad_move, '', 'control_arrow_up.svg', 0, 'midi') }} {{ basic.button(id~'down', gad_move, '', 'control_arrow_down.svg', 1, 'midi') }} {% if gad_stop %}{{ basic.button(id~'stop', gad_stop, '', 'audio_stop.svg', 1, 'midi') }}{% endif %} {% if gad_shade %}{{ basic.button(id~'shade', gad_shade, '', 'fts_shutter_50.svg', 1, 'midi') }}{% endif %}
{% if gad_pos %}
{{ basic.slider(id~'slider', gad_pos, 0 , 100 , 5 ) }}
{% endif %} Schließen
{% endmacro %} /** * Dynamic * * @param unique id for this widget * @param title of the dimmer (optional) * @param icon row * @param icon col * @param size x * @param size y * @param the dynamic icon * @param a gad/item for switching * @param a gad/item for a variable value * @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) * @param readonly mode (default false) */ {% macro dynamic (id, info, row, col, sizex, sizey, dyn_icon, gad_switch, gad_value, min, max, step, read_only) %} {% import "basic.html" as basic %} {% import "icon.html" as icon %} {% set uid = uid(page, id) %}
{% if 'arrow' in dyn_icon %} {{ icon.arrow(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'batterie' in dyn_icon %} {{ icon.batterie(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade_arc' in dyn_icon %} {{ icon.blade_arc(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade_z' in dyn_icon %} {{ icon.blade_z(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'blade' in dyn_icon %} {{ icon.blade(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'clock' in dyn_icon %} {{ icon.clock(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'compass' in dyn_icon %} {{ icon.compass(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'graph' in dyn_icon %} {{ icon.graph(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'meter' in dyn_icon %} {{ icon.meter(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'shutter' in dyn_icon %} {{ icon.shutter(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'windrose' in dyn_icon %} {{ icon.windrose(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'windsock' in dyn_icon %} {{ icon.windsock(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'light' in dyn_icon %} {{ icon.light(id~'-icon', gad_switch, gad_value, min, max) }} {% elseif 'volume' in dyn_icon %} {{ icon.volume(id~'-icon', gad_switch, gad_value, min, max) }} {% endif %}
{% if info %}

{{ info|e }}

{% endif %}
Schließen
{% endmacro %} /** * Button * * @param unique id for this widget * @param popup and info on the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item * @param a icon * @param value send if the button is pressed (optional, default 1) */ {% macro button (id, info, row, col, sizex, sizey, gad, icon, val) %} {% import "basic.html" as basic %}
{% if info %}

{{ info|e }}

{% endif %}
{% endmacro %} /** * Button with png * * @param unique id for this widget * @param popup and info on the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item * @param a icon * @param a text (optional) * @param value send if the button is pressed (optional, default 1) */ {% macro png_button (id, info, row, col, sizex, sizey, gad, icon, txt, val) %} {% import "basic.html" as basic %}
{% if txt %}

{{ txt|e }}

{% endif %}
{% endmacro %} /** * Dual * * @param unique id for this widget * @param popup-info of the dual button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param icon position from left side * @param icon position from top side * @param a gad/item * @param the pic for the 'on' state (optional) * @param the pic for the 'off' state (optional) * @param value send for the 'on' state (optional, default 1) * @param value send for the 'off' state (optional, default 0) */ {% macro dual (id, info, row, col, sizex, sizey, gad, pic_on, pic_off, val_on, val_off) %}
{% if info %}

{{ info|e }}

{% endif %}
{% endmacro %} /** * Displays a rgb-selector * * @param unique id for this widget * @param popup-info of the rgb-selector (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item for on/off switching * @param text for the 'on' state (optional, default 'On') * @param text for the 'off' state (optional, default 'Off') * @param a gad/item for the r - value (0-255) * @param a gad/item for the g - value (0-255) * @param a gad/item for the b - value (0-255) * @param the minimum value if the light is off (optional, for future use) * @param the maximum value if the light is full on (optional, default 255) * @param the granularity of the rings (optional, default 8) * @param the number of colored segments (optional, default 10) */ {% macro rgb (id, info, row, col, sizex, sizey, gad, txt_on, txt_off, gad_r, gad_g, gad_b, min, max, step, colors, type, hide) %} {% set uid = uid(page, id) %}
{% if info %}

{{ info|e }}

{% endif %}
Schließen
{{ basic.flip("{{ id }}-flip", gad, txt_on, txt_off) }}{% if info %} {{ info }} {% endif %}
 
{% endmacro %} /** * Displays a colordisc-rgb-selector * * @param unique id for this widget * @param popup-info of the colordisc (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item for on/off switching * @param text for the 'on' state (optional, default 'On') * @param text for the 'off' state (optional, default 'Off') * @param a gad/item for the r - value (0-255) * @param a gad/item for the g - value (0-255) * @param a gad/item for the b - value (0-255) * @param the minimum value if the light is off (optional, for future use) * @param the maximum value if the light is full on (optional, default 255) * @param the granularity of the rings (optional, default 8) * @param the number of colored segments (optional, default 10) */ {% macro colordisc (id, info, row, col, sizex, sizey, gad, txt_on, txt_off, gad_r, gad_g, gad_b, min, max, step, colors, type, hide) %} {% set uid = uid(page, id) %} {% import "basic.html" as basic %}
{% if info %}

{{ info|e }}

{% endif %}
Schließen
{{ basic.flip("{{ id }}-flip", gad, txt_on, txt_off) }}{% if info %} {{ info }} {% endif %}
{% endmacro %} /** * A symbol, with no writing to knx, only displayed when the value of gad is equal to val. Symbols may be used in menus. * If more than one gad is given, they will be combined with mode ('or' / 'and). * * @param unique id for this widget * @param popup-info (optional) * @param icon row * @param icon col * @param size x * @param size y * @param one or more gad(s)/item(s). More gads/items in array form: [ item1 , item2 ] * @param the text, printed when gad has value val (optional) * @param the pic, shown when gad has value val * @param value (default 1) */ {% macro symbol(id, info, row, col, sizex, sizey, items, txt, icon, val) %}
{% if txt %}

{{ txt }}

{% else %}

{{ info }}

{% endif %}
{% endmacro %} /** * Number: Displays a number * * @param unique id for this widget * @param popup-info of the float value (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item * @param value min * @param value max * @param a unit, tries to get the format for that unit from the language-file (optional) * @param an icon (optional) */ {% macro number (id, info, row, col, sizex, sizey, gad, min, max, unit, icon) %}
{% if icon %}

-.- {{ unit }}

{% else %}

-.- {{ unit }}

{% endif %}
Schließen {% if info %}

{{ info }}

{% endif %}
{% endmacro %} /** * Float: Displays a value as float * * @param unique id for this widget * @param popup-info of the float value (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item * @param a unit, tries to get the format for that unit from the language-file (optional) * @param an icon (optional) */ {% macro float (id, info, row, col, sizex, sizey, gad, unit, icon) %}
{% if icon %}

-.- {{ unit }}

{% else %}

-.- {{ unit }}

{% endif %}
{% endmacro %} /** * Value: Displays a value * * @param unique id for this widget * @param popup-info of the float value (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a gad/item * @param a text (optional) * @param a unit (optional) * @param an icon (optional) */ {% macro value (id, info, row, col, sizex, sizey, gad, txt, unit, icon) %}
{% if icon %}

--- {{ unit }}

{% else %} {% if txt %} {{ txt }} {% endif %}

--- {{ unit }}

{% endif %}
{% endmacro %} /** * Float_popup: Displays a value as float and a popup with details * * * @param unique id for this widget * @param popup-info of the float value (optional) * @param size x * @param size y * @param a gad/item * @param unit * @param icon * @param series of gad/item/s for plot. More item/s in array form: [ item1 , item2 ] * @param the mode: 'avg', 'sum', 'min', 'max' * @param the minimum time (x-axis): '1h', '2h'... (duration-format) * @param the maximum time (x-axis): '', '1h', '2h'... (duration-format, default: now) * @param the minimum y-axis (optional) * @param the maximum y-axis (optional) * @param the step between two time-points (optional, only for 'offline'-driver) * @param label/s for each series (optional) * @param color/s for each series e. g. '#f00' for red (optional, default: sutiable for design) * @param type/s for each series: 'line', 'stair', 'spline', 'area', 'areaspline', 'column' (optional, default 'line') * @param title/s for the x-axis and y-axis * @param minimum time while zooming in sec (optional, duration-format) * @param display plot-options (optional) * * @see misc/fundamentals#Array-Form * @see misc/fundamentals#Duration-Format */ {% macro float_popup (id, info, row, col, sizex, sizey, gad, unit, icon, gad_plot, mode, tmin, tmax, ymin, ymax, step, label, color, exposure, axes, zoom, options) %} {% import "basic.html" as basic %} {% import "plot.html" as plot %}
{% if icon %}

-.- {{ unit }}

{% else %}

-.- {{ unit }}

{% endif %}
Schließen
{% if options %}
/***/ /***/
{% endif %}
{% endmacro %} /** * Camera * * @param unique id for this widget * @param title of the camera (optional) * @param icon row * @param icon col * @param size x * @param size y * @param stream url * @param picture or mjpeg url (optional) * @param video width (not used) * @param video height (not used) */ {% macro camera (id, info, row, col, sizex, sizey, stream, picture, width, height) %} {% import "basic.html" as basic %} {% set uid = uid(page, id) %}
{% if picture and info %}

{{ info|e }}

{% elseif picture %} {% elseif info %}

{{ info|e }}

{% else %} {% endif %}
{% endmacro %} /** * url: Popup with a external page * * @param unique id for this widget * @param popup-info of the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param the url to open in a popup (for example: http://www.google.de) * @param a icon (optional) * @param width of the popup * @param height of the popup */ {% macro url (id, info, row, col, sizex, sizey, url, icon, width, height) %} {% set uid = uid(page, id) %}
{% if not icon %}

{{ info|e }}

{% elseif info %}

{{ info|e }}

{% else %} {% endif %}
Schließen {% if info %}
{{ info }}
{% endif %}
{% endmacro %} /** * scene: Select a scene * * @param unique id for this widget * @param text printed on the button (optional) * @param icon row * @param icon col * @param size x * @param size y * @param a item * @param a icon (optional) * @param array for labels * @param array for values to send (same order as labels) */ {% macro scene (id, info, row, col, sizex, sizey, gad, icon, labels, values) %} {% set uid = uid(page, id) %}
{% if not icon %}

{{ info|e }}

{% elseif info %}

{{ info|e }}

{% else %} {% endif %}
{% endmacro %} /** * period: Display a plot as period in a grid-element * * @param unique id for this popup-widget * @param text as title * @param icon row * @param icon col * @param size x * @param size y * @param series of item/s. More item/s in array form: [ item1 , item2 ] * @param the mode: 'avg', 'sum', 'min', 'max' * @param the minimum time (x-axis): '1h', '2h'... (duration-format) * @param the maximum time (x-axis): '', '1h', '2h'... (duration-format, default: now) * @param the minimum y-axis (optional) * @param the maximum y-axis (optional) * @param the step between two time-points (optional, only for 'offline'-driver) * @param label/s for each series (optional) * @param color/s for each series e. g. '#f00' for red (optional, default: sutiable for design) * @param type/s for each series: 'line', 'stair', 'spline', 'area', 'areaspline', 'column' (optional, default 'line') * @param title/s for the x-axis and y-axis * @param minimum time while zooming in sec (optional, duration-format) * * @see misc/fundamentals#Array-Form * @see misc/fundamentals#Duration-Format */ {% macro plot_period (id, info, row, col, sizex, sizey, gad, mode, tmin, tmax, ymin, ymax, step, label, color, exposure, axes, zoom) %}
{% endmacro %} /** * Displays the actual weather at location * * @param unique id for this widget * @param text as title * @param icon row * @param icon col * @param size x (optional, default 2) * @param size y (optional, default 4) * @param location as string (optional) * * @info based on jDigiClock by Radoslav Dimov * @link http://www.radoslavdimov.com */ {% macro weather_current(id, info, row, col, sizex, sizey, location) %} {% set uid = uid(page, id) %} {% if once('digiweather') %} {% endif %}
{% if info %}
{{ info }}
{% endif %}
{% if location %}
{% endif %}
{% endmacro %} /** * Displays the forecast weather of one day at location * * @param unique id for this widget * @param text as title * @param icon row * @param icon col * @param size x (optional, default 2) * @param size y (optional, default 4) * @param location as string (optional) * @param offset: 1 for today, 2 for tomorrow (default), 3 the day after tomorrow ..., (optional) * * @info based on jDigiClock by Radoslav Dimov * @link http://www.radoslavdimov.com */ {% macro weather_forecast(id, info, row, col, sizex, sizey, location, day) %} {% set uid = uid(page, id) %} {% if once('digiweather') %} {% endif %}
{% if info %} {{ info }} {% endif %}
{% if location %}
{% endif %}
{% endmacro %} /** * Footer * * @param unique id for this widget * @param a gad/item for the temp_inside (optional) * @param a gad/item for the outside_temp (optional) * @param target for the prev button (optional) * @param target for the home button (optional) * @param target for the next button (optional) * @param a gad/item for the analog dynamic clock icon (optional) */ {% macro footer (id, temp_inside, temp_outside, prev, home, next, gad_clock) %} {% set uid = uid(page, id) %} {% import "basic.html" as basic %} {% endmacro %}