From 8407cf772d557124fe3bfd396bd324d0e07fd73d Mon Sep 17 00:00:00 2001 From: onkelandy Date: Wed, 1 Apr 2020 05:09:56 +0200 Subject: [PATCH 1/3] small fixes to avoid template checker problems --- pages/docu/device/widget_device.smallshut.html | 12 ++++++------ pages/docu/quad/widget_quad.dimmer.html | 4 ++-- widgets/basic.html | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pages/docu/device/widget_device.smallshut.html b/pages/docu/device/widget_device.smallshut.html index e70e0d70f..6b5208c8a 100755 --- a/pages/docu/device/widget_device.smallshut.html +++ b/pages/docu/device/widget_device.smallshut.html @@ -44,12 +44,12 @@
Example
Shutter Table
- {{ device.smallshut('SmS1', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust') }} + {{ device.smallshut('SmS2', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust') }}
- {{ device.smallshut('SmS1', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '') }} - {{ device.uzsuicon('uzsu1', 'uzsuitem') }} + {{ device.smallshut('SmS2', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '') }} + {{ device.uzsuicon('uzsu2', 'uzsuitem') }}
@@ -64,10 +64,10 @@
Example
Shutter Table with type = midi
- {{ device.smallshut('SmS2', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust', 'mini') }} + {{ device.smallshut('SmS3', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust', 'mini') }} - {{ device.smallshut('SmS2', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '', 'mini') }} - {{ device.uzsuicon('uzsu1', 'uzsuitem') }} + {{ device.smallshut('SmS3', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '', 'mini') }} + {{ device.uzsuicon('uzsu3', 'uzsuitem') }}
diff --git a/pages/docu/quad/widget_quad.dimmer.html b/pages/docu/quad/widget_quad.dimmer.html index 3cf303f71..74779bd60 100755 --- a/pages/docu/quad/widget_quad.dimmer.html +++ b/pages/docu/quad/widget_quad.dimmer.html @@ -71,12 +71,12 @@
Example
['uzsu', 'stateengine', 'plot', 'value_popup', 'switch', 'locks', ' '] stateengine with popup (have to long tap to open popup!)
{% filter trim|escape|nl2br %}{% raw %} - {{ quad.dimmer('dimmer1', 'Dimmer Example 1', 'licht.SA', 'licht.dimmen', 0, 255, 1, icon.light('','','licht.dimmen'), icon.light('','','licht.dimmen'), 'icon1', 'icon0', '', '', '100', 'right', 'blink', '', 'licht.dimmen.zeitschalter', ['', '', 'bool'], '%', 'licht.dimmen', '', 'licht.automatik', (stateengine['item1']), ['', 'bwm.sperren', 'licht.zwangvalue'], '', '', ['uzsu', 'stateengine', 'plot', 'value_popup', 'switch', 'locks', ' ']) }} + {{ quad.dimmer('dimmer1', 'Dimmer Example 1', 'licht.SA', 'licht.dimmen', 0, 255, 1, icon.light('','','licht.dimmen','','','blue'), icon.light('','','licht.dimmen'), 'blue', 'icon0', '', '', '100', 'right', 'blink', '', 'licht.dimmen.zeitschalter', ['', '', 'bool'], '%', 'licht.dimmen', '', 'licht.automatik', (stateengine['item1']), ['', 'bwm.sperren', 'licht.zwangvalue'], '', '', ['uzsu', 'stateengine', 'plot', 'value_popup', 'switch', 'locks', ' ']) }} {% endraw %}{% endfilter %}
['switch', 'value_slider'] diff --git a/widgets/basic.html b/widgets/basic.html index fbfd1db9c..6dde5c411 100755 --- a/widgets/basic.html +++ b/widgets/basic.html @@ -302,8 +302,9 @@ * * @param {id=} unique id for this widget (optional) * @param {item[?]} one or more item(s). Multiple items in array-form: [item1, item2] -* @param {format(text,html,script,text2br)=} either a unit of the language file, an individual format string (PHP sprintf like) or a simple string as suffix. +* @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. +* @ add {format(text,html,script,text2br)=} * @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 From dc0569f9765162614beb4d76649b04d041ae7c6c Mon Sep 17 00:00:00 2001 From: onkelandy Date: Wed, 1 Apr 2020 05:14:32 +0200 Subject: [PATCH 2/3] fix smallshut id --- pages/docu/device/widget_device.smallshut.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pages/docu/device/widget_device.smallshut.html b/pages/docu/device/widget_device.smallshut.html index 6b5208c8a..ddfb2256b 100755 --- a/pages/docu/device/widget_device.smallshut.html +++ b/pages/docu/device/widget_device.smallshut.html @@ -33,7 +33,7 @@
Example
- {{ device.smallshut('SmS1', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '') }} + {{ device.smallshut('SmS2', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '') }} {{ device.uzsuicon('uzsu1', 'uzsuitem') }}
@@ -44,12 +44,12 @@
Example
Shutter Table
- {{ device.smallshut('SmS2', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust') }} + {{ device.smallshut('SmS1', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust') }}
{{ device.smallshut('SmS2', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '') }} - {{ device.uzsuicon('uzsu2', 'uzsuitem') }} + {{ device.uzsuicon('uzsu1', 'uzsuitem') }}
@@ -66,8 +66,8 @@
Example
{{ device.smallshut('SmS3', 'Wohnzimmer', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', 'bath.blind.adjust', 'mini') }} - {{ device.smallshut('SmS3', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '', 'mini') }} - {{ device.uzsuicon('uzsu3', 'uzsuitem') }} + {{ device.smallshut('SmS4', 'Bad', 'bath.blind.move', 'bath.blind.stop', 'bath.blind.pos', '', 'mini') }} + {{ device.uzsuicon('uzsu2', 'uzsuitem') }}
From 2afa7f5a002bb07038f034e5b485abd5bdbc4c4f Mon Sep 17 00:00:00 2001 From: onkelandy Date: Wed, 1 Apr 2020 05:44:14 +0200 Subject: [PATCH 3/3] script on quad dimmer docu to auto turn on/off switch when slider value is changed --- pages/docu/quad/widget_quad.dimmer.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/docu/quad/widget_quad.dimmer.html b/pages/docu/quad/widget_quad.dimmer.html index 74779bd60..a667e4ef6 100755 --- a/pages/docu/quad/widget_quad.dimmer.html +++ b/pages/docu/quad/widget_quad.dimmer.html @@ -21,7 +21,14 @@ io.write('licht.automatik.lock', '0'); io.write('bwm.sperren', '0'); io.write('licht.zwangvalue', '0'); - }); + + $( "#widget_quad_dimmer-dimmer1dimmerpopup_slider, #widget_quad_dimmer-dimmer2_slider_inline, #widget_quad_dimmer-dimmer3dimmerpopup_slider" ).change(function(){ + if (this.value > 0) + io.write('licht.SA', '1' ); + else + io.write('licht.SA', '0' ); + }); + }); {% set stateengine = {} %}