/**
* -----------------------------------------------------------------------------
* @package smartVISU
* @author Martin Gleiß and others
* @copyright 2012 - 2022
* @license GPL [http://www.gnu.de]
* -----------------------------------------------------------------------------
*/
/**
* Displays a checkbox
*
* @param {id=} unique id for this widget (optional)
* @param {item(bool)=} an item
* @param {text=} label of the checkbox (optional)
checkbox gets shrinked when empty, pass a whitespace to prevent this
* @param {text=1} value for the checked state (optional, default 1)
* @param {text=0} value for the unchecked state (optional, default 0)
*/
{% macro checkbox(id, item, txt, val_on, val_off) %}
{{ txt }}
{% endmacro %}
/**
* Displays a color selector
*
* @param {id=} unique id for this widget (optional)
* @param {item[?](num,list)} an item for the red value in RGB model or hue in HSL and HSV model, or single item containing list of all color values
* @param {item(num)=} an item for the green value in RGB model or saturation in HSL and HSV model
(to let blank if first item contains list of all values)
* @param {item(num)=} an item for the blue value in RGB model or lightness in HSL model / brightness in HSB model
(to let blank if first item contains list of all values)
* @param {value[?]=0} minimum value if the light is off; single value or list of values for each component (optional, default 0)
* @param {value[?]=255} maximum value if the light is full on; single value or list of values for each component (optional, default 255 for rgb, [360,100,100] for hsl & hsv)
* @param {value=7} number of shades per color (optional, default 7)
* @param {value=10} number of colored segments (optional, default 10)
* @param {text(disc,rect,slider)=disc} 'disc' for circular, 'rect' for rectangular view, 'slider' for HSV sliders (optional, default: disc)
* @param {text(rgb,hsl,hsv)=rgb} possible values: 'rgb', 'hsl' and 'hsv' (optional, default: rgb)
*
* @author Martin Gleiß and Stefan Widmer
* @info inspired by Marcus Popp
*/
{% macro color(id, item_r_h, item_g_s, item_b_l_v, min, max, steps, colors, style, colormodel) %}
{% set style = style|default('disc') %}
{% if style == 'slider' %}
{% import _self as basic %}
{% else %}
{% endif %}
{% endmacro %}
/**
* Displays a flip-switch
*
* @param {id=} unique id for this widget (optional)
* @param {item(bool,num,str)} an item
* @param {text=On} text for the 'on' state (optional, default 'On')
* @param {text=Off} text for the 'off' state (optional, default 'Off')
* @param {text=1} value for the 'on' state (optional, default 1)
* @param {text=0} value for the 'off' state (optional, default 0)
* @param {color=} alternative color (e.g. '#777') for active switch (optional)
*/
{% macro flip(id, item, txt_on, txt_off, val_on, val_off, background) %}
{{ txt_off|default('Off') }}
{{ txt_on|default('On') }}
{% endmacro %}
/**
* Used to glue two widgets together. Only needed if you don't use 'Realtime'!
* If you click the 'from'-widget, the 'to'-widget will be reloaded and updated after a delay.
*
* @param {id(nonunique)} id of the element that is being clicked (from)
* @param {id(nonunique)} id of the element that contains an item that will be changed (to)
*/
{% macro glue(id_from, id_to) %}
{% endmacro %}
/**
* show an icon, optionally colored statically or dynamically by item
*
* @param {image} icon to show
* @param {color(icon0,icon1,rgb,hsl,hsv,#f00)=icon0} the color in any CSS form (e.g. '#f00' for red) or 'icon1' (default 'icon0' of the design)
To use dynamic coloring by item give one of the following color models: 'rgb', 'hsl' or 'hsv'
* @param {item[?](num,list)=} either one item which sends all three color parts as array or an array of three items each sending one of the color parts.
* @param {type=icon} icon type / size. valid types: 'micro','mini','midi','icon' (optional, default = 'icon')
*
* @see design/design_icons#Icons (list of available pictures)
*
* @author Stefan Widmer
*/
{% macro icon(pic, color, item, type) %}
{% if type not in ['micro','mini','midi'] %}
{% set type = '' %}
{% else %}
{% set uitype = 'ui-'~type %}
{% endif %}
{% if pic|trim|slice(0, 1) != '<' or pic|trim|slice(0, 4) == '
{%- endif -%}
{% if pic|trim|slice(0, 4) != '
{%- else -%}
">{{ pic }}
{%- endif -%}
{% if color in ['rgb','hsl','hsv'] -%}
{%- endif -%}
{%- else -%} /** pic is any other widget */
{{ pic|raw }}
{%- endif -%}
{% endmacro %}
/**
* Displays an input field
*
* @param {id=} unique id for this widget (optional)
* @param {item} an item, sent values are:
- date, dateflip, datecal, dateslide: Date object resp. ISO 8601 - e.g. '2017-11-29T23:00:00.000Z' in UTC time (if no string format specified)
- time & timeflip: String with 24hr clock - e.g. '18:31:27' - format for time is taken from language file
- duration & durationflip: Number of seconds
- any other: Entered value
* @param {text(text,number,date,dateflip,datecal,dateslide,time,timeflip,duration,durationflip)=text} 'text', 'number', 'date', 'dateflip', 'datecal', 'dateslide', 'time', 'timeflip', 'duration', 'durationflip' (optional, default: text)
* @param {text=} lowest allowed value (optional)
- date & dateflip: Number of days before today
- time & timeflip: Format is 24hr clock - e.g. '18:31:27'
- duration & durationflip: in seconds
* @param {text=} highest allowed value (optional)
- date & dateflip: Number of days after today
- time, timeflip: Format is 24hr clock - e.g. '18:31:27'
- duration & durationflip: in seconds
* @param {value=1} step between two values (optional, no effect on date/time types)
* @param {text=} string format for date only (optional)
- empty: default format for date will be standard date object (see above)
- with given format option, the date will be converted to a string, e.g. '%d.%m.%Y' represents DD.MM.YYYY.
For options see https://jtsage.dev/DateBox/doc/3-3-output/
- to globally change time format for timeboxes, use the override method of JTSage in your visu.js:
jQuery.extend(jQuery.jtsage.datebox.prototype.options, {overrideTimeOutput: "%H:%M", overrideTimeFieldOrder: ["h","i"] })
*
* @author Stefan Widmer
* @info Inspired by Michael Würtenberger, date/time control uses JTSageDateBox
*/
{% macro input(id, item, type, min, max, step, format) %}
{% endmacro %}
/**
* A widget to display a list
*
* @param {id=} unique id for this widget (optional)
* @param {item(list)} an item
* @param {value=5} max number of values to show (optional, default 5)
* @param {text=} title of the collapsible (optional)
* @param {text=} make the widget collapsible (optional)
*
* @author Christian Strassburg
*/
{% macro listview(id, item, size, title, col) %}
{% if not col is empty %}
{{ title }} {% endif %}
{% endmacro %}
/**
* Displays a button to shift offset
*
* @param {id=} unique id for this widget (optional)
* @param {item(num)} an item
* @param {value=1} step between two values; use positive numbers to increase, negative ones to decrease (optional, default 1)
* @param {image=} icon to show on the button (optional)
* @param {text=} text printed on the button (optional)
* @param {type(text)=mini} valid types: 'micro', 'mini', 'midi', 'icon', 'text' (optional, default: mini)
* @param {text=} lowest allowed value (optional, default: no limit)
* @param {text=} highest allowed value (optional, default: no limit)
*/
{% macro offset(id, item, step, icon, text, type, min, max) %}
{% import _self as basic %}
{%- else -%}
{{ not text is empty ? ' ui-btn-icon-top' }} ui-nodisc-icon">{{ basic.icon(icon) }}
{%- endif -%}
{{- text|e -}}
{% endmacro %}
/**
* prints value or text (optionally calculated and/or formatted)
*
* @param {id=} unique id for this widget (optional)
* @param {item[?](bool,num,list,str)} one or more item(s). Multiple items in array-form: [item1, item2]
* @param {format=} either a unit of the language file, an individual format string (PHP sprintf like) or a simple string as suffix.
Use 'text' to display result as unformatted string, 'html' to render it as unescaped html, 'text2br' to convert line endings like '\r', '\n' or '\r\n' to HTML breaks or 'script' to just execute as JavaScript w/o displaying anything.
* @param {formula=VAR} any valid JavaScript expression with following variables and aggregate functions (optional, default: VAR)
- VAR1, VAR2, ... represent the corresponding item's value, VAR is an array of all item values
- SUM(VAR), AVG(VAR), SUB(VAR), MIN(VAR) and MAX(VAR) aggregate the values
* @param {text[]=} array of upper thresholds; the color according to greatest reached threshold is applied (optional)
* @param {color[?](icon0,icon1,hidden,blank)=} array of colors; 'icon1' or e. g. '#f00' for red (optional)
additionally you can use 'hidden' to not diplay at all or 'blank' to make it invisible but preserve the space that would be used.
the first one is the base color for values below first threshold, so pass one color more than thresholds.
* @param {text=} URL to use as link (optional)
* @param {text=} used in combination with href as data-rel attribute {e.g. to open a popup} (optional)
*
* @see misc/fundamentals#Array-Form
*
* @author Stefan Widmer
* @info inspired by Martin Gleiß and Raik Alber
*/
{% macro print(id, item, format, formula, threshold, color, href, rel) %}
{% if href is empty %}{% else %}{% endif %}
---
{% if href is empty %}{% else %} {% endif %}
{% endmacro %}
/**
* Displays a round slider
* @param {id=} unique id for this widget (optional)
* @param {item(num,list)} an item (list type can be used if slider type is "range")
* @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 {text=} pretext of the center text/value
* @param {text=} text after center text/ value
* @param {text=} unit of the center value
* @param {text(false,true)=false} display a scale with values along the slider (optional, default='false')
* @param {value=20} scale-integer, the scale-divider for the scale
* @param {text=} icon to be displayed in the center (optional)
* @param {text(pie,quarter-top-left,quarter-top-right,quarter-bottom-left,quarter-bottom-right,half-top,half-bottom,half-left,half-right,custom-half,custom-quarter)=pie} circleshape slider style (like pie, quarter-top-left, quarter-top-right, quarter-bottom-left, quarter-bottom-right, half-top, half-bottom, half-left, half-right, custom-half, custom-quarter)
* @param {text(default,range,min-range)=min-range} slidertype (default, min-range,range ) (optional, default = min-range)
* @param {value=120} radius of the slider (optional, default: 90)
* @param {value=15} width of the slide line
* @param {value=0.1} thickness of the slide line
*
* @author Bonze, Wolfram v. Hülsen
*/
{% macro roundslider(id, item, min, max, step, pre_value, to_value, unit, scale, scale_interval, pic, circleshape, slidertype, radius, width, thickness) %}
{% if circleshape not in ['', 'pie', 'quarter-top-left', 'quarter-top-right', 'quarter-bottom-left', 'quarter-bottom-right', 'half-top', 'half-bottom', 'half-left', 'half-right'] %} {% set circleshape = '' %} {% endif %}
/**- pic whithout path -*/
{% if '/' not in pic and not isfile(pic) %}
{% if isfile('dropins/' ~ icon0 ~ pic) %}
{% set pic = 'dropins/' ~ icon0 ~ pic %}
{% elseif isfile('dropins/' ~ icon0 ~ pic ~ '.svg') %}
{% set pic = 'dropins/' ~ icon0 ~ pic ~ '.svg' %}
{% elseif isfile('dropins/' ~ icon0 ~ 'jquery_' ~ pic ~ '.svg') %} /**- jQuery ui-icon classes -*/
{% set pic = 'dropins/' ~ icon0 ~ 'jquery_' ~ pic ~ '.svg' %}
{% elseif isfile(icon0 ~ pic) %}
{% set pic = icon0 ~ pic %}
{% elseif isfile(icon0 ~ pic ~ '.svg') %}
{% set pic = icon0 ~ pic ~ '.svg' %}
{% elseif isfile(icon0 ~ 'jquery_' ~ pic ~ '.svg') %} /**- jQuery ui-icon classes -*/
{% set pic = icon0 ~ 'jquery_' ~ pic ~ '.svg' %}
{% endif -%}
{% endif -%}
/** pseudo divs, to get styles **/
{% endmacro %}
/**
* Select a specific value (e.g. a scene)
*
* @param {id=} unique id for this widget (optional)
* @param {item(bool,num,list)} an item
* @param {type(menu)=menu} type: 'menu', 'micro', 'mini', 'midi', 'icon' (optional, default: menu)
* @param {text[]=[0,1]} list of values (optional, default [0,1])
* @param {image[]=} list of icons for every button (optional) - not supported for type 'menu'
* @param {text[]=} list of texts for every menu entry or button (optional)
* @param {color(icon0,icon1)=icon1} the color for the on state of the buttons (optional, default: icon1) - not supported for type 'menu'
* @param {text(horizontal,vertical,none)=horizontal} orientation of the controlgroup: 'horizontal', 'vertical' or 'none' for seperate buttons (optional, default: 'horizontal') - not supported for type 'menu'
* @param {item(list)=} an item containing all selectable values (optional) - overrides existing value definitions
* @param {item(list)=} an item containing the texts corresponding to the selectable values (optional even if itemvals is specified)
*/
{% macro select(id, item, type, value, icon, text, color_on, group, itemvals, itemtxts) %}
{% import _self as basic %}
{% if type == 'menu' or type is empty %}
{% if itemvals == '' or itemvals is empty %}
{% for val in value|default([0,1]) %}
{{ text[loop.index0]|default(val) }}
{% endfor %}
{% endif %}
{% else %}
{% for val in value|default([0,1]) %}
{% set pic = icon is iterable ? icon[loop.index0]|default(icon[0]) : icon %}
{{basic.stateswitch('', item, type|default('mini'), [val, val], pic, (text is iterable ? text[loop.index0]|default(text[0]) : text)|default(pic is empty ? val : ''), [color_on|default('icon1'), ''])}}
{% endfor %}
{% endif %}
{% endmacro %}
/**
* Displays a shutter control
*
* @param {id=} unique id for this widget (optional)
* @param {item(num)} an item for the position of the blinds
* @param {item(num)=} an item for the angle of the blinds (optional)
* @param {value=0} the value for opened (optional, default 0)
* @param {value=255} the value for closed (optional, default 255)
* @param {value=5} step between two values (optional, default 5)
* @param {text(half,full)=half} 'half' blade turns from -1 to +1, 'full' blade turns from 0 to +1 (optional, default 'half')
* @param {image=} background image url (relative to smartVISU directory or absolute); optimal size is 100px x 180px (optional)
*
* @info inspired by Jörg Gutowski
*/
{% macro shutter(id, item_pos, item_angle, value_top, value_bottom, step, mode, background) %}
{% if item_angle != '' %}
{% endif %}
{% for i in 1..12 %}
{% endfor %}
{% endmacro %}
/**
* Displays a slider-control
*
* @param {id=} unique id for this widget (optional)
* @param {item(num)} an item
* @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 {text(horizontal,vertical,bottomup,semicircle)=horizontal} possible options: 'horizontal', 'vertical', 'bottomup', 'semicircle' (optional, default 'horizontal')
* @param {text(input,handle,both,none)=input} how should the value be shown; possible options: 'input', 'handle', 'both', 'none' (optional, default 'input')
* @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 to total right if this should differ from sent/received value (optional, default like max)
* @param {value=1} 'live mode': if enabled, values will be sent during sliding. '0' sends values only when sliding is stopped, after click into track or if value is edited in input field. (optional, default = 1)
*/
{% macro slider(id, item, min, max, step, orientation, value_display, min_display, max_display, live) %}
{% endmacro %}
/**
* A versatile button/switch
* (supercedes basic.button, basic.dual, basic.hiddenswitch, basic.multistate and basic.switch)
*
* @param {id=} unique id for this widget (optional)
* @param {item(bool,num,list,scene,str)} an item
* @param {type(text)=mini} valid types: 'micro', 'mini', 'midi', 'icon', 'text' (optional, default: mini)
* @param {text[?]=[0,1]} array of values (optional, default [0,1])
If the item has a value that is not part of the list, the state (icon, text, color) of the last value in the list will be shown.
* @param {image[?]=control_on_off} array of icons (optional, default just if text is empty: control_on_off.svg)
dynamic icons can be used, e.g. icon.light('', '', item_value); please note: these must not be wrapped by apostrophs (').
the second attribute in the dynamic icon must be empty. Otherwise there will be conflicts with item_switch
* @param {text[?]=} array of texts (optional)
* @param {color[?](icon0,icon1,hidden,blank)=icon0} array of colors; 'icon1' or e. g. '#f00' for red (optional, default: icon0)
additionally you can use 'hidden' to not diplay at all or 'blank' to make it invisible but preserve the space that would be used.
* @param {color(icon0,icon1,blink)=} activity indicator which is active until response (or a timeout of 3 seconds is reached); pass either a color, 'icon1' or 'blink' (optional)
* @param {text=} an item to which a value is sent on longpress OR an id of a popup, with prefix '#' (optional)
* @param {text=} the value to send on longpress (optional)
If this starts with a + or - sign the value is treated as offset to current stateswitch value.
* @param {text=} the value to send on releasing after a longpress (optional)
*
* @see design/design_icons#Icons
*
* @author Stefan Widmer
* @info Based on work of Martin GLEISS and Pierre-Yves KERVIEL
*/
{% macro stateswitch(id, item, type, value, icon, text, color, indicator, item_longpress, value_longpress, value_longrelease) %}
{% import _self as basic %}
{% set value = (value|default([0,1]) is iterable ? value|default([0,1]) : [value]) %}
{% set color = color|default(['','icon1']) %}
/** Work around for bug in jQuery Mobile, see https://knx-user-forum.de/forum/supportforen/smartvisu/31967-neues-widget-nur-aktive-lampen-anzeigen-ausschalten-ermöglichen?p=1145001#post1145001 */
{% for val in value %}
{% set pic = icon is iterable ? icon[loop.index0] : icon %}
{% if type != 'text' and text is empty %}{% set pic = pic|deficon('control_on_off.svg') %}{% endif %}
{% set col = (color is iterable ? color[loop.index0] : color)|default('') %}
{% set txt = (text is iterable ? text[loop.index0] : text)|default('') %}
{%- if not pic is empty -%}{{ basic.icon(pic, not indicator is empty and (col is empty or col == 'icon0') ? 'do-fx' : col) }}{%- endif -%}
{{- txt|e -}}
{% endfor %}
/** placeholder for last moved control */
{% endmacro %}
/**
* An icon or text, with no writing to backend, only displayed when the value of item is equal to defined value. Symbols may be used in menus.
* If more than one item is given, they will be combined with formula.
*
* @param {id=} unique id for this widget (optional)
* @param {item[?](bool,num,list,scene)=} zero, one or more item(s). More items in array form: [item1, item2] (optional)
* @param {text[?]=} the text, printed when item has value val (optional)
* @param {image[?]=control_on_off} the icon shown when item has value val (optional, default 'control_on_off' if text is empty)
dynamic icons can be used, e.g. icon.light('', '', value_item); please note: these must not be wrapped by apostrophs (')
* @param {text[?]=1} comparative value(s) (default 1)
* @param {formula=or} 'or', 'and' or any JavaScript expression with following variables, result will be compared to comparative value above. Additionally you can use 'min' and 'max' to test if any of the defined items has a value >= or <= comparative value (default 'or')
VAR1, VAR2, ... represent the corresponding item's value, VAR is an array of all item values
If the formula starts with a greater than symbol '>' the value will be treated as threshold. The symbol (text, icon and color) according to greatest reached threshold will be shown. The first symbol is the base for values below first threshold, so pass one symbol more than values.
If '>' is not used, symbols will only be shown if the item value matches exactly one of the given value parameters
* @param {color[?](icon0,icon1)=icon0} the color 'icon1' or e. g. '#f00' for red (default 'icon0' of the design)
this only applies to text, if no icon is set (for backward compatibility)
* @param {text=} URL to use as link (optional)
* @param {text=} used in combination with href as data-rel attribute {e.g. to open a popup} (optional)
* @param {type(btn-micro,btn-mini,btn-midi)=icon} icon type with or without button. valid types: 'micro','mini','midi','icon', 'btn-micro', 'btn-mini', 'btn-midi' (optional, default = 'icon')
* @param {text=} text to show inside button if button type selcted (optional)
*
* @see design/design_icons#Icons
*
* @author Martin Gleiß and Stefan Widmer
*/
{% macro symbol(id, items, text, icon, value, formula, color, href, rel, type, btntxt) %}
{% import _self as basic %}
{% if type not in ['micro','mini','midi', 'btn-micro', 'btn-mini', 'btn-midi'] %}{% set type = '' %}{% endif %}
{% set value = (value|default([1]) is iterable ? value|default([1]) : [value]) %}
{% set value = text|length > value|length or icon|length > value|length or color|length > value|length ? value|merge(['']) : value %} /** add an empty value if more icons/texts/colors as values are passed (used for threshold i.a.) */
{% set color = color|default('') %}
{% set uitype ='' %}
<{% if href is empty %}span{% else %}a href="{{ href }}"{% if rel is not empty %} data-rel="popup"{% endif %}{% endif %}{% if not id is empty %} id="{{ uid(page, id) }}"{% endif %} data-widget="basic.symbol"
{% if not items is empty %}data-item="{{ implode(items) }}" style="display: none;" {% endif %}
data-val="{{ implode(value) }}"
data-mode="{{ formula|default('or') }}"
class="symbol">
{%- for val in value -%}
{%- set pic = icon is iterable ? icon[loop.index0] : icon -%}
{%- if text is empty %}{% set pic = pic|deficon('control_on_off.svg') %}{% endif -%}
{%- set col = (color is iterable ? color[loop.index0] : color)|default('') -%}
{%- set txt = (text is iterable ? text[loop.index0] : text)|default('') -%}
{%- if pic %}
{% if type in ['btn-micro', 'btn-mini', 'btn-midi'] %}
{% set uitype = 'ui-'~type|slice(4) %}
{{ basic.icon(pic, col,'','') }}
{{- btntxt|e -}}
{% else %}
{{ basic.icon(pic, col,'',type) }}
{% endif %}
{% endif -%}
{{- txt|raw -}}
{%- endfor -%}
{% if href is empty %}span{% else %}a{% endif %}>
{% endmacro %}
/**
* Displays a (partly) filled tank
*
* @param {id=} unique id for this widget (optional)
* @param {item(num)} an item for the actual position of filled tank
* @param {value=0} the value for empty (optional, default 0)
* @param {value=255} the value for full (optional, default 255)
* @param {value=5} step between two values (optional, default 5, for future use)
* @param {text(none,cylinder,water,pallets)=none} the mode: 'none', 'cylinder', 'water', 'pallets' (optional, default 'none')
* @param {color(icon0,icon1)=grey} the color of the filling e. g. '#f00' for red (optional, default grey)
*/
{% macro tank(id, item_pos, min, max, step, mode, color) %}
{% endmacro %}
/**
* A widget to trigger a logic (e. g. in SmartHome.py)
*
* @param {id=} unique id for this widget (optional)
* @param {text} the name of the trigger (logic)
* @param {text=} text printed on the button (optional)
* @param {image=} icon to show on the button (optional)
* @param {text=1} value to send if the button is pressed (optional, default 1)
* @param {type=mini} type: 'micro', 'mini', 'midi' (optional, default: mini)
* @param {text(button,page,both)=button} trigger event: 'button', 'page', 'both' (optional, default: button)
*/
{% macro trigger(id, name, txt, icon, val, type, event) %}
{% import _self as basic %}
{%- else -%}
{{ txt ? ' ui-nodisc-icon ui-btn-icon-top' : '' }}">{{ basic.icon(icon) }}
{%- endif -%}
{{- txt|e -}}
{% endmacro %}
/**
* a window with open/tilted/closed status and shutter
*
* @param {id=} unique id for this widget
* @param {item(num)} an item for the height of the shutter blades
* @param {item(num,str)=} an item for the window right wing status (0/'closed', 1/'tilted', 2/'open') (optional, default = 0)
* @param {item(num,str)=} an item for the window left wing status (0/'closed', 1/'tilted', 2/'open') (optional, default = 0)
* @param {value=0} the value for shutter on top end (optional, default 0)
* @param {value=255} the value for shutter at bottom end (optional, default 255)
* @param {color(icon1,!)=icon1} color for 'open' state e.g. '#f00' for red. Prepend a '!' to make the color constant ('!#f00'). 'icon0' and 'icon1' can NOT be used. (optional, default: color is icon0 if window is closed, changes to icon1 if opened)
*
* @author: Wolfram v. Hülsen
*/
{% macro window(id, item_value, item_window_r, item_window_l, min, max, color) %}
{% endmacro %}
/******************************************************************************
* D E P R E C A T E D W I D G E T S
******************************************************************************/
/**
* Has been a switch, build of a series of icons. The series may now be a dynamic svg-icon (icon.NAME), only.
*
* @deprecated as of version 3.0.0, use the icon widget or basic.symbol instead.
* @replacement {{ %4$s('%1$s', '%2$s', '%3$s', %6$s, %7$s) }}
*
* @param {id=} unique id for this widget (optional)
* @param {item(bool)=} an item for the switch (optional)
* @param {item(num,list)} an item for the value
* @param {image} dynamic icon from ./widget/icon.html
* @param {unspecified=} not used any more
* @param {value=0} the minimum value for the item (optional, default 0)
* @param {value=255} the minimum value for the item (optional, default 255)
*
* @see design/design_icons#Dynamic Icons and Static Icons
*/
{% macro shifter(id, item_switch, item_value, pic_on, dummy, min, max) %}
{% import "icon.html" as icon %}
{% if pic_on|slice(0, 5) == 'icon.' %}
{{ attribute(icon, pic_on|slice(5), [id, item_switch, item_value, min, max]) }}
{% else %}
You can still use basic.shifter but please pass the dynamic icons in ./widget/icon.html as a parameter
{% endif %}
{% endmacro %}