From 8d86c390eba95c93be7f99b50e4bf83abc506945 Mon Sep 17 00:00:00 2001 From: wvhn <17801971+wvhn@users.noreply.github.com> Date: Sat, 23 Jan 2021 19:30:50 +0100 Subject: [PATCH] new widget device.window --- changelog.md | 1 + pages/docu/device/widget_device.window.html | 46 +++++++++++++++ widgets/device.html | 63 +++++++++++++++++++++ 3 files changed, 110 insertions(+) create mode 100644 pages/docu/device/widget_device.window.html diff --git a/changelog.md b/changelog.md index 623ae2264..2b84053bb 100755 --- a/changelog.md +++ b/changelog.md @@ -23,6 +23,7 @@ - new widget device.rtrslider for slider control of set temperature and functionality of device.rtr - new widget status.toast to display notifications - new widget basic.window shows opening status of windows and sutter position +- new widget device.window shows window status and opens popup to control the shutter - phone list shows called number on outgoing call if available from backend ### Other New Features diff --git a/pages/docu/device/widget_device.window.html b/pages/docu/device/widget_device.window.html new file mode 100644 index 000000000..a73a36abd --- /dev/null +++ b/pages/docu/device/widget_device.window.html @@ -0,0 +1,46 @@ +/** +* ----------------------------------------------------------------------------- +* @package smartVISU +* @author Wolfram v. Hülsen +* @copyright 2021 +* @license GPL [http://www.gnu.de] +* ----------------------------------------------------------------------------- +*/ + + +{% extends "widget_device.html" %} + +{% block example %} + +
Examples
+ +
+ {% filter trim|escape|nl2br %}{% verbatim %} + {{ basic.window ('', 'shutter', 'window.right', 'window.left') }} + {{ basic.window ('', 'shutter', '', 'window.left', '', '', '#f00') }} + {% endverbatim %}{% endfilter %} +
+ + Use slider to control the shutter and switches to simulate window status + +
+ + {{ basic.slider('','bath.blind.pos') }} + Left window: +
+ {{ basic.stateswitch('', 'bath.light.switch', '', 0, '', '0') }} + {{ basic.stateswitch('', 'bath.light.switch', '', 1, '', '1') }} + {{ basic.stateswitch('', 'bath.light.switch', '', 2, '', '2') }} +
   + Right window: +
+ {{ basic.stateswitch('', 'bath.light.multistate', '', 0, '', '0') }} + {{ basic.stateswitch('', 'bath.light.multistate', '', 1, '', '1') }} + {{ basic.stateswitch('', 'bath.light.multistate', '', 2, '', '2') }} +
+
+ {{ device.window ('', 'Window Kitchen North', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '', 'bath.light.multistate', 'bath.light.switch', 'icon') }}
+ +
+ +{% endblock %} diff --git a/widgets/device.html b/widgets/device.html index bf5017e25..f11ec6864 100755 --- a/widgets/device.html +++ b/widgets/device.html @@ -596,3 +596,66 @@ {% endmacro %} + +/** + * Displays window status and a simple shutter control assembly in a popup + * + * @param {id=} unique id for this widget + * @param {text=} title of the window (optional) + * @param {item(bool,num)} item for the up- and down- movement of the shutter + * @param {item(bool,num)} item for stopping the movement of the shutter (optional) + * @param {item(num)=} item for the position of the shutter (optional) + * @param {item(num)=} item to move the shutters to the shade position (optional) + * @param {item(num)=} item to display the window's right wing status (optional) + * @param {item(num)=} item to display the window's left wing status (optional) + * @param {type=micro} type: 'micro', 'mini', 'midi', 'icon' (optional, default: mini) + * @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 {color=} color e.g. '#f00' for red (constant, 'icon0' and 'icon1' can NOT be used) (optional, default: color is icon0 if window is closed, changes to icon1 if opened) + */ +{% macro window (id, txt, item_move, item_stop, item_pos, item_shade, item_window_r, item_window_l, type, min, max, step, color ) %} + {% import "basic.html" as basic %} + {% set uid = uid(page, id) %} + + + + + {{ basic.window (uid~'-icon', item_pos, item_window_r, item_window_l, min, max, color) }} + + +
+
+ {{ basic.window(uid~'-icon', item_pos, item_window_r, item_window_l, min, max, '') }} + {{ txt|e }} +
+
+ {{ basic.stateswitch(id~'up', item_move, 'mini', 0, 'control_arrow_up.svg') }} + {{ basic.stateswitch(id~'down', item_move, 'mini', 1, 'control_arrow_down.svg') }} + {% if item_stop %}{{ basic.stateswitch(id~'stop', item_stop, 'mini', 1, 'audio_stop.svg') }}{% endif %} + {% if item_shade %}{{ basic.stateswitch(id~'shade', item_shade, 'mini', 1, 'fts_shutter_50.svg') }}{% endif %} +
+ {% if item_pos %} +
+ {{ basic.slider(id~'slider', item_pos, min , max , step, 'horizontal', 'handle' ) }} +
+ {% endif %} + Schließen +
+{% endmacro %}