]> git.basschouten.com Git - openhab-addons.git/commitdiff
[dmx] Update README.md (#12914)
authorfunkstille <13382630+funkstille@users.noreply.github.com>
Fri, 24 Jun 2022 11:25:01 +0000 (13:25 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Jun 2022 11:25:01 +0000 (13:25 +0200)
* Update README.md

Added Example for ECMAScript

bundles/org.openhab.binding.dmx/README.md

index 59be03274a560eec439852f8226589990098c534..9cc9709f76ac67a17a33a49d9e185a5014377049 100644 (file)
@@ -213,20 +213,41 @@ If the new string is invalid, the old configuration will be used.
 This binding includes a rule action, which allows to immediately change DMX channels from within rules.
 There is a separate instance for each bridge, which can be retrieved e.g. through
 
-```
+:::: tabs
+
+::: tab DSL
+
+```php
 val dmxActions = getActions("dmx","dmx:sacn-bridge:mydmxbridge")
 ```
 
 where the first parameter always has to be `dmx` and the second is the full Thing UID of the bridge that should be used.
 Once this action instance is retrieved, you can invoke the `sendFade(String channels, String fade, Boolean resumeAfter)` method on it:
 
-```
+```php
 dmxActions.sendFade("1:41/3","10000:255,255,255:-1", false)
 ```
 
 The parameters are the same as in a chaser thing configuration.
 Defining more than one step in `fadeString` is supported, too.
 
+:::
+
+::: tab JavaScript
+
+The first parameter always has to be `dmx` and the second is the full Thing UID of the bridge that should be used.
+
+```javascript
+actions.get("dmx","dmx:sacn-bridge:mydmxbridge").sendFade("1:41/3","10000:255,255,255:-1", false);
+```
+
+The sendFade parameters are the same as in a chaser thing configuration.
+Defining more than one step in `fadeString` is supported, too.
+
+:::
+
+::::
+
 ## Full Example
 
 This example defines a sACN/E1.31 bridge in unicast mode which transmits universe 2 and three things: a three channel dimmer used to control a RGB light, which takes 1s to fade from one color to another and 10s from 0-100% on incremental dim commands, a single channel dimmer which will turn on only to 90% if it receives an ON command and does not fully switch off (to 10%) if it receives an OFF command and chaser which changes the colors like a traffic light.